Exemple #1
0
        private bool addHouse()
        {
            // This assumes that the player already has monopoly over this color
            // There is another function that will allow house building based on a bool value for monopoly
            // There will also be another function that will check if the houses are equal or less across the monopoly

            // Checks if the player has enough money to buy a house
            if (houseCost > owner.getMoney && numberOfHouses < 4)
            {
                Game1.debugMessageQueue.addMessageToQueue("Player \"" + this.getName + "\" purchases a house for " + houseCost);

                owner.PlayerPurchasesHouse(houseCost);
                numberOfHouses++;

                updateRentCost();

                // Player has enough funds and return success
                return(true);
            }
            else
            {
                // Player does not have enough funds or reached max number of houses
                return(false);
            }
        }