Beispiel #1
0
 private void ProcessTurnOutcome(Enums.TurnOutcome turnOutcome)
 {
     if (turnOutcome != Enums.TurnOutcome.MoveMadeAndPointScored)
     {
         _numberOfTurnsWithNoPointsGained++;
     }
     else
     {
         _numberOfTurnsWithNoPointsGained = 0;
     }
 }
Beispiel #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;
     }
 }
Beispiel #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);
        }
Beispiel #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);
 }