public GameAI(GameClient game, Duel duel) { Game = game; Connection = game.Connection; Duel = duel; Utils = new AIFunctions(duel); m_dialogs = new Dialogs(game); }
private void StartDuel() { if (m_gameClients.Count <= MaxGames) { GameClient game = new GameClient(this, m_server); game.Start(); AddGameClient(game); Logger.WriteLine("Checkmate game created."); } }
public void AddGameClient(GameClient client) { m_addedClients.Add(client); }
public void RemoveGameClient(GameClient client) { m_removedClients.Add(client); }
private void OnStartDuel(string data) { DuelRequest duel = JsonConvert.DeserializeObject<DuelRequest>(data); ServerInfo server = Client.GetServer(duel.Server); if (server != null) { Logger.WriteLine("Duel requested. Room informations are " + duel.DuelFormatString + "."); GameClient game = new GameClient(Client, server, duel.DuelFormatString); game.Start(); Client.AddGameClient(game); } }