Merge branch 'master' into jgrpp
# Conflicts: # CMakeLists.txt # bin/ai/CMakeLists.txt # bin/game/CMakeLists.txt # src/ai/ai_info.cpp # src/company_base.h # src/economy.cpp # src/game/game_info.cpp # src/gfx_type.h # src/linkgraph/linkgraph_gui.cpp # src/palette.cpp # src/palette_func.h # src/saveload/saveload.h # src/saveload/vehicle_sl.cpp # src/ship_cmd.cpp # src/train_cmd.cpp # src/vehicle_base.h # src/window.cpp # src/window_func.h
This commit is contained in:
@@ -52,6 +52,19 @@ struct CompanyInfrastructure {
|
||||
char *Dump(char *buffer, const char *last) const;
|
||||
};
|
||||
|
||||
class FreeUnitIDGenerator {
|
||||
public:
|
||||
UnitID NextID() const;
|
||||
UnitID UseID(UnitID index);
|
||||
void ReleaseID(UnitID index);
|
||||
|
||||
private:
|
||||
using BitmapStorage = size_t;
|
||||
static constexpr size_t BITMAP_SIZE = std::numeric_limits<BitmapStorage>::digits;
|
||||
|
||||
std::vector<BitmapStorage> used_bitmap;
|
||||
};
|
||||
|
||||
enum CompanyBankruptcyFlags : byte {
|
||||
CBRF_NONE = 0x0,
|
||||
CBRF_SALE = 0x1, ///< the company has been marked for sale
|
||||
@@ -151,6 +164,8 @@ struct Company : CompanyPool::PoolItem<&_company_pool>, CompanyProperties {
|
||||
|
||||
CompanyInfrastructure infrastructure; ///< NOSAVE: Counts of company owned infrastructure.
|
||||
|
||||
FreeUnitIDGenerator freeunits[VEH_COMPANY_END];
|
||||
|
||||
Money GetMaxLoan() const;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user