/// <summary> /// Construct a luxury home /// </summary> /// <param name="map"></param> /// <param name="x"></param> /// <param name="y"></param> /// <param name="money"></param> /// <returns>new map</returns> public Building[,] BuildLuxuryHome(Building[,] map, int x, int y, long money) { Building luxuryHome = new luxuryHomes(); if (money < luxuryHome.BuildCost) { return(map); } map[x, y] = luxuryHome; return(map); }
/// <summary> /// Construct a luxury home /// </summary> /// <param name="map"></param> /// <param name="x"></param> /// <param name="y"></param> /// <param name="money"></param> /// <returns>new map</returns> public Building[,] BuildLuxuryHome(Building[,] map, int x, int y, long money) { Building luxuryHome = new luxuryHomes(); if (money < luxuryHome.BuildCost) { return(map); } //Increase the percent happiness according to the number of parks adjacent luxuryHome.GetPercentHappiness += 10 * IsThereParkAdjacent(map, x, y); map[x, y] = luxuryHome; return(map); }