Ejemplo n.º 1
0
 public static Game FromMessage(GameStartMessage gameStartMessage)
 {
     return(new Game(gameStartMessage.PlayerIndex, gameStartMessage.Usernames, gameStartMessage.Teams,
                     gameStartMessage.ReplayId, gameStartMessage.ChatRoom, gameStartMessage.TeamChatRoom,
                     gameStartMessage.GameType,
                     new List <ITargetHeuristic> {
         new ExpandHeuristic(), new CityHeuristic(), new AttackHeuristic(),
         new CapturePlayerHeuristic()
         //  new DefendKingHeuristic()
     }));
 }
Ejemplo n.º 2
0
        private void GameStarted(object data)
        {
            GameStartMessage message = JsonConvert.DeserializeObject <GameStartMessage>(data.ToString());

            _game = Game.FromMessage(message);
        }