1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-28 17:24:47 +01:00

Merge pull request #24034 from Gymnasiast/refactor/gamestate-t-lower-camel-case

Change GameState_t members to lowerCamelCase
This commit is contained in:
Matt
2025-03-21 23:32:02 +02:00
committed by GitHub
179 changed files with 2619 additions and 2619 deletions

View File

@@ -46,7 +46,7 @@ TEST(MultiLaunchTest, all)
// Check ride count to check load was successful
ASSERT_EQ(RideGetCount(), 134);
auto& date = GetGameState().Date;
auto& date = getGameState().date;
// NOTE: This value is saved in the SV6 file, after the import this will be the current state.
// In case the save file gets replaced this needs to be adjusted.
ASSERT_EQ(date.GetMonthTicks(), 0x1e98);

View File

@@ -52,7 +52,7 @@ static std::unique_ptr<IContext> localStartGame(const std::string& parkPath)
context->GetObjectManager().LoadObjects(loadResult.RequiredObjects);
// TODO: Have a separate GameState and exchange once loaded.
auto& gameState = GetGameState();
auto& gameState = getGameState();
importer->Import(gameState);
ResetEntitySpatialIndices();
@@ -98,12 +98,12 @@ TEST_F(PlayTests, SecondGuestInQueueShouldNotRideIfNoFunds)
auto context = localStartGame(initStateFile);
ASSERT_NE(context.get(), nullptr);
auto& gameState = GetGameState();
auto& gameState = getGameState();
// Open park for free but charging for rides
execute<ParkSetParameterAction>(ParkParameter::Open);
execute<ParkSetEntranceFeeAction>(0);
gameState.Park.Flags |= PARK_FLAGS_UNLOCK_ALL_PRICES;
gameState.park.Flags |= PARK_FLAGS_UNLOCK_ALL_PRICES;
// Find ferris wheel
auto rideManager = GetRideManager();
@@ -117,7 +117,7 @@ TEST_F(PlayTests, SecondGuestInQueueShouldNotRideIfNoFunds)
execute<RideSetPriceAction>(ferrisWheel.id, 0, true);
// Ignore intensity to stimulate peeps to queue into ferris wheel
gameState.Cheats.ignoreRideIntensity = true;
gameState.cheats.ignoreRideIntensity = true;
// Insert a rich guest
auto richGuest = Park::GenerateGuest();
@@ -158,12 +158,12 @@ TEST_F(PlayTests, CarRideWithOneCarOnlyAcceptsTwoGuests)
auto context = localStartGame(initStateFile);
ASSERT_NE(context.get(), nullptr);
auto& gameState = GetGameState();
auto& gameState = getGameState();
// Open park for free but charging for rides
execute<ParkSetParameterAction>(ParkParameter::Open);
execute<ParkSetEntranceFeeAction>(0);
gameState.Park.Flags |= PARK_FLAGS_UNLOCK_ALL_PRICES;
gameState.park.Flags |= PARK_FLAGS_UNLOCK_ALL_PRICES;
// Find car ride
auto rideManager = GetRideManager();
@@ -176,7 +176,7 @@ TEST_F(PlayTests, CarRideWithOneCarOnlyAcceptsTwoGuests)
execute<RideSetPriceAction>(carRide.id, 0, true);
// Ignore intensity to stimulate peeps to queue into the ride
gameState.Cheats.ignoreRideIntensity = true;
gameState.cheats.ignoreRideIntensity = true;
// Create some guests
std::vector<Peep*> guests;

View File

@@ -84,7 +84,7 @@ static bool ImportS6(MemoryStream& stream, std::unique_ptr<IContext>& context, b
objManager.LoadObjects(loadResult.RequiredObjects);
// TODO: Have a separate GameState and exchange once loaded.
auto& gameState = GetGameState();
auto& gameState = getGameState();
importer->Import(gameState);
GameInit(retainSpatialIndices);
@@ -103,7 +103,7 @@ static bool ImportPark(MemoryStream& stream, std::unique_ptr<IContext>& context,
objManager.LoadObjects(loadResult.RequiredObjects);
// TODO: Have a separate GameState and exchange once loaded.
auto& gameState = GetGameState();
auto& gameState = getGameState();
importer->Import(gameState);
GameInit(retainSpatialIndices);
@@ -118,7 +118,7 @@ static bool ExportSave(MemoryStream& stream, std::unique_ptr<IContext>& context)
auto exporter = std::make_unique<ParkFileExporter>();
exporter->ExportObjectsList = objManager.GetPackableObjects();
auto& gameState = GetGameState();
auto& gameState = getGameState();
exporter->Export(gameState, stream);
return true;
@@ -130,7 +130,7 @@ static void RecordGameStateSnapshot(std::unique_ptr<IContext>& context, MemorySt
auto& snapshot = snapshots->CreateSnapshot();
snapshots->Capture(snapshot);
snapshots->LinkSnapshot(snapshot, GetGameState().CurrentTicks, ScenarioRandState().s0);
snapshots->LinkSnapshot(snapshot, getGameState().currentTicks, ScenarioRandState().s0);
DataSerialiser snapShotDs(true, snapshotStream);
snapshots->SerialiseSnapshot(snapshot, snapShotDs);
}