src/town.h
branchgamebalance
changeset 9897 4a2d75b60786
parent 9896 2473804114de
child 9899 cde52f745560
equal deleted inserted replaced
9896:2473804114de 9897:4a2d75b60786
   200 
   200 
   201 		this->SetActivity(this->GetActivity() + activity_change);
   201 		this->SetActivity(this->GetActivity() + activity_change);
   202 
   202 
   203 		DEBUG(eco, 5, "Modifying EAL for town at 0x%x by %f to %f", xy, (double)activity_change, (double)this->GetActivity());
   203 		DEBUG(eco, 5, "Modifying EAL for town at 0x%x by %f to %f", xy, (double)activity_change, (double)this->GetActivity());
   204 	}
   204 	}
       
   205 
       
   206 	/**
       
   207 	 * Gets the so ralled "town radius group" of a tile which is a
       
   208 	 * representation of how close a tile is relative to the town
       
   209 	 * center depending on the size of the town
       
   210 	 * @param tile            The tile which the town radius is to be computed for
       
   211 	 * @param ignore_funding  When a player opted to fund buildings, select the
       
   212 	 *                        appropriate group unless this flag is set.
       
   213 	 * @return                The town radius group
       
   214 	 */
       
   215 	uint GetRadiusGroup(TileIndex tile, bool ignore_funding = false) const
       
   216 	{
       
   217 		uint dist = DistanceSquare(tile, xy);
       
   218 		uint smallest = 0;
       
   219 
       
   220 		if (!ignore_funding && fund_buildings_months > 0 && dist < 25) return 4;
       
   221 
       
   222 		for (uint i = 0; i != lengthof(radius); i++) if (dist < radius[i]) smallest = i;
       
   223 
       
   224 		return smallest;
       
   225 	}
       
   226 
   205 };
   227 };
   206 
   228 
   207 struct HouseSpec {
   229 struct HouseSpec {
   208 	/* Standard properties */
   230 	/* Standard properties */
   209 	Year min_date;                     ///< introduction year of the house
   231 	Year min_date;                     ///< introduction year of the house