private void StartGame(ClientProfile sideA, ClientProfile sideB) { Console.WriteLine("Paired {0} with {1}", sideA.Username, sideB.Username); var gameControl = new GameController(sideA, sideB); gameControl.Start(); }
public GameController(ClientProfile profileA, ClientProfile profileB) { _profileA = profileA; _profileB = profileB; _state = GameState.Unready; _isRunning = true; _updateFunctions[GameState.Unready] = UpdateUnready; _updateFunctions[GameState.WaitForArmyFormations] = UpdateWaitForArmyFormations; _updateFunctions[GameState.KickoffMatch] = UpdateKickoffMatch; _updateFunctions[GameState.WaitForConfirmations] = UpdateWaitForConfirmations; _updateFunctions[GameState.GetMoveFromA] = UpdateGetMoveFromA; _updateFunctions[GameState.GetMoveFromB] = UpdateGetMoveFromB; _updateFunctions[GameState.ReportGameResult] = UpdateReportGameResult; }