예제 #1
0
 internal void UpdateGame(Game game)
 {
     game.BlackPlayerId = this.BlackPlayerId;
     game.WhitePlayerId = this.WhitePlayerId;
     game.UserIdInTurn = this.UserIdInTurn;
     game.GameStatus.StatusName = this.Status;
 }
예제 #2
0
 public static GameModel ConvertToModel(Game game)
 {
     return new GameModel()
     {
         Id = game.Id,
         WhitePlayerId = game.WhitePlayerId,
         BlackPlayerId = game.BlackPlayerId,
         UserIdInTurn = game.UserIdInTurn,
         Status = game.GameStatus.StatusName,
         Name = game.Name
     };
 }
예제 #3
0
 protected void SendMessage(string text, User toUser, Game game, MessagesType msgType)
 {
     game.Messages.Add(new Message()
     {
         UserId = toUser.Id,
         MessagesType = msgType,
         IsMsgRead = false,
         Text = text
     });
 }