Esempio n. 1
0
 /// <summary>
 /// Adds the SeedMovements of "moveToIntegrate" in the parameter
 /// </summary>
 /// <param name="move"></param>
 /// <returns></returns>
 public void IntegrateMove(Move moveToIntegrate)
 {
     for (int index = 0; index < moveToIntegrate.GetNumberOfSeedMovements(); ++index)
     {
         AddSeedMovementToTheFront(moveToIntegrate.GetSeedMovement(index));
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Performs the move given in the parameter.
        /// </summary>
        /// <param name="move">The move to perform</param>
        public void PerformMove(Move move)
        {
            //DEBUG     Logging.I.LogMessage("Entering GameBoard.PerformMove().\n");
            // Go through all seed movements of the move and add and remove seeds of the respective pits:
            for (int index = 0; index < move.GetNumberOfSeedMovements(); ++index)
            {
                SeedMovement seedMovement = move.GetSeedMovement(index);
            //DEBUG         Logging.I.LogMessage("             Removing " + seedMovement.NumberOfSeeds + " seeds from pit " + seedMovement.FromPit +
            //DEBUG                              " and adding them to pit " + seedMovement.ToPit + ".\n");

                _pit[seedMovement.FromPit].RemoveSeeds(seedMovement.NumberOfSeeds);
                _pit[seedMovement.ToPit].AddSeeds(seedMovement.NumberOfSeeds);
            }
        }