Esempio n. 1
0
 private void ProcessTurnOutcome(Enums.TurnOutcome turnOutcome)
 {
     if (turnOutcome != Enums.TurnOutcome.MoveMadeAndPointScored)
     {
         _numberOfTurnsWithNoPointsGained++;
     }
     else
     {
         _numberOfTurnsWithNoPointsGained = 0;
     }
 }
Esempio n. 2
0
 private void ProcessTurnOutcome(Enums.TurnOutcome turnOutcome)
 {
     if (turnOutcome != Enums.TurnOutcome.MoveMadeAndPointScored &&
         turnOutcome != Enums.TurnOutcome.MoveMadeAndBonusPointScored &&
         turnOutcome != Enums.TurnOutcome.MoveMadePointScoredAndDroppedPoisonPill &&
         turnOutcome != Enums.TurnOutcome.MoveMadeBonusPointScoredAndDroppedPoisonPill)
     {
         _numberOfTurnsWithNoPointsGained++;
     }
     else
     {
         _numberOfTurnsWithNoPointsGained = 0;
     }
 }
Esempio n. 3
0
        public Enums.GameOutcome ProcessGame(Maze maze, Enums.TurnOutcome turnOutcome)
        {
            ProcessTurnOutcome(turnOutcome);

            if (IsOutOfPills(maze))
            {
                return(Enums.GameOutcome.OutOfPills);
            }
            if (_numberOfTurnsWithNoPointsGained > Properties.Settings.Default.SettingMaxTurnsWithNoPointsScored)
            {
                return(Enums.GameOutcome.NoScoringMaxed);
            }

            return(Enums.GameOutcome.ProceedToNextRound);
        }
Esempio n. 4
0
 private Enums.GameOutcome GetGameOutcome(Maze mazeFromPlayer, StreamWriter logFile, Enums.GameOutcome gameOutcome, Enums.TurnOutcome turnOutcome)
 {
     logFile.WriteLine("[GAME] : Player " + _currentPlayer.GetPlayerName() + " has " + _currentPlayer.GetScore() + " points");
     logFile.WriteLine("[TURN] : Moved to " + _currentPlayer.GetCurrentPosition().X + ", " + _currentPlayer.GetCurrentPosition().Y);
     gameOutcome = _gameMarshaller.ProcessGame(mazeFromPlayer, turnOutcome);
     logFile.WriteLine("[TURN] : " + _gameMarshaller.GetTurnsWithoutPointsInfo() + " turns without points");
     logFile.WriteLine("[GAME] : " + gameOutcome);
     return(gameOutcome);
 }