Esempio n. 1
0
 public DataMessage(Messages.Data data) : base(data.playerId)
 {
     Tasks          = data.TaskFields?.Select(q => new GameObjects.TaskField(q)).ToArray();
     Goals          = data.GoalFields?.Select(q => new GameObjects.GoalField(q)).ToArray();
     GameFinished   = data.gameFinished;
     PlayerGUID     = data.playerGuid;
     PlayerLocation = data.PlayerLocation != null ? new GameObjects.Location(data.PlayerLocation) : null;
     Pieces         = data.Pieces?.Select(q => new GameObjects.Piece(q)).ToArray();
 }
Esempio n. 2
0
 public GameMessage(Game game) : base(game)
 {
     Players        = game.Players?.Select(q => new GameObjects.Player(q)).ToArray();
     Board          = new GameObjects.GameBoard((int)game.Board.width, (int)game.Board.tasksHeight, (int)game.Board.goalsHeight);
     PlayerLocation = new GameObjects.Location(game.PlayerLocation);
 }