예제 #1
0
 /// <summary>
 /// moves the player forwards or backwards on the board
 /// </summary>
 /// <param name="positions"></param>
 public void MoveTo(int positions)
 {
     if (!IsInJail)
     {
         if (positions < 0)
         {
             for (int i = positions; i < 0; i++)
             {
                 CurrentTile = CurrentTile.PreviousTile;
             }
         }
         else
         {
             for (int i = 0; i < positions; i++)
             {
                 CurrentTile = CurrentTile.NextTile;
                 if (CurrentTile.Equals(CurrentGame.Start))
                 {
                     Money += 200;
                 }
             }
         }
     }
     CurrentTile.DoAction(this);
 }