Пример #1
0
        /// <summary>
        /// Buys and places a plant
        /// </summary>
        /// <param name="row">Row</param>
        /// <param name="col">Column</param>
        /// <param name="plant">Plant to place</param>
        internal void BuyAndPlace(int row, int col, Plant plant)
        {
            //Check if the row and column are valid
            if (_wrapper.CheckPlace(row, col, plant.Bounds, plant) && _vars.GetMoons() >= plant.GetPrice())
            {
                //Place the plant
                _vars.board[row, col] = plant;

                //Make the player lose moons
                _vars.AddMoons(-plant.GetPrice());
            }
        }
Пример #2
0
 /// <summary>
 /// Adds moons to the total
 /// </summary>
 /// <param name="amount">Amount to add</param>
 public void AddMoons(int amount)
 {
     _vars.AddMoons(amount);
 }