|
OpenTTD Source 20251104-master-g3befbdd52f
|
Public Member Functions | |
| UnitID | NextID () const |
| Find first unused unit number. | |
| UnitID | UseID (UnitID index) |
| Use a unit number. | |
| void | ReleaseID (UnitID index) |
| Release a unit number. | |
Private Types | |
| using | BitmapStorage = size_t |
Private Attributes | |
| std::vector< BitmapStorage > | used_bitmap {} |
Static Private Attributes | |
| static constexpr size_t | BITMAP_SIZE = std::numeric_limits<BitmapStorage>::digits |
Definition at line 54 of file company_base.h.
|
private |
Definition at line 61 of file company_base.h.
| UnitID FreeUnitIDGenerator::NextID | ( | ) | const |
Find first unused unit number.
This does not mark the unit number as used.
Definition at line 1829 of file vehicle.cpp.
References FindFirstBit().
Referenced by ChangeOwnershipOfCompanyItems(), and CmdCreateGroup().
| void FreeUnitIDGenerator::ReleaseID | ( | UnitID | index | ) |
Release a unit number.
If the unit number is not valid it is ignored.
| index | Unit number to release. |
Definition at line 1861 of file vehicle.cpp.
References ClrBit().
Referenced by CmdDeleteGroup().
Use a unit number.
If the unit number is not valid it is ignored.
| index | Unit number to use. |
Definition at line 1844 of file vehicle.cpp.
References SetBit().
Referenced by AfterLoadGame(), ChangeOwnershipOfCompanyItems(), and CmdCreateGroup().
|
staticconstexprprivate |
Definition at line 62 of file company_base.h.
|
private |
Definition at line 64 of file company_base.h.