Exemplo n.º 1
0
 public AwariBoard Sow(string pit)
 {
     if (!PitIsOnSideToMove(pit))
     {
         if (_position.History.Count > 0)
         {
             throw new ArgumentException($"{(FirstToMove == AwariPlayer.South ? AwariPlayer.North : AwariPlayer.South)} already moved, a player cannot make two moves in a row.");
         }
         else
         {
             throw new ArgumentException($"Only South can make the first move (A-F).");
         }
     }
     if (CanSow(pit))
     {
         _position.Sow(GetPitIndex(pit));
         FirstToMove = FirstToMove == AwariPlayer.South ? AwariPlayer.North : AwariPlayer.South;
     }
     return(this);
 }