forked from project-redbud/FunGame-Core
添加GameStatistics构造函数
This commit is contained in:
parent
8f6555687b
commit
eee995433c
@ -1,11 +1,9 @@
|
|||||||
using Milimoe.FunGame.Core.Library.Constant;
|
namespace Milimoe.FunGame.Core.Entity
|
||||||
|
|
||||||
namespace Milimoe.FunGame.Core.Entity
|
|
||||||
{
|
{
|
||||||
public class GameStatistics
|
public class GameStatistics
|
||||||
{
|
{
|
||||||
public long Id => Room.Id;
|
public long Id => Room.Id;
|
||||||
public Room Room { get; set; } = General.HallInstance;
|
public Room Room { get; }
|
||||||
public DateTime RecordTime { get; set; } = DateTime.Now;
|
public DateTime RecordTime { get; set; } = DateTime.Now;
|
||||||
public string Record { get; set; } = "";
|
public string Record { get; set; } = "";
|
||||||
public Dictionary<User, decimal> DamageStats { get; set; } = new();
|
public Dictionary<User, decimal> DamageStats { get; set; } = new();
|
||||||
@ -68,5 +66,10 @@ namespace Milimoe.FunGame.Core.Entity
|
|||||||
public Dictionary<User, decimal> RatingStats { get; } = new(); // 结算后的Rating
|
public Dictionary<User, decimal> RatingStats { get; } = new(); // 结算后的Rating
|
||||||
public Dictionary<User, decimal> EloStats { get; } = new(); // Elo分数变化(+/-)
|
public Dictionary<User, decimal> EloStats { get; } = new(); // Elo分数变化(+/-)
|
||||||
public Dictionary<User, string> RankStats { get; } = new(); // 结算后的Rank(非比赛前)
|
public Dictionary<User, string> RankStats { get; } = new(); // 结算后的Rank(非比赛前)
|
||||||
|
|
||||||
|
public GameStatistics(Room Room)
|
||||||
|
{
|
||||||
|
this.Room = Room;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,11 +14,11 @@ namespace Milimoe.FunGame.Core.Entity
|
|||||||
public RoomState RoomState { get; set; }
|
public RoomState RoomState { get; set; }
|
||||||
public bool HasPass => Password.Trim() != "";
|
public bool HasPass => Password.Trim() != "";
|
||||||
public string Password { get; set; } = "";
|
public string Password { get; set; } = "";
|
||||||
public GameStatistics Statistics { get; set; } = new();
|
public GameStatistics Statistics { get; set; }
|
||||||
|
|
||||||
internal Room()
|
internal Room()
|
||||||
{
|
{
|
||||||
|
Statistics = new(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal Room(long Id = 0, string Roomid = "-1", DateTime? CreateTime = null, User? RoomMaster = null, RoomType RoomType = RoomType.All, RoomState RoomState = RoomState.Created, string Password = "")
|
internal Room(long Id = 0, string Roomid = "-1", DateTime? CreateTime = null, User? RoomMaster = null, RoomType RoomType = RoomType.All, RoomState RoomState = RoomState.Created, string Password = "")
|
||||||
@ -30,6 +30,7 @@ namespace Milimoe.FunGame.Core.Entity
|
|||||||
this.RoomType = RoomType;
|
this.RoomType = RoomType;
|
||||||
this.RoomState = RoomState;
|
this.RoomState = RoomState;
|
||||||
this.Password = Password;
|
this.Password = Password;
|
||||||
|
Statistics = new(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Equals(Room other)
|
public bool Equals(Room other)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user