Beispiel #1
0
        /// <summary>
        /// Construct an affordable home
        /// </summary>
        /// <param name="map"></param>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="money"></param>
        /// <returns>new map</returns>
        public Building[,] BuildAffordableHome(Building[,] map, int x, int y, long money)
        {
            Building affordableHome = new AffordableHomes();

            if (money < affordableHome.BuildCost)
            {
                return(map);
            }

            map[x, y] = affordableHome;
            return(map);
        }
        /// <summary>
        /// Construct an affordable home
        /// </summary>
        /// <param name="map"></param>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="money"></param>
        /// <returns>new map</returns>
        public Building[,] BuildAffordableHome(Building[,] map, int x, int y, long money)
        {
            Building affordableHome = new AffordableHomes();

            if (money < affordableHome.BuildCost)
            {
                return(map);
            }

            //Increase the percent happiness according to the number of parks adjacent
            affordableHome.GetPercentHappiness += 10 * IsThereParkAdjacent(map, x, y);
            map[x, y] = affordableHome;
            return(map);
        }