예제 #1
0
 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);
 }
예제 #2
0
        public void StartGame(GameInfo game)
        {
            if (_timer == null)
            {
                _timer = new Timer(10000);
                _timer.Elapsed += TimeElapsed;
            }

            _game = game;
            OnGameStarted(_game);
            _game.NewTurn();
            OnTurnStarted(_game);
        }
예제 #3
0
 protected void OnTurnCompleted(GameInfo gameInfo, TurnData data)
 {
     var turnCompletedEvent = TurnCompleted;
     if (turnCompletedEvent != null)
         turnCompletedEvent(this, new TurnCompletedEventArgs(gameInfo, data));
 }
예제 #4
0
 protected void OnTurnStarted(GameInfo gameInfo)
 {
     _timer.Start();
     var turnStartedEvent = TurnStarted;
     if (turnStartedEvent != null)
         turnStartedEvent(this, new TurnStartEventArgs(gameInfo));
 }
예제 #5
0
 protected void OnGameStarted(GameInfo gameInfo)
 {
     var gameStartedEvent = GameStarted;
     if (gameStartedEvent != null)
         gameStartedEvent(this, new GameStartEventArgs(gameInfo));
 }
예제 #6
0
 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;
 }
예제 #8
0
 public GameOverEventArgs(GameInfo gameInfo)
 {
     GameInfo = gameInfo;
 }
예제 #9
0
 public TurnStartEventArgs(GameInfo gameInfo)
 {
     GameInfo = gameInfo;
 }