예제 #1
0
 public void AdvancePlayer()
 {
     if (IsOver)
     {
         return;
     }
     for (Int32 i = 0; i < gameTable.Size; ++i)
     {
         for (Int32 j = gameTable.Size - 1; j >= 0; --j)
         {
             if (gameTable.GetValue(i, j) == Field.FUEL)
             {
                 if (gameTable.GetValue(i, j + 1) == Field.PLAYER)
                 {
                     fuel += 11;
                 }
                 else if (j < gameTable.Size - 2)
                 {
                     gameTable.SetValue(i, j + 1, Field.FUEL);
                 }
                 gameTable.SetValue(i, j, Field.ROAD);
             }
         }
     }
     --fuel;
     if (fuel == 0)
     {
         OnGameOver();
     }
     OnGameAdvance();
 }