- Modified `FindNearestRecursive` to handle an optional parameter to exclude a specific element from the search.
- Added `FindNearestExcept` function to find the nearest element excluding a specified element.
- Improved Doxygen comments for `FindNearest`, `FindNearestExcept`, and `FindContained` functions.
- Ensured that Doxygen comments now include parameter descriptions and return values for better documentation and clarity.
- Modified `Industry::counts` to use a vector of pairs to store pairs of `TownID` and vectors of `IndustryID`.
- Modified `IncIndustryTypeCount` and `DecIndustryTypeCount` to manage industry counts at the town level.
- Introduced `ProcessIndustries` as a helper function to process and count industries based on a provided condition.
- Introduced `CountTownIndustriesOfTypeMatchingCondition` to count industries for a specific type within a town or across all towns.
- Modified `GetIndustryTypeCount` function to utilize the new counting mechanism.
- Updated `ResetIndustryCounts` to clear the vector of industry counts for each industry type.
- Updated `DoCreateNewIndustry` and save/load functions to use the new `IncIndustryTypeCount` method.
- Updated `Industry::~Industry` to use the new `DecIndustryTypeCount` method.
- Modified `FindTownForIndustry` to use the new `HasTownIndustryOfType` method for better performance.
- Modified `GetCountAndDistanceOfClosestInstance` to use `CountTownIndustriesOfTypeMatchingCondition` for more efficient counting.
Kdtree uses a function pointer and incorrectly calls it a functor. The function pointer needs to be passed on instantiaton.
Instead, use an actual functor. This simplifies instantiation.
Ship and RoadVehicle path caches use a std::deque, which is quite memory hungry, especially for RoadVehicle which has two.
std::deque was used to be able to push/pop from either end.
Change to use a single std::vector each, which is now push/popped from the back.
IndustrySpec and IndustryTileSpec cargo label lists are only used for original industries. Original industries can only have up to 2 inputs and 3 outputs. Therefore having space for 16 input/outputs slots is unnecessary
This saves 216 bytes per industry type, and 164 bytes per industry tile type.
* After double-clicking on a location button to follow a vehicle, show that state by drawing the location button in a lowered state.
* Allow cancelling the follow state by clicking on the location button again.
This allows water tiles which cannot flood any further to not even try to flood.
On a large map with lots of water tiles this can noticeably reduce game loop processing time.
Mostly ported from JGRPP.