glx22
d7bd67cda3
Add: [Scripts] "_typeof" metamethod
2025-02-18 21:19:15 +01:00
Peter Nelson
154896ce55
Codechange: Use GetString() with local parameters in script functions. ( #13585 )
2025-02-16 21:27:25 +00:00
Rubidium
fd4adc55e3
Codechange: replace INVALID_X with XID::Invalid() for PoolIDs
2025-02-16 20:23:00 +01:00
Rubidium
59df0ff496
Codechange: strongly type StationID
2025-02-16 18:25:51 +01:00
Rubidium
70c9f3963c
Codechange: strongly type VehicleID
2025-02-16 14:50:15 +01:00
Rubidium
7e04651220
Codechange: strongly type EngineID
2025-02-16 14:50:15 +01:00
Rubidium
380e7b48ce
Codechange: use std::variant instead of a custom version for news references
2025-02-16 14:50:15 +01:00
Rubidium
2cb59b1856
Codechange: make VehicleID an enum
2025-02-16 14:50:15 +01:00
Rubidium
c25c3e8710
Codechange: make IndustryID an enum
2025-02-16 14:50:15 +01:00
Rubidium
ab8177ea77
Codechange: strongly type CompanyID
2025-02-16 14:02:18 +01:00
Rubidium
5401ab1f7b
Codechange: use ReferenceThroughBaseContainer for containers that are index by CompanyID
2025-02-16 14:02:18 +01:00
Rubidium
1ffc950e22
Codechange: use prefix operator++ for CompanyID iterations
2025-02-16 14:02:18 +01:00
Peter Nelson
443d7ece29
Codefix 75387b9e2b
: Prefer using EnumBitSet.base() instead of shifting StationFacility. ( #13575 )
2025-02-16 11:52:40 +00:00
Peter Nelson
04708736d9
Codechange: Use EnumBitSet for CommandFlags. ( #13560 )
2025-02-15 09:36:20 +00:00
Peter Nelson
6cf7a899e9
Codechange: Use EnumBitSet for PauseMode. ( #13553 )
2025-02-14 08:30:04 +00:00
Rubidium
c3d5e6d2a0
Codechange: Use EnumBitSet for DoCommandFlags
2025-02-14 00:28:57 +01:00
Peter Nelson
f309b90a1d
Codechange: Use EnumBitSet for Airport blocks.
2025-02-13 22:02:02 +00:00
Peter Nelson
75387b9e2b
Codechange: Use EnumBitSet for StationFacility.
2025-02-13 18:03:13 +00:00
Peter Nelson
7975145080
Codechange: Use EnumBitSet for TownActions. ( #13542 )
2025-02-13 18:02:39 +00:00
Jonathan G Rennison
d06b371254
Cleanup: Fix various spelling errors
2025-02-12 22:44:51 +01:00
Loïc Guilloux
7fbfaa1b54
Fix #13520 : [Script] doxygen ignored 'constexpr' constants ( #13523 )
2025-02-10 23:05:31 +01:00
Peter Nelson
687829fa14
Codechange: Use std::unique_ptr for ScriptList::sorter. ( #13517 )
...
Avoids manual pointer management.
2025-02-10 19:20:52 +00:00
Rubidium
ec492cb267
Codechange: make CompanyMask a BaseBitSet implementation
2025-02-09 19:24:51 +01:00
Rubidium
b9777269ce
Codechange: strongly type SignID
2025-02-09 18:05:01 +01:00
Rubidium
cd4482b5df
Codechange: make TownID an enum
2025-02-09 18:05:01 +01:00
Rubidium
cda9c2759e
Codechange: make SignID an enum
2025-02-09 18:05:01 +01:00
Rubidium
1e24b41f22
Codechange: strongly type GroupID
2025-02-09 16:52:21 +01:00
Rubidium
155d7de132
Codechange: change Source into a class with conversion helpers
...
A Source is either a CompanyID (Headquarters), IndustryID or TownID.
When making those types stronger a lot of casts would be needed, but
with these simple helpers the intent is shown more clearly.
2025-02-09 15:28:35 +01:00
Rubidium
3aa60fd479
Codechange: strongly type StoryPageID and StoryPageElementID
2025-02-09 15:07:29 +01:00
Rubidium
6c8915fdbc
Codechange: strongly type LeagueTableID and LeagueTableElementID
2025-02-09 15:07:29 +01:00
Rubidium
6aada55e96
Codechange: strongly type GoalID
2025-02-09 15:07:29 +01:00
Rubidium
07dd5bf01d
Codechange: support strongly typed pool element IDs in squirrel/saveload
2025-02-09 15:07:29 +01:00
Peter Nelson
dccc6185b9
Codechange: Change internal format of encoded strings to improve robustness and allow expansion. ( #13499 )
2025-02-09 12:45:50 +00:00
Rubidium
1193852007
Codechange: do not use ScriptCompany::CompanyID outside of the script API
2025-02-09 12:04:42 +01:00
Rubidium
4cda9f900d
Codechange: [Script] Use helper function over direct casting CompanyID
...
In the script's API `COMPANY_INVALID` has a value of -1, whereas the internal
game's `INVALID_COMPANY` has a value of 255. Since the script's API also has
a `COMPANY_SPECTATOR` with a value of 255, these enumerations cannot be easily
reconciled by casting. As such, replace all casts in the script API with
either ScriptCompany::FromScriptCompanyID or ScriptCompany::ToScriptCompanyID.
Also make clear whether CompanyID is ::CompanyID or ScriptCompany::CompanyID
by using either one of those over CompanyID in the script's API.
2025-02-08 23:42:19 +01:00
Loïc Guilloux
8ab3e9f0a3
Fix 3effb89
: [Script] Don't set CommandCallback for asynchronous commands ( #13501 )
2025-02-08 22:14:37 +00:00
Peter Nelson
d61b376998
Codechange: Use EnumBitSet for CargoClasses. ( #13491 )
2025-02-08 08:46:38 +00:00
Rubidium
5f41bc0279
Codechange: put SourceType and SourceID into Source struct
2025-02-08 06:37:23 +01:00
Peter Nelson
50b384032d
Codechange: Use EnumBitSet for IndustryControlFlags.
2025-02-07 22:01:59 +00:00
Peter Nelson
9a6fc4eb76
Codechange: Use enum class for NewsReferenceType.
2025-02-07 19:36:52 +00:00
Peter Nelson
ca75a8ce19
Codechange: Use enum class for NewsType.
2025-02-07 19:36:52 +00:00
Peter Nelson
2bb3f368e3
Codechange: Use EnumBitSet for IndustryBehaviours.
2025-02-07 12:30:06 +00:00
Rubidium
e937c4dcfd
Codechange: change DestinationID into class with conversion helpers
...
A DestinationID is either a DepotID or StationID, where the aircraft hangar
being conceptually a depot is actually a StationID. When making those types
stronger, a lot of casts would need to be added, but this shows the intent
much better.
2025-02-06 21:03:24 +01:00
SamuXarick
f5d43ffdf8
Change: [Script] GetWaypointID to return the StationID of any waypoint
...
Modified ScriptWaypoint::GetWaypointID to also return the StationID of any waypoint (including road waypoint).
2025-02-03 08:41:59 +01:00
Rubidium
5ffaf6cdb9
Fix: [Script] Wrong return value for failed preconditions Vehicle::CloneVehicle
2025-02-02 18:01:08 +01:00
Peter Nelson
6f52a977a8
Codechange: Use EnumBitSet for GRFConfigFlags.
...
This is renamed from `GCF_Flag` didn't match convention.
2025-02-02 10:49:45 +00:00
Peter Nelson
59354576d4
Codechange: Use EnumBitSet for LandscapeTypes and remove LandscapeID. ( #13436 )
2025-02-01 23:09:18 +00:00
Peter Nelson
c4c5028862
Codechange: Use EnumBitSet for SettingFlags. ( #13429 )
2025-02-01 15:46:51 +00:00
Rubidium
b6bdb97bed
Codechange: [Script] replace some enums with constexpr values of the internal type
2025-02-01 02:38:37 +01:00
Peter Nelson
5664b1e2f6
Codechange: Use std::vector for GRFConfig lists. ( #10835 )
...
This replaces the C-style custom managed linked-list and allows use of iterators etc.
2025-01-31 17:09:09 +00:00