public void StartGame(string player1, string player2, Settings settings) { _settings = settings; _game = new GameInfo(settings) { Player1 = player1, Player2 = player2 }; OnGameStarted(_game); _game.NewTurn(); OnTurnStarted(_game); }
public void StartGame(GameInfo game) { if (_timer == null) { _timer = new Timer(10000); _timer.Elapsed += TimeElapsed; } _game = game; OnGameStarted(_game); _game.NewTurn(); OnTurnStarted(_game); }
protected void OnTurnCompleted(GameInfo gameInfo, TurnData data) { var turnCompletedEvent = TurnCompleted; if (turnCompletedEvent != null) turnCompletedEvent(this, new TurnCompletedEventArgs(gameInfo, data)); }
protected void OnTurnStarted(GameInfo gameInfo) { _timer.Start(); var turnStartedEvent = TurnStarted; if (turnStartedEvent != null) turnStartedEvent(this, new TurnStartEventArgs(gameInfo)); }
protected void OnGameStarted(GameInfo gameInfo) { var gameStartedEvent = GameStarted; if (gameStartedEvent != null) gameStartedEvent(this, new GameStartEventArgs(gameInfo)); }
protected void OnGameOver(GameInfo gameInfo) { var gameOverEvent = GameOver; if (gameOverEvent != null) gameOverEvent(this, new GameOverEventArgs(gameInfo)); }
public TurnCompletedEventArgs(GameInfo gameInfo, TurnData data) { GameInfo = gameInfo; TurnData = data; }
public GameOverEventArgs(GameInfo gameInfo) { GameInfo = gameInfo; }
public TurnStartEventArgs(GameInfo gameInfo) { GameInfo = gameInfo; }