mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-01 09:48:37 +00:00
Add some necessary properties for topscores
This commit is contained in:
parent
04c8995003
commit
35fba33216
1 changed files with 26 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
|
using LBPUnion.ProjectLighthouse.Serialization;
|
||||||
using LBPUnion.ProjectLighthouse.Types.Levels;
|
using LBPUnion.ProjectLighthouse.Types.Levels;
|
||||||
|
|
||||||
namespace LBPUnion.ProjectLighthouse.Types
|
namespace LBPUnion.ProjectLighthouse.Types
|
||||||
|
@ -28,12 +29,36 @@ namespace LBPUnion.ProjectLighthouse.Types
|
||||||
|
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
[XmlElement("playerIds")]
|
[XmlElement("playerIds")]
|
||||||
public string[] PlayerIds {
|
public string[] PlayerIds
|
||||||
|
{
|
||||||
get => this.PlayerIdCollection.Split(",");
|
get => this.PlayerIdCollection.Split(",");
|
||||||
set => this.PlayerIdCollection = string.Join(',', value);
|
set => this.PlayerIdCollection = string.Join(',', value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[XmlElement("mainPlayer")]
|
||||||
|
[NotMapped]
|
||||||
|
public string MainPlayer
|
||||||
|
{
|
||||||
|
get => this.PlayerIds[0];
|
||||||
|
set => this.PlayerIds[0] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
[XmlElement("rank")]
|
||||||
|
[NotMapped]
|
||||||
|
public int Rank { get; set; }
|
||||||
|
|
||||||
[XmlElement("score")]
|
[XmlElement("score")]
|
||||||
public int Points { get; set; }
|
public int Points { get; set; }
|
||||||
|
|
||||||
|
public string Serialize()
|
||||||
|
{
|
||||||
|
string score = LbpSerializer.StringElement("type", this.Type) +
|
||||||
|
LbpSerializer.StringElement("playerIds", this.PlayerIdCollection) +
|
||||||
|
LbpSerializer.StringElement("mainPlayer", this.MainPlayer) +
|
||||||
|
LbpSerializer.StringElement("rank", this.Rank) +
|
||||||
|
LbpSerializer.StringElement("score", this.Points);
|
||||||
|
|
||||||
|
return LbpSerializer.StringElement("playRecord", score);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue