예제 #1
0
 public void ApplyTo(Game game)
 {
     game.NextTurn();
     if (game.CurrentPhase == GamePhase.Play)
     {
         if (!IsDeterminated)
         {
             SetDiceTotal(Game.RandomEventChance.GetNextDiceTotal());
         }
         _enrolmentInfo = game.DiceRoll(DiceTotal);
     }
 }
예제 #2
0
 private EnrolmentInfo RollDice(int total)
 {
     ColorConsole.WriteLineIf(HasHumanPlayer, ConsoleColor.Green, "Dice rolled, total: {0}", total);
     var info = new EnrolmentInfo();
     if (total != 7)
     {
         info.AddedStudents = Enrol(total);
     }
     else
     {
         ColorConsole.WriteLineIf(HasHumanPlayer, ConsoleColor.Yellow, "Funds cut!");
         info.CutStudents = CutStudents();
     }
     return info;
 }
예제 #3
0
 public void UndoEndTurn(int diceTotal, EnrolmentInfo enrolmentInfo)
 {
     if (enrolmentInfo.AddedStudents != null)
     {
         for (int i = 0; i < NumberOfUniversities; ++i)
         {
             _universities[i].RemoveExtraStudents(enrolmentInfo.AddedStudents[i]);
         }
     }
     if (enrolmentInfo.CutStudents != null)
     {
         for (int i = 0; i < NumberOfUniversities; ++i)
         {
             _universities[i].AddBackStudents(enrolmentInfo.CutStudents[i]);
         }
     }
     CurrentUniversityIndex = (CurrentUniversityIndex + _universities.Length - 1)%_universities.Length;
     _allAvailableMoves = null;
     --CurrentTurn;
     GameStats.UndoDiceRolled(diceTotal);
 }