Esempio n. 1
0
        /// <summary>
        /// Construct a comfortable home
        /// </summary>
        /// <param name="map"></param>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="money"></param>
        /// <returns>new map</returns>
        public Building[,] BuildComfortableHome(Building[,] map, int x, int y, long money)
        {
            Building comfortableHome = new comfortableHomes();

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

            map[x, y] = comfortableHome;
            return(map);
        }
        /// <summary>
        /// Construct a comfortable home
        /// </summary>
        /// <param name="map"></param>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="money"></param>
        /// <returns>new map</returns>
        public Building[,] BuildComfortableHome(Building[,] map, int x, int y, long money)
        {
            Building comfortableHome = new comfortableHomes();

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

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