From 0fb70602d3404c43c19a02400ac220045a460d8f Mon Sep 17 00:00:00 2001 From: Harry Hopkinson <63599884+Harry-Hopkinson@users.noreply.github.com> Date: Sat, 29 Aug 2026 23:24:54 +0100 Subject: [PATCH] Convert contents of EntityRegistry.h to camelCase (#27019) --- src/openrct2-ui/ride/VehicleSounds.cpp | 4 +- src/openrct2-ui/title/TitleSequencePlayer.cpp | 2 +- .../windows/EditorStepController.cpp | 2 +- src/openrct2-ui/windows/GameBottomToolbar.cpp | 2 +- src/openrct2-ui/windows/Guest.cpp | 2 +- src/openrct2-ui/windows/GuestList.cpp | 12 +- src/openrct2-ui/windows/Map.cpp | 4 +- src/openrct2-ui/windows/News.cpp | 2 +- src/openrct2-ui/windows/PatrolArea.cpp | 4 +- src/openrct2-ui/windows/Ride.cpp | 20 +-- src/openrct2-ui/windows/Staff.cpp | 2 +- src/openrct2-ui/windows/StaffFirePrompt.cpp | 2 +- src/openrct2-ui/windows/StaffList.cpp | 16 +-- src/openrct2/Game.cpp | 8 +- src/openrct2/GameState.cpp | 10 +- src/openrct2/GameStateSnapshots.cpp | 2 +- src/openrct2/ReplayManager.cpp | 12 +- .../actions/cheats/CheatSetAction.cpp | 8 +- .../actions/general/BalloonPressAction.cpp | 4 +- .../actions/peep/GuestSetFlagsAction.cpp | 4 +- .../actions/peep/GuestSetNameAction.cpp | 4 +- .../actions/peep/PeepPickupAction.cpp | 4 +- src/openrct2/actions/peep/StaffFireAction.cpp | 4 +- .../actions/peep/StaffHireNewAction.cpp | 6 +- .../actions/peep/StaffSetCostumeAction.cpp | 4 +- .../actions/peep/StaffSetNameAction.cpp | 4 +- .../actions/peep/StaffSetOrdersAction.cpp | 4 +- .../actions/peep/StaffSetPatrolAreaAction.cpp | 2 +- .../command_line/SimulateCommands.cpp | 2 +- src/openrct2/drawing/LightFX.cpp | 2 +- src/openrct2/entity/Balloon.cpp | 4 +- src/openrct2/entity/Duck.cpp | 4 +- src/openrct2/entity/EntityList.h | 8 +- src/openrct2/entity/EntityRegistry.cpp | 134 +++++++++--------- src/openrct2/entity/EntityRegistry.h | 94 ++++++------ src/openrct2/entity/Guest.cpp | 48 +++---- src/openrct2/entity/JumpingFountain.cpp | 4 +- src/openrct2/entity/Litter.cpp | 8 +- src/openrct2/entity/MoneyEffect.cpp | 4 +- src/openrct2/entity/Particle.cpp | 22 +-- src/openrct2/entity/Peep.cpp | 8 +- src/openrct2/entity/Staff.cpp | 2 +- src/openrct2/interface/InteractiveConsole.cpp | 12 +- src/openrct2/interface/Viewport.cpp | 8 +- src/openrct2/management/Award.cpp | 4 +- src/openrct2/management/NewsItem.cpp | 10 +- src/openrct2/network/NetworkBase.cpp | 8 +- .../paint/tile_element/Paint.Surface.cpp | 2 +- src/openrct2/paint/track/gentle/Circus.cpp | 2 +- .../paint/track/gentle/CrookedHouse.cpp | 2 +- .../paint/track/gentle/FerrisWheel.cpp | 4 +- .../paint/track/gentle/HauntedHouse.cpp | 2 +- .../paint/track/gentle/MerryGoRound.cpp | 2 +- .../paint/track/gentle/SpaceRings.cpp | 4 +- src/openrct2/paint/track/thrill/3dCinema.cpp | 2 +- .../paint/track/thrill/Enterprise.cpp | 2 +- .../paint/track/thrill/MagicCarpet.cpp | 2 +- .../paint/track/thrill/MotionSimulator.cpp | 2 +- .../track/thrill/SwingingInverterShip.cpp | 2 +- .../paint/track/thrill/SwingingShip.cpp | 2 +- src/openrct2/paint/track/thrill/TopSpin.cpp | 2 +- src/openrct2/paint/track/thrill/Twist.cpp | 2 +- .../paint/vehicle/Vehicle.MiniGolf.cpp | 2 +- .../vehicle/Vehicle.ReverserRollerCoaster.cpp | 4 +- .../paint/vehicle/Vehicle.SplashBoats.cpp | 4 +- src/openrct2/paint/vehicle/VehiclePaint.cpp | 4 +- src/openrct2/park/ParkFile.cpp | 4 +- src/openrct2/rct1/S4Importer.cpp | 26 ++-- src/openrct2/rct2/S6Importer.cpp | 26 ++-- src/openrct2/ride/CableLift.cpp | 18 +-- src/openrct2/ride/Ride.cpp | 54 +++---- src/openrct2/ride/RideConstruction.cpp | 10 +- src/openrct2/ride/Station.cpp | 14 +- src/openrct2/ride/TrainManager.cpp | 4 +- src/openrct2/ride/Vehicle.Collision.cpp | 6 +- src/openrct2/ride/Vehicle.Crash.cpp | 24 ++-- src/openrct2/ride/Vehicle.Dodgems.cpp | 2 +- src/openrct2/ride/Vehicle.MiniGolf.cpp | 18 +-- src/openrct2/ride/Vehicle.Sound.cpp | 8 +- src/openrct2/ride/Vehicle.Station.cpp | 32 ++--- src/openrct2/ride/Vehicle.TrackMotion.cpp | 12 +- src/openrct2/ride/Vehicle.cpp | 36 ++--- src/openrct2/ride/VehicleRiderControl.cpp | 2 +- src/openrct2/scenes/editor/EditorScene.cpp | 2 +- .../scripting/bindings/entity/ScBalloon.cpp | 2 +- .../scripting/bindings/entity/ScEntity.cpp | 4 +- .../scripting/bindings/entity/ScGuest.cpp | 2 +- .../scripting/bindings/entity/ScLitter.cpp | 2 +- .../bindings/entity/ScMoneyEffect.cpp | 2 +- .../scripting/bindings/entity/ScParticle.cpp | 2 +- .../scripting/bindings/entity/ScPeep.hpp | 2 +- .../scripting/bindings/entity/ScStaff.cpp | 4 +- .../scripting/bindings/entity/ScVehicle.cpp | 2 +- .../scripting/bindings/world/ScMap.cpp | 14 +- src/openrct2/world/Footpath.cpp | 2 +- src/openrct2/world/Map.cpp | 4 +- test/tests/EntityImportTests.cpp | 6 +- test/tests/PlayTests.cpp | 2 +- test/tests/S6ImportExportTests.cpp | 2 +- 99 files changed, 469 insertions(+), 469 deletions(-) diff --git a/src/openrct2-ui/ride/VehicleSounds.cpp b/src/openrct2-ui/ride/VehicleSounds.cpp index 9118e778e9..8a0fdf02bf 100644 --- a/src/openrct2-ui/ride/VehicleSounds.cpp +++ b/src/openrct2-ui/ride/VehicleSounds.cpp @@ -71,7 +71,7 @@ namespace OpenRCT2::Audio } iterator& operator++() { - Current = getGameState().entities.GetEntity(NextVehicleId); + Current = getGameState().entities.getEntity(NextVehicleId); if (Current != nullptr) { NextVehicleId = Current->next_vehicle_on_train; @@ -602,7 +602,7 @@ namespace OpenRCT2::Audio vehicleSound->volume = tempvolume; panVol = std::max(0, panVol - tempvolume); - Vehicle* vehicle = getGameState().entities.GetEntity(EntityId::FromUnderlying(vehicleSoundParams.id)); + Vehicle* vehicle = getGameState().entities.getEntity(EntityId::FromUnderlying(vehicleSoundParams.id)); if (vehicle != nullptr) { UpdateSound( diff --git a/src/openrct2-ui/title/TitleSequencePlayer.cpp b/src/openrct2-ui/title/TitleSequencePlayer.cpp index db80b685b4..91b944a216 100644 --- a/src/openrct2-ui/title/TitleSequencePlayer.cpp +++ b/src/openrct2-ui/title/TitleSequencePlayer.cpp @@ -431,7 +431,7 @@ namespace OpenRCT2::Title auto windowManager = Ui::GetWindowManager(); auto& gameState = getGameState(); windowManager->SetMainView(gameState.savedView, gameState.savedViewZoom, gameState.savedViewRotation); - gameState.entities.ResetEntitySpatialIndices(); + gameState.entities.resetEntitySpatialIndices(); ResetAllSpriteQuadrantPlacements(); // Invalidate scrolling text cache to prevent stale text from previous park diff --git a/src/openrct2-ui/windows/EditorStepController.cpp b/src/openrct2-ui/windows/EditorStepController.cpp index f694aab12b..e3257ec9be 100644 --- a/src/openrct2-ui/windows/EditorStepController.cpp +++ b/src/openrct2-ui/windows/EditorStepController.cpp @@ -73,7 +73,7 @@ namespace OpenRCT2::Ui::Windows bool GameHasEntities() const { auto& gameState = getGameState(); - return gameState.entities.GetNumFreeEntities() != kMaxEntities + return gameState.entities.getNumFreeEntities() != kMaxEntities || gameState.park.flags.has(ParkFlag::spritesInitialised); } diff --git a/src/openrct2-ui/windows/GameBottomToolbar.cpp b/src/openrct2-ui/windows/GameBottomToolbar.cpp index e6a751a449..fc97ad953d 100644 --- a/src/openrct2-ui/windows/GameBottomToolbar.cpp +++ b/src/openrct2-ui/windows/GameBottomToolbar.cpp @@ -93,7 +93,7 @@ namespace OpenRCT2::Ui::Windows break; } - auto peep = getGameState().entities.TryGetEntity(EntityId::FromUnderlying(newsItem->assoc)); + auto peep = getGameState().entities.tryGetEntity(EntityId::FromUnderlying(newsItem->assoc)); if (peep == nullptr) return; diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index 54ede4d7d8..c3db4792c3 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -433,7 +433,7 @@ namespace OpenRCT2::Ui::Windows private: Guest* GetGuest() { - auto guest = getGameState().entities.GetEntity(EntityId::FromUnderlying(number)); + auto guest = getGameState().entities.getEntity(EntityId::FromUnderlying(number)); if (guest == nullptr) { close(); diff --git a/src/openrct2-ui/windows/GuestList.cpp b/src/openrct2-ui/windows/GuestList.cpp index 0b796b4ed6..08145b49f1 100644 --- a/src/openrct2-ui/windows/GuestList.cpp +++ b/src/openrct2-ui/windows/GuestList.cpp @@ -535,7 +535,7 @@ namespace OpenRCT2::Ui::Windows { if (i == 0) { - auto guest = getGameState().entities.GetEntity(guestItem.Id); + auto guest = getGameState().entities.getEntity(guestItem.Id); if (guest != nullptr) { GuestOpen(guest); @@ -595,14 +595,14 @@ namespace OpenRCT2::Ui::Windows for (auto peep : EntityList()) { - getGameState().entities.EntitySetFlashing(peep, false); + getGameState().entities.entitySetFlashing(peep, false); if (peep->outsideOfPark) continue; if (_selectedFilter) { if (!IsPeepInFilter(*peep)) continue; - getGameState().entities.EntitySetFlashing(peep, true); + getGameState().entities.entitySetFlashing(peep, true); } if (!GuestShouldBeVisible(*peep)) continue; @@ -656,7 +656,7 @@ namespace OpenRCT2::Ui::Windows } // Guest name - auto peep = getGameState().entities.GetEntity(guestItem.Id); + auto peep = getGameState().entities.getEntity(guestItem.Id); if (peep == nullptr) { continue; @@ -911,8 +911,8 @@ namespace OpenRCT2::Ui::Windows template static bool CompareGuestItem(const GuestItem& a, const GuestItem& b) { - const auto* peepA = getGameState().entities.GetEntity(a.Id); - const auto* peepB = getGameState().entities.GetEntity(b.Id); + const auto* peepA = getGameState().entities.getEntity(a.Id); + const auto* peepB = getGameState().entities.getEntity(b.Id); if (peepA != nullptr && peepB != nullptr) { // Compare types diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index 57c9ed699f..49da26becc 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -977,7 +977,7 @@ namespace OpenRCT2::Ui::Windows auto leftTop = ScreenCoordsXY{ c.x, c.y } + offset; auto rightBottom = leftTop; auto colour = DefaultPeepMapColour; - if (getGameState().entities.EntityGetFlashing(peep)) + if (getGameState().entities.entityGetFlashing(peep)) { colour = flashColour; // If flashing then map peep pixel size is increased (by moving left top downwards) @@ -1019,7 +1019,7 @@ namespace OpenRCT2::Ui::Windows for (auto train : TrainManager::View()) { for (Vehicle* vehicle = train; vehicle != nullptr; - vehicle = getGameState().entities.GetEntity(vehicle->next_vehicle_on_train)) + vehicle = getGameState().entities.getEntity(vehicle->next_vehicle_on_train)) { if (vehicle->x == kLocationNull) continue; diff --git a/src/openrct2-ui/windows/News.cpp b/src/openrct2-ui/windows/News.cpp index 05a6bcb5a6..4ca3691b30 100644 --- a/src/openrct2-ui/windows/News.cpp +++ b/src/openrct2-ui/windows/News.cpp @@ -535,7 +535,7 @@ namespace OpenRCT2::Ui::Windows break; } - auto peep = getGameState().entities.TryGetEntity(EntityId::FromUnderlying(newsItem.assoc)); + auto peep = getGameState().entities.tryGetEntity(EntityId::FromUnderlying(newsItem.assoc)); if (peep == nullptr) { break; diff --git a/src/openrct2-ui/windows/PatrolArea.cpp b/src/openrct2-ui/windows/PatrolArea.cpp index b6e7b5e3c2..8e8c927871 100644 --- a/src/openrct2-ui/windows/PatrolArea.cpp +++ b/src/openrct2-ui/windows/PatrolArea.cpp @@ -199,7 +199,7 @@ namespace OpenRCT2::Ui::Windows auto mapTile = GetBestCoordsFromPos(screenCoords); if (mapTile) { - auto staff = getGameState().entities.GetEntity(_staffId); + auto staff = getGameState().entities.getEntity(_staffId); if (staff != nullptr) { _mode = staff->isPatrolAreaSet(*mapTile) ? GameActions::StaffSetPatrolAreaMode::unset @@ -212,7 +212,7 @@ namespace OpenRCT2::Ui::Windows void onToolDrag(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override { - auto staff = getGameState().entities.GetEntity(_staffId); + auto staff = getGameState().entities.getEntity(_staffId); if (staff != nullptr) { MapRange range(gMapSelectPositionA, gMapSelectPositionB); diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 411311b19c..a4799381c8 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -1539,7 +1539,7 @@ namespace OpenRCT2::Ui::Windows const auto* rideEntry = ride->getRideEntry(); if (rideEntry != nullptr && rideEntry->TabCar != 0) { - Vehicle* vehicle = getGameState().entities.GetEntity(vehId); + Vehicle* vehicle = getGameState().entities.getEntity(vehId); if (vehicle == nullptr) { vehId = EntityId::GetNull(); @@ -2000,7 +2000,7 @@ namespace OpenRCT2::Ui::Windows { if (_viewIndex <= ride->numTrains) { - Vehicle* vehicle = getGameState().entities.GetEntity(ride->vehicles[_viewIndex - 1]); + Vehicle* vehicle = getGameState().entities.getEntity(ride->vehicles[_viewIndex - 1]); if (vehicle != nullptr) { auto headVehicleSpriteIndex = vehicle->id; @@ -2316,7 +2316,7 @@ namespace OpenRCT2::Ui::Windows if (_viewIndex <= ride->numTrains) { - Vehicle* vehicle = gameState.entities.GetEntity(ride->vehicles[_viewIndex - 1]); + Vehicle* vehicle = gameState.entities.getEntity(ride->vehicles[_viewIndex - 1]); if (vehicle == nullptr || (vehicle->status != Vehicle::Status::travelling && vehicle->status != Vehicle::Status::travellingCableLift @@ -2485,7 +2485,7 @@ namespace OpenRCT2::Ui::Windows if (ride == nullptr) return kStringIdEmpty; - auto vehicle = getGameState().entities.GetEntity(ride->vehicles[_viewIndex - 1]); + auto vehicle = getGameState().entities.getEntity(ride->vehicles[_viewIndex - 1]); if (vehicle == nullptr) return kStringIdEmpty; @@ -3997,9 +3997,9 @@ namespace OpenRCT2::Ui::Windows break; for (int32_t i = 0; i < ride->numTrains; ++i) { - for (vehicle = getGameState().entities.GetEntity(ride->vehicles[i]); + for (vehicle = getGameState().entities.getEntity(ride->vehicles[i]); vehicle != nullptr; - vehicle = getGameState().entities.GetEntity(vehicle->next_vehicle_on_train)) + vehicle = getGameState().entities.getEntity(vehicle->next_vehicle_on_train)) { vehicle->flags.unset( VehicleFlag::carIsBroken, VehicleFlag::stoppedBySafetyCutout, @@ -4011,14 +4011,14 @@ namespace OpenRCT2::Ui::Windows case Breakdown::restraintsStuckOpen: case Breakdown::doorsStuckClosed: case Breakdown::doorsStuckOpen: - vehicle = getGameState().entities.GetEntity(ride->vehicles[ride->brokenTrain]); + vehicle = getGameState().entities.getEntity(ride->vehicles[ride->brokenTrain]); if (vehicle != nullptr) { vehicle->flags.unset(VehicleFlag::carIsBroken); } break; case Breakdown::vehicleMalfunction: - vehicle = getGameState().entities.GetEntity(ride->vehicles[ride->brokenTrain]); + vehicle = getGameState().entities.getEntity(ride->vehicles[ride->brokenTrain]); if (vehicle != nullptr) { vehicle->flags.unset(VehicleFlag::trainIsBroken); @@ -4222,7 +4222,7 @@ namespace OpenRCT2::Ui::Windows } else { - auto staff = getGameState().entities.GetEntity(ride->mechanic); + auto staff = getGameState().entities.getEntity(ride->mechanic); if (staff != nullptr && staff->isMechanic()) { ft = Formatter(); @@ -7371,7 +7371,7 @@ namespace OpenRCT2::Ui::Windows int32_t numPeepsLeft = vehicle->num_peeps; for (int32_t i = 0; i < 32 && numPeepsLeft > 0; i++) { - Peep* peep = getGameState().entities.GetEntity(vehicle->peep[i]); + Peep* peep = getGameState().entities.getEntity(vehicle->peep[i]); if (peep == nullptr) continue; diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index f18dd09d1c..59994ab10b 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -1214,7 +1214,7 @@ namespace OpenRCT2::Ui::Windows Staff* GetStaff() { - return getGameState().entities.GetEntity(EntityId::FromUnderlying(number)); + return getGameState().entities.getEntity(EntityId::FromUnderlying(number)); } static constexpr int32_t TabAnimationDivisor[] = { diff --git a/src/openrct2-ui/windows/StaffFirePrompt.cpp b/src/openrct2-ui/windows/StaffFirePrompt.cpp index e9fa488176..bec0b69ea1 100644 --- a/src/openrct2-ui/windows/StaffFirePrompt.cpp +++ b/src/openrct2-ui/windows/StaffFirePrompt.cpp @@ -77,7 +77,7 @@ namespace OpenRCT2::Ui::Windows { drawWidgets(rt); - Peep* peep = getGameState().entities.GetEntity(EntityId::FromUnderlying(number)); + Peep* peep = getGameState().entities.getEntity(EntityId::FromUnderlying(number)); // The staff member may have been fired in the meantime. if (peep == nullptr) { diff --git a/src/openrct2-ui/windows/StaffList.cpp b/src/openrct2-ui/windows/StaffList.cpp index 9cee4ad6bf..0813a5fcf9 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -186,10 +186,10 @@ namespace OpenRCT2::Ui::Windows { for (auto peep : EntityList()) { - getGameState().entities.EntitySetFlashing(peep, false); + getGameState().entities.entitySetFlashing(peep, false); if (peep->assignedStaffType == GetSelectedStaffType()) { - getGameState().entities.EntitySetFlashing(peep, true); + getGameState().entities.entitySetFlashing(peep, true); } } } @@ -349,7 +349,7 @@ namespace OpenRCT2::Ui::Windows } else { - auto peep = gameState.entities.GetEntity(entry.Id); + auto peep = gameState.entities.getEntity(entry.Id); if (peep != nullptr) { auto intent = Intent(WindowClass::peep); @@ -388,7 +388,7 @@ namespace OpenRCT2::Ui::Windows if (y + 11 >= rt.y) { - const auto* peep = getGameState().entities.GetEntity(entry.Id); + const auto* peep = getGameState().entities.getEntity(entry.Id); if (peep == nullptr) { continue; @@ -487,10 +487,10 @@ namespace OpenRCT2::Ui::Windows for (auto* peep : EntityList()) { - getGameState().entities.EntitySetFlashing(peep, false); + getGameState().entities.entitySetFlashing(peep, false); if (peep->assignedStaffType == GetSelectedStaffType()) { - getGameState().entities.EntitySetFlashing(peep, true); + getGameState().entities.entitySetFlashing(peep, true); StaffEntry entry; entry.Id = peep->id; @@ -547,7 +547,7 @@ namespace OpenRCT2::Ui::Windows return; auto actionResult = res->getData(); - auto* staff = getGameState().entities.GetEntity(actionResult.StaffEntityId); + auto* staff = getGameState().entities.getEntity(actionResult.StaffEntityId); if (staff == nullptr) return; @@ -564,7 +564,7 @@ namespace OpenRCT2::Ui::Windows if (result->error != GameActions::Status::ok) return; - auto* staff2 = getGameState().entities.GetEntity(staffId); + auto* staff2 = getGameState().entities.getEntity(staffId); auto intent = Intent(WindowClass::peep); intent.PutExtra(INTENT_EXTRA_PEEP, staff2); auto* wind = ContextOpenIntent(&intent); diff --git a/src/openrct2/Game.cpp b/src/openrct2/Game.cpp index 0e0daa19a7..d224b5e07b 100644 --- a/src/openrct2/Game.cpp +++ b/src/openrct2/Game.cpp @@ -257,7 +257,7 @@ static void FixPeepsWithInvalidRideReference() if (!peepsToRemove.empty()) { // Some broken saves have broken spatial indexes - getGameState().entities.ResetEntitySpatialIndices(); + getGameState().entities.resetEntitySpatialIndices(); } for (auto ptr : peepsToRemove) @@ -368,7 +368,7 @@ void GameLoadInit() { GameActions::ClearQueue(); } - getGameState().entities.ResetEntitySpatialIndices(); + getGameState().entities.resetEntitySpatialIndices(); ResetAllSpriteQuadrantPlacements(); gWindowUpdateTicks = 0; @@ -437,7 +437,7 @@ void ResetAllSpriteQuadrantPlacements() { for (EntityId::UnderlyingType i = 0; i < kMaxEntities; i++) { - auto* spr = getGameState().entities.GetEntity(EntityId::FromUnderlying(i)); + auto* spr = getGameState().entities.getEntity(EntityId::FromUnderlying(i)); if (spr != nullptr && spr->type != EntityType::null) { spr->moveTo(spr->getLocation()); @@ -736,7 +736,7 @@ void GameLoadOrQuitNoSavePrompt() } default: GameUnloadScripts(); - getGameState().entities.ResetAllEntities(); + getGameState().entities.resetAllEntities(); GetContext()->Finish(); break; } diff --git a/src/openrct2/GameState.cpp b/src/openrct2/GameState.cpp index 54b6eb487a..3480f894b4 100644 --- a/src/openrct2/GameState.cpp +++ b/src/openrct2/GameState.cpp @@ -66,7 +66,7 @@ namespace OpenRCT2 FinanceInit(); BannerInit(gameState); RideInitAll(); - gameState.entities.ResetAllEntities(); + gameState.entities.resetAllEntities(); UpdateConsolidatedPatrolAreas(); ResetDate(); Weather::reset(); @@ -173,14 +173,14 @@ namespace OpenRCT2 // Keep updating the money effect even when paused. auto& gameState = getGameState(); - gameState.entities.UpdateMoneyEffect(); + gameState.entities.updateMoneyEffect(); // Post-tick network update Network::PostTick(); // Post-tick game actions. GameActions::ProcessQueue(gameState); - gameState.entities.UpdateEntitiesSpatialIndex(); + gameState.entities.updateEntitiesSpatialIndex(); } } @@ -320,7 +320,7 @@ namespace OpenRCT2 auto restoreProvisionalIntent = Intent(INTENT_ACTION_RESTORE_PROVISIONAL_ELEMENTS); ContextBroadcastIntent(&restoreProvisionalIntent); VehicleUpdateAll(); - gameState.entities.UpdateAllMiscEntities(); + gameState.entities.updateAllMiscEntities(); Ride::updateAll(); if (!isInEditorMode()) @@ -344,7 +344,7 @@ namespace OpenRCT2 // Update windows // WindowDispatchUpdateAll(); - gameState.entities.UpdateEntitiesSpatialIndex(); + gameState.entities.updateEntitiesSpatialIndex(); // Start autosave timer after update if (gLastAutoSaveUpdate == kAutosavePause) diff --git a/src/openrct2/GameStateSnapshots.cpp b/src/openrct2/GameStateSnapshots.cpp index 90e3c74d43..0f09c3bd35 100644 --- a/src/openrct2/GameStateSnapshots.cpp +++ b/src/openrct2/GameStateSnapshots.cpp @@ -189,7 +189,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots virtual void Capture(GameStateSnapshot_t& snapshot) override final { snapshot.SerialiseSprites( - [](const EntityId index) { return reinterpret_cast(getGameState().entities.GetEntity(index)); }, + [](const EntityId index) { return reinterpret_cast(getGameState().entities.getEntity(index)); }, kMaxEntities, true); // LOG_INFO("Snapshot size: %u bytes", static_cast(snapshot.storedSprites.GetLength())); diff --git a/src/openrct2/ReplayManager.cpp b/src/openrct2/ReplayManager.cpp index c53dc58d9e..2c2e15df38 100644 --- a/src/openrct2/ReplayManager.cpp +++ b/src/openrct2/ReplayManager.cpp @@ -178,7 +178,7 @@ namespace OpenRCT2 if ((_mode == ReplayMode::recording || _mode == ReplayMode::normalisation) && currentTicks == _nextChecksumTick) { - EntitiesChecksum checksum = getGameState().entities.GetAllEntitiesChecksum(); + EntitiesChecksum checksum = getGameState().entities.getAllEntitiesChecksum(); AddChecksum(currentTicks, std::move(checksum)); _nextChecksumTick = currentTicks + ChecksumTicksDelta(); @@ -308,7 +308,7 @@ namespace OpenRCT2 _currentRecording->tickEnd = currentTicks; { - EntitiesChecksum checksum = getGameState().entities.GetAllEntitiesChecksum(); + EntitiesChecksum checksum = getGameState().entities.getAllEntitiesChecksum(); AddChecksum(currentTicks, std::move(checksum)); } @@ -799,7 +799,7 @@ namespace OpenRCT2 { _currentReplay->checksumIndex++; - EntitiesChecksum checksum = getGameState().entities.GetAllEntitiesChecksum(); + EntitiesChecksum checksum = getGameState().entities.getAllEntitiesChecksum(); if (savedChecksum.second.raw != checksum.raw) { uint32_t replayTick = currentTicks - _currentReplay->tickStart; @@ -807,7 +807,7 @@ namespace OpenRCT2 // Detected different game state. LOG_WARNING( "Different sprite checksum at tick %u (Replay Tick: %u) ; Saved: %s, Current: %s", currentTicks, - replayTick, savedChecksum.second.ToString().c_str(), checksum.ToString().c_str()); + replayTick, savedChecksum.second.toString().c_str(), checksum.toString().c_str()); _faultyChecksumIndex = checksumIndex; } @@ -815,8 +815,8 @@ namespace OpenRCT2 { // Good state. LOG_VERBOSE( - "Good state at tick %u ; Saved: %s, Current: %s", currentTicks, savedChecksum.second.ToString().c_str(), - checksum.ToString().c_str()); + "Good state at tick %u ; Saved: %s, Current: %s", currentTicks, savedChecksum.second.toString().c_str(), + checksum.toString().c_str()); } } } diff --git a/src/openrct2/actions/cheats/CheatSetAction.cpp b/src/openrct2/actions/cheats/CheatSetAction.cpp index 5b6c038a07..471939086e 100644 --- a/src/openrct2/actions/cheats/CheatSetAction.cpp +++ b/src/openrct2/actions/cheats/CheatSetAction.cpp @@ -499,7 +499,7 @@ namespace OpenRCT2::GameActions { for (auto litter : EntityList()) { - gameState.entities.EntityRemove(litter); + gameState.entities.entityRemove(litter); } TileElementIterator it{}; @@ -723,8 +723,8 @@ namespace OpenRCT2::GameActions for (auto trainIndex : ride.vehicles) { - for (Vehicle* vehicle = gameState.entities.TryGetEntity(trainIndex); vehicle != nullptr; - vehicle = gameState.entities.TryGetEntity(vehicle->next_vehicle_on_train)) + for (Vehicle* vehicle = gameState.entities.tryGetEntity(trainIndex); vehicle != nullptr; + vehicle = gameState.entities.tryGetEntity(vehicle->next_vehicle_on_train)) { auto i = 0; for (auto& peepInTrainIndex : vehicle->peep) @@ -732,7 +732,7 @@ namespace OpenRCT2::GameActions if (i >= vehicle->num_peeps) break; - auto peep = gameState.entities.TryGetEntity(peepInTrainIndex); + auto peep = gameState.entities.tryGetEntity(peepInTrainIndex); if (peep != nullptr && peep->currentRide == ride.id) { if ((peep->state == PeepState::onRide && peep->rideSubState == PeepRideSubState::onRide) diff --git a/src/openrct2/actions/general/BalloonPressAction.cpp b/src/openrct2/actions/general/BalloonPressAction.cpp index 5131417e98..9b46d9b6f7 100644 --- a/src/openrct2/actions/general/BalloonPressAction.cpp +++ b/src/openrct2/actions/general/BalloonPressAction.cpp @@ -40,7 +40,7 @@ namespace OpenRCT2::GameActions Result BalloonPressAction::Query(GameState_t& gameState, Park::ParkData& park) const { - auto balloon = gameState.entities.TryGetEntity(_spriteIndex); + auto balloon = gameState.entities.tryGetEntity(_spriteIndex); if (balloon == nullptr) { LOG_ERROR("Balloon not found for spriteIndex %u", _spriteIndex); @@ -51,7 +51,7 @@ namespace OpenRCT2::GameActions Result BalloonPressAction::Execute(GameState_t& gameState, Park::ParkData& park) const { - auto balloon = gameState.entities.TryGetEntity(_spriteIndex); + auto balloon = gameState.entities.tryGetEntity(_spriteIndex); if (balloon == nullptr) { LOG_ERROR("Balloon not found for spriteIndex %u", _spriteIndex); diff --git a/src/openrct2/actions/peep/GuestSetFlagsAction.cpp b/src/openrct2/actions/peep/GuestSetFlagsAction.cpp index c65e27748f..8ff232830c 100644 --- a/src/openrct2/actions/peep/GuestSetFlagsAction.cpp +++ b/src/openrct2/actions/peep/GuestSetFlagsAction.cpp @@ -41,7 +41,7 @@ namespace OpenRCT2::GameActions Result GuestSetFlagsAction::Query(GameState_t& gameState, Park::ParkData& park) const { - auto* peep = gameState.entities.TryGetEntity(_peepId); + auto* peep = gameState.entities.tryGetEntity(_peepId); if (peep == nullptr) { LOG_ERROR("Guest entity not found for peepID %u", _peepId.ToUnderlying()); @@ -52,7 +52,7 @@ namespace OpenRCT2::GameActions Result GuestSetFlagsAction::Execute(GameState_t& gameState, Park::ParkData& park) const { - auto* peep = gameState.entities.TryGetEntity(_peepId); + auto* peep = gameState.entities.tryGetEntity(_peepId); if (peep == nullptr) { LOG_ERROR("Guest entity not found for peepID %u", _peepId.ToUnderlying()); diff --git a/src/openrct2/actions/peep/GuestSetNameAction.cpp b/src/openrct2/actions/peep/GuestSetNameAction.cpp index 238e99a7d8..15068820f6 100644 --- a/src/openrct2/actions/peep/GuestSetNameAction.cpp +++ b/src/openrct2/actions/peep/GuestSetNameAction.cpp @@ -60,7 +60,7 @@ namespace OpenRCT2::GameActions return Result(Status::invalidParameters, STR_CANT_NAME_GUEST, STR_ERR_VALUE_OUT_OF_RANGE); } - auto guest = gameState.entities.TryGetEntity(_spriteIndex); + auto guest = gameState.entities.tryGetEntity(_spriteIndex); if (guest == nullptr) { LOG_ERROR("Guest entity not found for spriteIndex %u", _spriteIndex); @@ -72,7 +72,7 @@ namespace OpenRCT2::GameActions Result GuestSetNameAction::Execute(GameState_t& gameState, Park::ParkData& park) const { - auto guest = gameState.entities.TryGetEntity(_spriteIndex); + auto guest = gameState.entities.tryGetEntity(_spriteIndex); if (guest == nullptr) { LOG_ERROR("Guest entity not found for spriteIndex %u", _spriteIndex); diff --git a/src/openrct2/actions/peep/PeepPickupAction.cpp b/src/openrct2/actions/peep/PeepPickupAction.cpp index baf52130cf..4caf4972a0 100644 --- a/src/openrct2/actions/peep/PeepPickupAction.cpp +++ b/src/openrct2/actions/peep/PeepPickupAction.cpp @@ -61,7 +61,7 @@ namespace OpenRCT2::GameActions return Result(Status::invalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); } - auto* const peep = gameState.entities.TryGetEntity(_entityId); + auto* const peep = gameState.entities.tryGetEntity(_entityId); if (peep == nullptr) { LOG_ERROR("Failed to pick up peep for sprite %d", _entityId); @@ -119,7 +119,7 @@ namespace OpenRCT2::GameActions Result PeepPickupAction::Execute(GameState_t& gameState, Park::ParkData& park) const { - Peep* const peep = gameState.entities.TryGetEntity(_entityId); + Peep* const peep = gameState.entities.tryGetEntity(_entityId); if (peep == nullptr) { LOG_ERROR("Failed to pick up peep for sprite %d", _entityId); diff --git a/src/openrct2/actions/peep/StaffFireAction.cpp b/src/openrct2/actions/peep/StaffFireAction.cpp index 1678816f44..08c2891c09 100644 --- a/src/openrct2/actions/peep/StaffFireAction.cpp +++ b/src/openrct2/actions/peep/StaffFireAction.cpp @@ -47,7 +47,7 @@ namespace OpenRCT2::GameActions return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } - auto staff = gameState.entities.TryGetEntity(_spriteId); + auto staff = gameState.entities.tryGetEntity(_spriteId); if (staff == nullptr) { LOG_ERROR("Staff entity not found for spriteId %u", _spriteId); @@ -68,7 +68,7 @@ namespace OpenRCT2::GameActions Result StaffFireAction::Execute(GameState_t& gameState, Park::ParkData& park) const { - auto staff = gameState.entities.TryGetEntity(_spriteId); + auto staff = gameState.entities.tryGetEntity(_spriteId); if (staff == nullptr) { LOG_ERROR("Staff entity not found for spriteId %u", _spriteId); diff --git a/src/openrct2/actions/peep/StaffHireNewAction.cpp b/src/openrct2/actions/peep/StaffHireNewAction.cpp index 98e7e9e7db..820f7de0a5 100644 --- a/src/openrct2/actions/peep/StaffHireNewAction.cpp +++ b/src/openrct2/actions/peep/StaffHireNewAction.cpp @@ -77,7 +77,7 @@ namespace OpenRCT2::GameActions return Result(Status::invalidParameters, STR_CANT_HIRE_NEW_STAFF, STR_ERR_VALUE_OUT_OF_RANGE); } - if (gameState.entities.GetNumFreeEntities() < 400) + if (gameState.entities.getNumFreeEntities() < 400) { return Result(Status::noFreeElements, STR_CANT_HIRE_NEW_STAFF, STR_TOO_MANY_PEOPLE_IN_GAME); } @@ -92,7 +92,7 @@ namespace OpenRCT2::GameActions } } - Staff* newPeep = gameState.entities.CreateEntity(); + Staff* newPeep = gameState.entities.createEntity(); if (newPeep == nullptr) { // Too many peeps exist already. @@ -102,7 +102,7 @@ namespace OpenRCT2::GameActions if (execute == false) { // In query we just want to see if we can obtain a sprite slot. - gameState.entities.EntityRemove(newPeep); + gameState.entities.entityRemove(newPeep); res.setData(StaffHireNewActionResult{ EntityId::GetNull() }); } diff --git a/src/openrct2/actions/peep/StaffSetCostumeAction.cpp b/src/openrct2/actions/peep/StaffSetCostumeAction.cpp index 19e77ec812..5066a6f2bb 100644 --- a/src/openrct2/actions/peep/StaffSetCostumeAction.cpp +++ b/src/openrct2/actions/peep/StaffSetCostumeAction.cpp @@ -54,7 +54,7 @@ namespace OpenRCT2::GameActions return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } - auto* staff = gameState.entities.TryGetEntity(_spriteIndex); + auto* staff = gameState.entities.tryGetEntity(_spriteIndex); if (staff == nullptr) { LOG_ERROR("Staff entity not found for spriteIndex %u", _spriteIndex); @@ -75,7 +75,7 @@ namespace OpenRCT2::GameActions Result StaffSetCostumeAction::Execute(GameState_t& gameState, Park::ParkData& park) const { - auto* staff = gameState.entities.TryGetEntity(_spriteIndex); + auto* staff = gameState.entities.tryGetEntity(_spriteIndex); if (staff == nullptr) { LOG_ERROR("Staff entity not found for spriteIndex %u", _spriteIndex); diff --git a/src/openrct2/actions/peep/StaffSetNameAction.cpp b/src/openrct2/actions/peep/StaffSetNameAction.cpp index db92f7610e..48edc5e45c 100644 --- a/src/openrct2/actions/peep/StaffSetNameAction.cpp +++ b/src/openrct2/actions/peep/StaffSetNameAction.cpp @@ -52,7 +52,7 @@ namespace OpenRCT2::GameActions return Result(Status::invalidParameters, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER, STR_ERR_VALUE_OUT_OF_RANGE); } - auto staff = gameState.entities.TryGetEntity(_spriteIndex); + auto staff = gameState.entities.tryGetEntity(_spriteIndex); if (staff == nullptr) { LOG_ERROR("Staff entity not found for spriteIndex %u", _spriteIndex); @@ -64,7 +64,7 @@ namespace OpenRCT2::GameActions Result StaffSetNameAction::Execute(GameState_t& gameState, Park::ParkData& park) const { - auto staff = gameState.entities.TryGetEntity(_spriteIndex); + auto staff = gameState.entities.tryGetEntity(_spriteIndex); if (staff == nullptr) { LOG_ERROR("Staff entity not found for spriteIndex %u", _spriteIndex); diff --git a/src/openrct2/actions/peep/StaffSetOrdersAction.cpp b/src/openrct2/actions/peep/StaffSetOrdersAction.cpp index 6eadad5279..4b6b6b0a0d 100644 --- a/src/openrct2/actions/peep/StaffSetOrdersAction.cpp +++ b/src/openrct2/actions/peep/StaffSetOrdersAction.cpp @@ -52,7 +52,7 @@ namespace OpenRCT2::GameActions return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } - auto* staff = gameState.entities.TryGetEntity(_spriteIndex); + auto* staff = gameState.entities.tryGetEntity(_spriteIndex); if (staff == nullptr || (staff->assignedStaffType != StaffType::handyman && staff->assignedStaffType != StaffType::mechanic)) { @@ -65,7 +65,7 @@ namespace OpenRCT2::GameActions Result StaffSetOrdersAction::Execute(GameState_t& gameState, Park::ParkData& park) const { - auto* staff = gameState.entities.TryGetEntity(_spriteIndex); + auto* staff = gameState.entities.tryGetEntity(_spriteIndex); if (staff == nullptr) { LOG_ERROR("Staff entity not found for spriteIndex %u", _spriteIndex); diff --git a/src/openrct2/actions/peep/StaffSetPatrolAreaAction.cpp b/src/openrct2/actions/peep/StaffSetPatrolAreaAction.cpp index ae9aed18de..37eb3c6167 100644 --- a/src/openrct2/actions/peep/StaffSetPatrolAreaAction.cpp +++ b/src/openrct2/actions/peep/StaffSetPatrolAreaAction.cpp @@ -62,7 +62,7 @@ namespace OpenRCT2::GameActions Result StaffSetPatrolAreaAction::QueryExecute(GameState_t& gameState, bool executing) const { - auto staff = gameState.entities.TryGetEntity(_spriteId); + auto staff = gameState.entities.tryGetEntity(_spriteId); if (staff == nullptr) { LOG_ERROR("Staff entity not found for spriteID %u", _spriteId.ToUnderlying()); diff --git a/src/openrct2/command_line/SimulateCommands.cpp b/src/openrct2/command_line/SimulateCommands.cpp index e4d27b2bfb..b6dfa15aba 100644 --- a/src/openrct2/command_line/SimulateCommands.cpp +++ b/src/openrct2/command_line/SimulateCommands.cpp @@ -71,7 +71,7 @@ namespace OpenRCT2 { gameStateUpdateLogic(); } - Console::WriteLine("Completed: %s", getGameState().entities.GetAllEntitiesChecksum().ToString().c_str()); + Console::WriteLine("Completed: %s", getGameState().entities.getAllEntitiesChecksum().toString().c_str()); } else { diff --git a/src/openrct2/drawing/LightFX.cpp b/src/openrct2/drawing/LightFX.cpp index 7583488285..4d28a707d9 100644 --- a/src/openrct2/drawing/LightFX.cpp +++ b/src/openrct2/drawing/LightFX.cpp @@ -724,7 +724,7 @@ namespace OpenRCT2::Drawing::LightFx void AddLightsMagicVehicle_BoatHire(const Vehicle* vehicle) { Vehicle* vehicle_draw = vehicle->TrainHead(); - auto* nextVeh = getGameState().entities.GetEntity(vehicle_draw->next_vehicle_on_train); + auto* nextVeh = getGameState().entities.getEntity(vehicle_draw->next_vehicle_on_train); if (nextVeh != nullptr) { vehicle_draw = nextVeh; diff --git a/src/openrct2/entity/Balloon.cpp b/src/openrct2/entity/Balloon.cpp index e6f01bd2b9..218293adc2 100644 --- a/src/openrct2/entity/Balloon.cpp +++ b/src/openrct2/entity/Balloon.cpp @@ -34,7 +34,7 @@ namespace OpenRCT2 frame++; if (frame >= 5) { - getGameState().entities.EntityRemove(this); + getGameState().entities.entityRemove(this); } } else @@ -98,7 +98,7 @@ namespace OpenRCT2 void Balloon::create(const CoordsXYZ& balloonPos, Drawing::Colour colour, bool isPopped) { - auto* balloon = getGameState().entities.CreateEntity(); + auto* balloon = getGameState().entities.createEntity(); if (balloon == nullptr) return; diff --git a/src/openrct2/entity/Duck.cpp b/src/openrct2/entity/Duck.cpp index 9d071ccf0b..9ad54f4c72 100644 --- a/src/openrct2/entity/Duck.cpp +++ b/src/openrct2/entity/Duck.cpp @@ -84,7 +84,7 @@ static constexpr uint8_t kDuckAnimationFlyAway[] = void Duck::remove() { invalidate(); - getGameState().entities.EntityRemove(this); + getGameState().entities.entityRemove(this); } void Duck::updateFlyToWater() @@ -289,7 +289,7 @@ static constexpr uint8_t kDuckAnimationFlyAway[] = void Duck::create(const CoordsXY& pos) { - auto* duck = getGameState().entities.CreateEntity(); + auto* duck = getGameState().entities.createEntity(); if (duck == nullptr) return; diff --git a/src/openrct2/entity/EntityList.h b/src/openrct2/entity/EntityList.h index 019db05253..4526c94958 100644 --- a/src/openrct2/entity/EntityList.h +++ b/src/openrct2/entity/EntityList.h @@ -43,7 +43,7 @@ namespace OpenRCT2 while (iter != end && Entity == nullptr) { - Entity = gameState.entities.TryGetEntity(*iter++); + Entity = gameState.entities.tryGetEntity(*iter++); } return *this; } @@ -82,7 +82,7 @@ namespace OpenRCT2 public: EntityTileList(const CoordsXY& loc) - : vec(getGameState().entities.GetEntityTileList(loc)) + : vec(getGameState().entities.getEntityTileList(loc)) { } @@ -120,7 +120,7 @@ namespace OpenRCT2 while (iter != end && Entity == nullptr) { - Entity = gameState.entities.TryGetEntity(*iter++); + Entity = gameState.entities.tryGetEntity(*iter++); } return *this; } @@ -160,7 +160,7 @@ namespace OpenRCT2 public: EntityList() - : vec(getGameState().entities.GetEntityList(T::kEntityType)) + : vec(getGameState().entities.getEntityList(T::kEntityType)) { } diff --git a/src/openrct2/entity/EntityRegistry.cpp b/src/openrct2/entity/EntityRegistry.cpp index c6834c2533..471a0c20ae 100644 --- a/src/openrct2/entity/EntityRegistry.cpp +++ b/src/openrct2/entity/EntityRegistry.cpp @@ -78,44 +78,44 @@ namespace OpenRCT2 } // TODO: make part of EntityList unit? - uint16_t EntityRegistry::GetEntityListCount(EntityType type) + uint16_t EntityRegistry::getEntityListCount(EntityType type) { return static_cast(gEntityLists[EnumValue(type)].size()); } // TODO: make part of EntityList unit? - uint16_t EntityRegistry::GetNumFreeEntities() + uint16_t EntityRegistry::getNumFreeEntities() { return static_cast(_freeIdList.size()); } - std::string EntitiesChecksum::ToString() const + std::string EntitiesChecksum::toString() const { return String::StringFromHex(raw); } - EntityBase* EntityRegistry::TryGetEntity(EntityId entityIndex) + EntityBase* EntityRegistry::tryGetEntity(EntityId entityIndex) { const auto idx = entityIndex.ToUnderlying(); return idx >= kMaxEntities ? nullptr : &entities[idx].base; } - EntityBase* EntityRegistry::GetEntity(EntityId entityIndex) + EntityBase* EntityRegistry::getEntity(EntityId entityIndex) { if (entityIndex.IsNull()) { return nullptr; } Guard::Assert(entityIndex.ToUnderlying() < kMaxEntities, "Tried getting entity %u", entityIndex.ToUnderlying()); - return TryGetEntity(entityIndex); + return tryGetEntity(entityIndex); } - const std::vector& EntityRegistry::GetEntityTileList(const CoordsXY& spritePos) + const std::vector& EntityRegistry::getEntityTileList(const CoordsXY& spritePos) { return gEntitySpatialIndex[ComputeSpatialIndex(spritePos)]; } - void EntityRegistry::ResetEntityLists() + void EntityRegistry::resetEntityLists() { for (auto& list : gEntityLists) { @@ -123,7 +123,7 @@ namespace OpenRCT2 } } - void EntityRegistry::ResetFreeIds() + void EntityRegistry::resetFreeIds() { _freeIdList.clear(); _freeIdList.resize(kMaxEntities); @@ -136,7 +136,7 @@ namespace OpenRCT2 }); } - const std::list& EntityRegistry::GetEntityList(const EntityType id) + const std::list& EntityRegistry::getEntityList(const EntityType id) { return gEntityLists[EnumValue(id)]; } @@ -145,17 +145,17 @@ namespace OpenRCT2 * * rct2: 0x0069EB13 */ - void EntityRegistry::ResetAllEntities() + void EntityRegistry::resetAllEntities() { // Free all associated Entity pointers prior to zeroing memory for (int32_t i = 0; i < kMaxEntities; ++i) { - auto* spr = GetEntity(EntityId::FromUnderlying(i)); + auto* spr = getEntity(EntityId::FromUnderlying(i)); if (spr == nullptr) { continue; } - FreeEntity(*spr); + freeEntity(*spr); } std::fill(std::begin(entities), std::end(entities), Entity_t()); @@ -163,7 +163,7 @@ namespace OpenRCT2 RideUse::GetTypeHistory().Clear(); for (int32_t i = 0; i < kMaxEntities; ++i) { - auto* spr = GetEntity(EntityId::FromUnderlying(i)); + auto* spr = getEntity(EntityId::FromUnderlying(i)); if (spr == nullptr) { continue; @@ -173,9 +173,9 @@ namespace OpenRCT2 _entityFlashingList[i] = false; } - ResetEntityLists(); - ResetFreeIds(); - ResetEntitySpatialIndices(); + resetEntityLists(); + resetFreeIds(); + resetEntitySpatialIndices(); } /** @@ -184,7 +184,7 @@ namespace OpenRCT2 * This function looks as though it sets some sort of order for sprites. * Sprites can share their position if this is the case. */ - void EntityRegistry::ResetEntitySpatialIndices() + void EntityRegistry::resetEntitySpatialIndices() { for (auto& vec : gEntitySpatialIndex) { @@ -192,33 +192,33 @@ namespace OpenRCT2 } for (EntityId::UnderlyingType i = 0; i < kMaxEntities; i++) { - auto* entity = GetEntity(EntityId::FromUnderlying(i)); + auto* entity = getEntity(EntityId::FromUnderlying(i)); if (entity != nullptr && entity->type != EntityType::null) { - EntitySpatialInsert(*entity, { entity->x, entity->y }); + entitySpatialInsert(*entity, { entity->x, entity->y }); } } } #ifndef DISABLE_NETWORK - EntitiesChecksum EntityRegistry::GetAllEntitiesChecksum() + EntitiesChecksum EntityRegistry::getAllEntitiesChecksum() { EntitiesChecksum checksum{}; ChecksumStream ms(checksum.raw); DataSerialiser ds(true, ms); - NetworkSerialiseEntityTypes(ds); + networkSerialiseEntityTypes(ds); return checksum; } #else - EntitiesChecksum EntityRegistry::GetAllEntitiesChecksum() + EntitiesChecksum EntityRegistry::getAllEntitiesChecksum() { return EntitiesChecksum{}; } #endif // DISABLE_NETWORK - void EntityRegistry::EntityReset(EntityBase& entity) + void EntityRegistry::entityReset(EntityBase& entity) { // Need to retain how the sprite is linked in lists auto entityIndex = entity.id; @@ -231,7 +231,7 @@ namespace OpenRCT2 entity.type = EntityType::null; } - void EntityRegistry::AddToEntityList(EntityBase& entity) + void EntityRegistry::addToEntityList(EntityBase& entity) { auto& list = gEntityLists[EnumValue(entity.type)]; @@ -239,13 +239,13 @@ namespace OpenRCT2 Algorithm::sortedInsert(list, entity.id); } - void EntityRegistry::AddToFreeList(EntityId index) + void EntityRegistry::addToFreeList(EntityId index) { // Free list must be in reverse sprite_index order to prevent desync issues _freeIdList.insert(std::upper_bound(std::rbegin(_freeIdList), std::rend(_freeIdList), index).base(), index); } - void EntityRegistry::RemoveFromEntityList(EntityBase& entity) + void EntityRegistry::removeFromEntityList(EntityBase& entity) { auto& list = gEntityLists[EnumValue(entity.type)]; auto ptr = Algorithm::binaryFind(std::begin(list), std::end(list), entity.id); @@ -255,26 +255,26 @@ namespace OpenRCT2 } } - uint16_t EntityRegistry::GetMiscEntityCount() + uint16_t EntityRegistry::getMiscEntityCount() { uint16_t count = 0; for (auto id : { EntityType::steamParticle, EntityType::moneyEffect, EntityType::crashedVehicleParticle, EntityType::explosionCloud, EntityType::crashSplash, EntityType::explosionFlare, EntityType::jumpingFountain, EntityType::balloon, EntityType::duck }) { - count += GetEntityListCount(id); + count += getEntityListCount(id); } return count; } - void EntityRegistry::PrepareNewEntity(EntityBase& base, const EntityType type) + void EntityRegistry::prepareNewEntity(EntityBase& base, const EntityType type) { // Need to reset all sprite data, as the uninitialised values // may contain garbage and cause a desync later on. - EntityReset(base); + entityReset(base); base.type = type; - AddToEntityList(base); + addToEntityList(base); base.x = kLocationNull; base.y = kLocationNull; @@ -285,10 +285,10 @@ namespace OpenRCT2 base.spriteData.spriteRect = {}; base.spatialIndex = kInvalidSpatialIndex; - EntitySpatialInsert(base, { kLocationNull, 0 }); + entitySpatialInsert(base, { kLocationNull, 0 }); } - EntityBase* EntityRegistry::CreateEntity(EntityType type) + EntityBase* EntityRegistry::createEntity(EntityType type) { if (_freeIdList.empty()) { @@ -299,7 +299,7 @@ namespace OpenRCT2 if (EntityTypeIsMiscEntity(type)) { // Misc sprites are commonly used for effects, give other entity types higher priority. - if (GetMiscEntityCount() >= kMaxMiscEntities) + if (getMiscEntityCount() >= kMaxMiscEntities) { return nullptr; } @@ -311,19 +311,19 @@ namespace OpenRCT2 } } - auto* entity = GetEntity(_freeIdList.back()); + auto* entity = getEntity(_freeIdList.back()); if (entity == nullptr) { return nullptr; } _freeIdList.pop_back(); - PrepareNewEntity(*entity, type); + prepareNewEntity(*entity, type); return entity; } - EntityBase* EntityRegistry::CreateEntityAt(const EntityId index, const EntityType type) + EntityBase* EntityRegistry::createEntityAt(const EntityId index, const EntityType type) { auto id = Algorithm::binaryFind(std::rbegin(_freeIdList), std::rend(_freeIdList), index); if (id == std::rend(_freeIdList)) @@ -331,7 +331,7 @@ namespace OpenRCT2 return nullptr; } - auto* entity = GetEntity(index); + auto* entity = getEntity(index); if (entity == nullptr) { return nullptr; @@ -339,7 +339,7 @@ namespace OpenRCT2 _freeIdList.erase(std::next(id).base()); - PrepareNewEntity(*entity, type); + prepareNewEntity(*entity, type); return entity; } @@ -347,22 +347,22 @@ namespace OpenRCT2 * * rct2: 0x00672AA4 */ - void EntityRegistry::UpdateAllMiscEntities() + void EntityRegistry::updateAllMiscEntities() { PROFILED_FUNCTION(); - MiscUpdateAllTypes< + miscUpdateAllTypes< SteamParticle, MoneyEffect, VehicleCrashParticle, ExplosionCloud, CrashSplashParticle, ExplosionFlare, JumpingFountain, Balloon, Duck>(); } - void EntityRegistry::UpdateMoneyEffect() + void EntityRegistry::updateMoneyEffect() { - MiscUpdateAllTypes(); + miscUpdateAllTypes(); } // Performs a search to ensure that insert keeps next_in_quadrant in sprite_index order - void EntityRegistry::EntitySpatialInsert(EntityBase& entity, const CoordsXY& newLoc) + void EntityRegistry::entitySpatialInsert(EntityBase& entity, const CoordsXY& newLoc) { const auto newIndex = ComputeSpatialIndex(newLoc); @@ -373,7 +373,7 @@ namespace OpenRCT2 entity.spatialIndex = newIndex; } - void EntityRegistry::EntitySpatialRemove(EntityBase& entity) + void EntityRegistry::entitySpatialRemove(EntityBase& entity) { const auto currentIndex = GetSpatialIndex(entity); @@ -386,34 +386,34 @@ namespace OpenRCT2 else { LOG_WARNING("Bad sprite spatial index. Rebuilding the spatial index..."); - ResetEntitySpatialIndices(); + resetEntitySpatialIndices(); } entity.spatialIndex = kInvalidSpatialIndex; } - void EntityRegistry::UpdateEntitySpatialIndex(EntityBase& entity) + void EntityRegistry::updateEntitySpatialIndex(EntityBase& entity) { if (entity.spatialIndex & kSpatialIndexDirtyMask) { if (entity.spatialIndex != kInvalidSpatialIndex) { - EntitySpatialRemove(entity); + entitySpatialRemove(entity); } - EntitySpatialInsert(entity, { entity.x, entity.y }); + entitySpatialInsert(entity, { entity.x, entity.y }); } } - void EntityRegistry::UpdateEntitiesSpatialIndex() + void EntityRegistry::updateEntitiesSpatialIndex() { for (auto& entityList : gEntityLists) { for (auto& entityId : entityList) { - auto* entity = TryGetEntity(entityId); + auto* entity = tryGetEntity(entityId); if (entity != nullptr && entity->type != EntityType::null) { - UpdateEntitySpatialIndex(*entity); + updateEntitySpatialIndex(*entity); } } } @@ -422,7 +422,7 @@ namespace OpenRCT2 /** * Frees any dynamically attached memory to the entity, such as peep name. */ - void EntityRegistry::FreeEntity(EntityBase& entity) + void EntityRegistry::freeEntity(EntityBase& entity) { auto* guest = entity.as(); auto* staff = entity.as(); @@ -445,53 +445,53 @@ namespace OpenRCT2 * * rct2: 0x0069EDB6 */ - void EntityRegistry::EntityRemove(EntityBase* entity) + void EntityRegistry::entityRemove(EntityBase* entity) { - FreeEntity(*entity); + freeEntity(*entity); EntityTweener::Get().RemoveEntity(entity); - RemoveFromEntityList(*entity); // remove from existing list - AddToFreeList(entity->id); + removeFromEntityList(*entity); // remove from existing list + addToFreeList(entity->id); - EntitySpatialRemove(*entity); - EntityReset(*entity); + entitySpatialRemove(*entity); + entityReset(*entity); } /** * Loops through all floating entities and removes them. * Returns the amount of removed objects as feedback. */ - uint16_t EntityRegistry::RemoveFloatingEntities() + uint16_t EntityRegistry::removeFloatingEntities() { uint16_t removed = 0; for (auto* balloon : EntityList()) { - EntityRemove(balloon); + entityRemove(balloon); removed++; } for (auto* duck : EntityList()) { if (duck->isFlying()) { - EntityRemove(duck); + entityRemove(duck); removed++; } } for (auto* money : EntityList()) { - EntityRemove(money); + entityRemove(money); removed++; } return removed; } - void EntityRegistry::EntitySetFlashing(EntityBase* entity, bool flashing) + void EntityRegistry::entitySetFlashing(EntityBase* entity, bool flashing) { assert(entity->id.ToUnderlying() < kMaxEntities); _entityFlashingList[entity->id.ToUnderlying()] = flashing; } - bool EntityRegistry::EntityGetFlashing(EntityBase* entity) + bool EntityRegistry::entityGetFlashing(EntityBase* entity) { assert(entity->id.ToUnderlying() < kMaxEntities); return _entityFlashingList[entity->id.ToUnderlying()]; @@ -575,5 +575,5 @@ void EntityBase::moveToAndUpdateSpatialIndex(const CoordsXYZ& newLocation) // TODO: pass as param instead of relying on global game state auto& gameState = getGameState(); - gameState.entities.UpdateEntitySpatialIndex(*this); + gameState.entities.updateEntitySpatialIndex(*this); } diff --git a/src/openrct2/entity/EntityRegistry.h b/src/openrct2/entity/EntityRegistry.h index e279dde15b..bab8b1168a 100644 --- a/src/openrct2/entity/EntityRegistry.h +++ b/src/openrct2/entity/EntityRegistry.h @@ -33,10 +33,10 @@ namespace OpenRCT2 union Entity_t { - uint8_t Pad00[0x200]; + uint8_t pad00[0x200]; EntityBase base; Entity_t() - : Pad00() + : pad00() { } }; @@ -46,7 +46,7 @@ namespace OpenRCT2 { std::array raw; - std::string ToString() const; + std::string toString() const; }; #pragma pack(pop) @@ -65,15 +65,15 @@ namespace OpenRCT2 std::array, kSpatialIndexSize> gEntitySpatialIndex; public: - uint16_t GetEntityListCount(EntityType type); - uint16_t GetNumFreeEntities(); + uint16_t getEntityListCount(EntityType type); + uint16_t getNumFreeEntities(); - EntityBase* GetEntity(EntityId entityId); + EntityBase* getEntity(EntityId entityId); template - T* GetEntity(EntityId entityId) + T* getEntity(EntityId entityId) { - auto* ent = GetEntity(entityId); + auto* ent = getEntity(entityId); if (ent == nullptr) { return nullptr; @@ -88,12 +88,12 @@ namespace OpenRCT2 } } - EntityBase* TryGetEntity(EntityId spriteIndex); + EntityBase* tryGetEntity(EntityId spriteIndex); template - T* TryGetEntity(EntityId entityId) + T* tryGetEntity(EntityId entityId) { - auto* ent = TryGetEntity(entityId); + auto* ent = tryGetEntity(entityId); if (ent == nullptr) { return nullptr; @@ -108,35 +108,35 @@ namespace OpenRCT2 } } - const std::vector& GetEntityTileList(const CoordsXY& spritePos); + const std::vector& getEntityTileList(const CoordsXY& spritePos); - EntityBase* CreateEntity(EntityType type); + EntityBase* createEntity(EntityType type); template - T* CreateEntity() + T* createEntity() { - return static_cast(CreateEntity(T::kEntityType)); + return static_cast(createEntity(T::kEntityType)); } // Use only with imports that must happen at a specified index - EntityBase* CreateEntityAt(EntityId index, EntityType type); + EntityBase* createEntityAt(EntityId index, EntityType type); // Use only with imports that must happen at a specified index template - T* CreateEntityAt(EntityId index) + T* createEntityAt(EntityId index) { - return static_cast(CreateEntityAt(index, T::kEntityType)); + return static_cast(createEntityAt(index, T::kEntityType)); } - const std::list& GetEntityList(EntityType id); - uint16_t GetMiscEntityCount(); + const std::list& getEntityList(EntityType id); + uint16_t getMiscEntityCount(); - void ResetAllEntities(); - void ResetEntitySpatialIndices(); + void resetAllEntities(); + void resetEntitySpatialIndices(); #ifndef DISABLE_NETWORK template - void NetworkSerialseEntityType(DataSerialiser& ds) + void networkSerialseEntityType(DataSerialiser& ds) { for (auto* ent : EntityList()) { @@ -145,17 +145,17 @@ namespace OpenRCT2 } template - void NetworkSerialiseEntityTypes(DataSerialiser& ds) + void networkSerialiseEntityTypes(DataSerialiser& ds) { - (NetworkSerialseEntityType(ds), ...); + (networkSerialseEntityType(ds), ...); } #endif // DISABLE_NETWORK - EntitiesChecksum GetAllEntitiesChecksum(); + EntitiesChecksum getAllEntitiesChecksum(); template - void MiscUpdateAllType() + void miscUpdateAllType() { for (auto misc : EntityList()) { @@ -164,32 +164,32 @@ namespace OpenRCT2 } template - void MiscUpdateAllTypes() + void miscUpdateAllTypes() { - (MiscUpdateAllType(), ...); + (miscUpdateAllType(), ...); } - void UpdateAllMiscEntities(); - void UpdateMoneyEffect(); - void EntityRemove(EntityBase* entity); - uint16_t RemoveFloatingEntities(); - void UpdateEntitiesSpatialIndex(); - void UpdateEntitySpatialIndex(EntityBase& entity); + void updateAllMiscEntities(); + void updateMoneyEffect(); + void entityRemove(EntityBase* entity); + uint16_t removeFloatingEntities(); + void updateEntitiesSpatialIndex(); + void updateEntitySpatialIndex(EntityBase& entity); - void EntitySetFlashing(EntityBase* entity, bool flashing); - bool EntityGetFlashing(EntityBase* entity); + void entitySetFlashing(EntityBase* entity, bool flashing); + bool entityGetFlashing(EntityBase* entity); private: - void ResetEntityLists(); - void ResetFreeIds(); - void EntityReset(EntityBase& entity); - void AddToEntityList(EntityBase& entity); - void AddToFreeList(EntityId index); - void RemoveFromEntityList(EntityBase& entity); - void PrepareNewEntity(EntityBase& base, EntityType type); - void EntitySpatialInsert(EntityBase& entity, const CoordsXY& newLoc); - void EntitySpatialRemove(EntityBase& entity); - void FreeEntity(EntityBase& entity); + void resetEntityLists(); + void resetFreeIds(); + void entityReset(EntityBase& entity); + void addToEntityList(EntityBase& entity); + void addToFreeList(EntityId index); + void removeFromEntityList(EntityBase& entity); + void prepareNewEntity(EntityBase& base, EntityType type); + void entitySpatialInsert(EntityBase& entity, const CoordsXY& newLoc); + void entitySpatialRemove(EntityBase& entity); + void freeEntity(EntityBase& entity); }; } // namespace OpenRCT2 diff --git a/src/openrct2/entity/Guest.cpp b/src/openrct2/entity/Guest.cpp index 8122235362..858447ec95 100644 --- a/src/openrct2/entity/Guest.cpp +++ b/src/openrct2/entity/Guest.cpp @@ -1920,7 +1920,7 @@ namespace OpenRCT2 else { // Check if there's room in the queue for the peep to enter. - Guest* lastPeepInQueue = getGameState().entities.GetEntity(station.LastPeepInQueue); + Guest* lastPeepInQueue = getGameState().entities.getEntity(station.LastPeepInQueue); if (lastPeepInQueue != nullptr && (abs(lastPeepInQueue->z - z) <= 6)) { int32_t dx = abs(lastPeepInQueue->x - x); @@ -2409,7 +2409,7 @@ namespace OpenRCT2 guest.currentCar = carArray[chosen_car]; - Vehicle* vehicle = getGameState().entities.GetEntity(ride.vehicles[guest.currentTrain]); + Vehicle* vehicle = getGameState().entities.getEntity(ride.vehicles[guest.currentTrain]); if (vehicle == nullptr) { return nullptr; @@ -2500,7 +2500,7 @@ namespace OpenRCT2 for (int32_t i = 0; i < ride.numTrains; ++i) { - Vehicle* vehicle = getGameState().entities.GetEntity(ride.vehicles[i]); + Vehicle* vehicle = getGameState().entities.getEntity(ride.vehicles[i]); if (vehicle == nullptr) continue; @@ -2527,8 +2527,8 @@ namespace OpenRCT2 int32_t i = 0; auto vehicle_id = ride.vehicles[chosen_train]; - for (Vehicle* vehicle = getGameState().entities.GetEntity(vehicle_id); vehicle != nullptr; - vehicle = getGameState().entities.GetEntity(vehicle->next_vehicle_on_train), ++i) + for (Vehicle* vehicle = getGameState().entities.getEntity(vehicle_id); vehicle != nullptr; + vehicle = getGameState().entities.getEntity(vehicle->next_vehicle_on_train), ++i) { uint8_t num_seats = vehicle->num_seats; if (vehicle->IsUsedInPairs()) @@ -3594,7 +3594,7 @@ namespace OpenRCT2 uint8_t direction_track = (tile_element == nullptr ? 0 : tile_element->getDirection()); - auto vehicle = getGameState().entities.GetEntity(ride.vehicles[currentTrain]); + auto vehicle = getGameState().entities.getEntity(ride.vehicles[currentTrain]); if (vehicle == nullptr) { // TODO: Goto ride exit on failure. @@ -3684,7 +3684,7 @@ namespace OpenRCT2 return; } - Vehicle* vehicle = getGameState().entities.GetEntity(ride->vehicles[currentTrain]); + Vehicle* vehicle = getGameState().entities.getEntity(ride->vehicles[currentTrain]); if (vehicle == nullptr) { return; @@ -3920,7 +3920,7 @@ namespace OpenRCT2 } auto& gameState = getGameState(); - Vehicle* vehicle = gameState.entities.GetEntity(ride->vehicles[currentTrain]); + Vehicle* vehicle = gameState.entities.getEntity(ride->vehicles[currentTrain]); if (vehicle == nullptr) { // TODO: Leave ride on failure goes for all returns on nullptr in this function @@ -3942,11 +3942,11 @@ namespace OpenRCT2 for (size_t i = 0; i < ride->numTrains; ++i) { - Vehicle* train = gameState.entities.GetEntity(ride->vehicles[i]); + Vehicle* train = gameState.entities.getEntity(ride->vehicles[i]); if (train == nullptr) continue; - Vehicle* second_vehicle = gameState.entities.GetEntity(train->next_vehicle_on_train); + Vehicle* second_vehicle = gameState.entities.getEntity(train->next_vehicle_on_train); if (second_vehicle == nullptr) continue; @@ -3984,7 +3984,7 @@ namespace OpenRCT2 } } - Vehicle* currentTrainEntity = gameState.entities.GetEntity(ride->vehicles[currentTrain]); + Vehicle* currentTrainEntity = gameState.entities.getEntity(ride->vehicles[currentTrain]); if (currentTrainEntity == nullptr) { return; @@ -4023,7 +4023,7 @@ namespace OpenRCT2 auto* ride = GetRide(currentRide); if (ride != nullptr) { - auto* vehicle = gameState.entities.GetEntity(ride->vehicles[currentTrain]); + auto* vehicle = gameState.entities.getEntity(ride->vehicles[currentTrain]); if (vehicle != nullptr) { vehicle = vehicle->GetCar(currentCar); @@ -4040,7 +4040,7 @@ namespace OpenRCT2 if (vehicle->IsUsedInPairs()) { - auto* seatedGuest = gameState.entities.GetEntity(vehicle->peep[currentSeat ^ 1]); + auto* seatedGuest = gameState.entities.getEntity(vehicle->peep[currentSeat ^ 1]); if (seatedGuest != nullptr) { if (seatedGuest->rideSubState != PeepRideSubState::enterVehicle) @@ -4086,7 +4086,7 @@ namespace OpenRCT2 if (ride == nullptr) return; - Vehicle* vehicle = gameState.entities.GetEntity(ride->vehicles[currentTrain]); + Vehicle* vehicle = gameState.entities.getEntity(ride->vehicles[currentTrain]); if (vehicle == nullptr) return; @@ -4147,7 +4147,7 @@ namespace OpenRCT2 if (!ride->getRideTypeDescriptor().flags.has(RtdFlag::vehicleIsIntegral)) { for (; vehicle != nullptr && !vehicle->IsHead(); - vehicle = gameState.entities.GetEntity(vehicle->prev_vehicle_on_ride)) + vehicle = gameState.entities.getEntity(vehicle->prev_vehicle_on_ride)) { auto trackType = vehicle->GetTrackType(); if (trackType == TrackElemType::flat || trackType > TrackElemType::middleStation) @@ -4265,7 +4265,7 @@ namespace OpenRCT2 Direction station_direction = (trackElement == nullptr ? 0 : trackElement->getDirection()); - vehicle = gameState.entities.GetEntity(ride->vehicles[currentTrain]); + vehicle = gameState.entities.getEntity(ride->vehicles[currentTrain]); if (vehicle == nullptr) { return; @@ -4447,7 +4447,7 @@ namespace OpenRCT2 // This is incrementing the actual peep waypoint var37++; - Vehicle* vehicle = getGameState().entities.GetEntity(ride->vehicles[currentTrain]); + Vehicle* vehicle = getGameState().entities.getEntity(ride->vehicles[currentTrain]); if (vehicle == nullptr) { return; @@ -4544,7 +4544,7 @@ namespace OpenRCT2 } var37--; - Vehicle* vehicle = getGameState().entities.GetEntity(ride->vehicles[currentTrain]); + Vehicle* vehicle = getGameState().entities.getEntity(ride->vehicles[currentTrain]); if (vehicle == nullptr) { return; @@ -5647,7 +5647,7 @@ namespace OpenRCT2 // first check if the next in queue is actually nearby // if they are not then it's safe to assume that this is // the front of the queue. - Peep* nextGuest = getGameState().entities.GetEntity(guestNextInQueue); + Peep* nextGuest = getGameState().entities.getEntity(guestNextInQueue); if (nextGuest != nullptr) { if (abs(nextGuest->x - x) < 32 && abs(nextGuest->y - y) < 32) @@ -7147,10 +7147,10 @@ namespace OpenRCT2 Guest* Guest::generate(const CoordsXYZ& coords) { auto& gameState = getGameState(); - if (gameState.entities.GetNumFreeEntities() < 400) + if (gameState.entities.getNumFreeEntities() < 400) return nullptr; - Guest* peep = gameState.entities.CreateEntity(); + Guest* peep = gameState.entities.createEntity(); peep->animationObjectIndex = findPeepAnimationsIndexForType(AnimationPeepType::guest); peep->animationGroup = PeepAnimationGroup::normal; @@ -7437,7 +7437,7 @@ namespace OpenRCT2 { timeInQueue = AddClamp(timeInQueue, 1); - auto* guestNext = getGameState().entities.GetEntity(guestNextInQueue); + auto* guestNext = getGameState().entities.getEntity(guestNextInQueue); if (guestNext == nullptr) { return false; @@ -7528,13 +7528,13 @@ namespace OpenRCT2 } auto& gameState = getGameState(); - auto* otherGuest = gameState.entities.GetEntity(station.LastPeepInQueue); + auto* otherGuest = gameState.entities.getEntity(station.LastPeepInQueue); if (otherGuest == nullptr) { LOG_ERROR("Invalid Guest Queue list!"); return; } - for (; otherGuest != nullptr; otherGuest = gameState.entities.GetEntity(otherGuest->guestNextInQueue)) + for (; otherGuest != nullptr; otherGuest = gameState.entities.getEntity(otherGuest->guestNextInQueue)) { if (id == otherGuest->guestNextInQueue) { diff --git a/src/openrct2/entity/JumpingFountain.cpp b/src/openrct2/entity/JumpingFountain.cpp index 202ac76d03..65424f5d9f 100644 --- a/src/openrct2/entity/JumpingFountain.cpp +++ b/src/openrct2/entity/JumpingFountain.cpp @@ -140,7 +140,7 @@ namespace OpenRCT2 const JumpingFountainType newType, const CoordsXYZ& newLoc, const int32_t direction, const FountainFlags newFlags, const int32_t iteration) { - auto* jumpingFountain = getGameState().entities.CreateEntity(); + auto* jumpingFountain = getGameState().entities.createEntity(); if (jumpingFountain != nullptr) { jumpingFountain->iteration = iteration; @@ -195,7 +195,7 @@ namespace OpenRCT2 if (frame == 16) { - getGameState().entities.EntityRemove(this); + getGameState().entities.entityRemove(this); } } diff --git a/src/openrct2/entity/Litter.cpp b/src/openrct2/entity/Litter.cpp index 3fca12b917..1df2a460ac 100644 --- a/src/openrct2/entity/Litter.cpp +++ b/src/openrct2/entity/Litter.cpp @@ -60,7 +60,7 @@ namespace OpenRCT2 if (!IsLocationLitterable(offsetLitterPos)) return; - if (gameState.entities.GetEntityListCount(EntityType::litter) >= 500) + if (gameState.entities.getEntityListCount(EntityType::litter) >= 500) { Litter* newestLitter = nullptr; uint32_t newestLitterCreationTick = 0; @@ -76,11 +76,11 @@ namespace OpenRCT2 if (newestLitter != nullptr) { newestLitter->invalidate(); - gameState.entities.EntityRemove(newestLitter); + gameState.entities.entityRemove(newestLitter); } } - Litter* litter = gameState.entities.CreateEntity(); + Litter* litter = gameState.entities.createEntity(); if (litter == nullptr) return; @@ -115,7 +115,7 @@ namespace OpenRCT2 for (auto* litter : removals) { litter->invalidate(); - getGameState().entities.EntityRemove(litter); + getGameState().entities.entityRemove(litter); } } diff --git a/src/openrct2/entity/MoneyEffect.cpp b/src/openrct2/entity/MoneyEffect.cpp index 53c941325a..f9351c09c1 100644 --- a/src/openrct2/entity/MoneyEffect.cpp +++ b/src/openrct2/entity/MoneyEffect.cpp @@ -46,7 +46,7 @@ namespace OpenRCT2 if (value == 0.00_GBP) return; - MoneyEffect* moneyEffect = getGameState().entities.CreateEntity(); + MoneyEffect* moneyEffect = getGameState().entities.createEntity(); if (moneyEffect == nullptr) return; @@ -150,7 +150,7 @@ namespace OpenRCT2 return; } - getGameState().entities.EntityRemove(this); + getGameState().entities.entityRemove(this); } std::pair MoneyEffect::getStringId() const diff --git a/src/openrct2/entity/Particle.cpp b/src/openrct2/entity/Particle.cpp index 82a71ff5dd..ea661fae08 100644 --- a/src/openrct2/entity/Particle.cpp +++ b/src/openrct2/entity/Particle.cpp @@ -75,7 +75,7 @@ namespace OpenRCT2 */ void VehicleCrashParticle::create(VehicleColour& colours, const CoordsXYZ& vehiclePos) { - VehicleCrashParticle* sprite = getGameState().entities.CreateEntity(); + VehicleCrashParticle* sprite = getGameState().entities.createEntity(); if (sprite != nullptr) { sprite->moveTo(vehiclePos); @@ -96,7 +96,7 @@ namespace OpenRCT2 timeToLive--; if (timeToLive == 0) { - getGameState().entities.EntityRemove(this); + getGameState().entities.entityRemove(this); return; } @@ -128,7 +128,7 @@ namespace OpenRCT2 // Splash Audio::Play3D(Audio::SoundId::water2, { x, y, waterZ }); CrashSplashParticle::create({ x, y, waterZ }); - getGameState().entities.EntityRemove(this); + getGameState().entities.entityRemove(this); return; } @@ -168,7 +168,7 @@ namespace OpenRCT2 */ void CrashSplashParticle::create(const CoordsXYZ& splashPos) { - auto* sprite = getGameState().entities.CreateEntity(); + auto* sprite = getGameState().entities.createEntity(); if (sprite != nullptr) { sprite->spriteData.width = 33; @@ -189,7 +189,7 @@ namespace OpenRCT2 frame += 85; if (frame >= 7168) { - getGameState().entities.EntityRemove(this); + getGameState().entities.entityRemove(this); } } @@ -208,7 +208,7 @@ namespace OpenRCT2 auto surfaceElement = MapGetSurfaceElementAt(coords); if (surfaceElement != nullptr && coords.z > surfaceElement->getBaseZ()) { - SteamParticle* steam = getGameState().entities.CreateEntity(); + SteamParticle* steam = getGameState().entities.createEntity(); if (steam == nullptr) return; @@ -238,7 +238,7 @@ namespace OpenRCT2 frame += 64; if (frame >= (56 * 64)) { - getGameState().entities.EntityRemove(this); + getGameState().entities.entityRemove(this); } } @@ -255,7 +255,7 @@ namespace OpenRCT2 */ void ExplosionCloud::create(const CoordsXYZ& cloudPos) { - auto* entity = getGameState().entities.CreateEntity(); + auto* entity = getGameState().entities.createEntity(); if (entity != nullptr) { entity->spriteData.width = 44; @@ -276,7 +276,7 @@ namespace OpenRCT2 frame += 128; if (frame >= (36 * 128)) { - getGameState().entities.EntityRemove(this); + getGameState().entities.entityRemove(this); } } @@ -292,7 +292,7 @@ namespace OpenRCT2 */ void ExplosionFlare::create(const CoordsXYZ& flarePos) { - auto* entity = getGameState().entities.CreateEntity(); + auto* entity = getGameState().entities.createEntity(); if (entity != nullptr) { entity->spriteData.width = 25; @@ -313,7 +313,7 @@ namespace OpenRCT2 frame += 64; if (frame >= (124 * 64)) { - getGameState().entities.EntityRemove(this); + getGameState().entities.entityRemove(this); } } diff --git a/src/openrct2/entity/Peep.cpp b/src/openrct2/entity/Peep.cpp index c2d6825a47..43cc02a03c 100644 --- a/src/openrct2/entity/Peep.cpp +++ b/src/openrct2/entity/Peep.cpp @@ -180,7 +180,7 @@ namespace OpenRCT2 int32_t PeepGetStaffCount() { - return getGameState().entities.GetEntityListCount(EntityType::staff); + return getGameState().entities.getEntityListCount(EntityType::staff); } /** @@ -738,7 +738,7 @@ namespace OpenRCT2 News::DisableNewsItems(News::ItemType::peep, staff->id.ToUnderlying()); } - getGameState().entities.EntityRemove(peep); + getGameState().entities.entityRemove(peep); auto intent = Intent(wasGuest ? INTENT_ACTION_REFRESH_GUEST_LIST : INTENT_ACTION_REFRESH_STAFF_LIST); ContextBroadcastIntent(&intent); @@ -2528,8 +2528,8 @@ namespace OpenRCT2 int32_t PeepCompare(const EntityId sprite_index_a, const EntityId sprite_index_b) { - Peep const* peep_a = getGameState().entities.GetEntity(sprite_index_a); - Peep const* peep_b = getGameState().entities.GetEntity(sprite_index_b); + Peep const* peep_a = getGameState().entities.getEntity(sprite_index_a); + Peep const* peep_b = getGameState().entities.getEntity(sprite_index_b); if (peep_a == nullptr || peep_b == nullptr) { return 0; diff --git a/src/openrct2/entity/Staff.cpp b/src/openrct2/entity/Staff.cpp index 65d1dad641..65411d1931 100644 --- a/src/openrct2/entity/Staff.cpp +++ b/src/openrct2/entity/Staff.cpp @@ -2144,7 +2144,7 @@ namespace OpenRCT2 break; } - vehicle = getGameState().entities.GetEntity(vehicle->prev_vehicle_on_ride); + vehicle = getGameState().entities.getEntity(vehicle->prev_vehicle_on_ride); if (vehicle == nullptr) { return true; diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index 517d78892f..d40d30b6da 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -259,9 +259,9 @@ static void ConsoleCommandRides(InteractiveConsole& console, const arguments_t& { for (int32_t i = 0; i < ride->numTrains; ++i) { - for (Vehicle* vehicle = gameState.entities.GetEntity(ride->vehicles[i]); + for (Vehicle* vehicle = gameState.entities.getEntity(ride->vehicles[i]); vehicle != nullptr; - vehicle = gameState.entities.GetEntity(vehicle->next_vehicle_on_train)) + vehicle = gameState.entities.getEntity(vehicle->next_vehicle_on_train)) { vehicle->mass = mass; } @@ -481,7 +481,7 @@ static void ConsoleCommandStaff(InteractiveConsole& console, const arguments_t& if (int_valid[0] && int_valid[1]) { - Peep* peep = gameState.entities.GetEntity(EntityId::FromUnderlying(int_val[0])); + Peep* peep = gameState.entities.getEntity(EntityId::FromUnderlying(int_val[0])); if (peep != nullptr) { peep->energy = int_val[1]; @@ -500,7 +500,7 @@ static void ConsoleCommandStaff(InteractiveConsole& console, const arguments_t& console.WriteLineError("Invalid staff ID"); return; } - auto staff = gameState.entities.GetEntity(EntityId::FromUnderlying(int_val[0])); + auto staff = gameState.entities.getEntity(EntityId::FromUnderlying(int_val[0])); if (staff == nullptr) { console.WriteLineError("Invalid staff ID"); @@ -1225,7 +1225,7 @@ static void ConsoleCommandRemoveUnusedObjects(InteractiveConsole& console, [[may static void ConsoleCommandRemoveFloatingObjects(InteractiveConsole& console, const arguments_t& argv) { - uint16_t result = getGameState().entities.RemoveFloatingEntities(); + uint16_t result = getGameState().entities.removeFloatingEntities(); console.WriteFormatLine("Removed %d flying objects", result); } @@ -1239,7 +1239,7 @@ static void ConsoleCommandShowLimits(InteractiveConsole& console, [[maybe_unused for (int32_t i = 0; i < static_cast(EntityType::count); ++i) { auto& gameState = getGameState(); - spriteCount += gameState.entities.GetEntityListCount(EntityType(i)); + spriteCount += gameState.entities.getEntityListCount(EntityType(i)); } auto bannerCount = GetNumBanners(); diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 0d14640a32..2e5d91bd32 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -120,7 +120,7 @@ namespace OpenRCT2 return arg; else if constexpr (std::is_same_v) { - auto* centreEntity = getGameState().entities.GetEntity(arg); + auto* centreEntity = getGameState().entities.getEntity(arg); if (centreEntity != nullptr) { return CoordsXYZ{ centreEntity->x, centreEntity->y, centreEntity->z }; @@ -611,7 +611,7 @@ namespace OpenRCT2 { if (!window->viewportTargetSprite.IsNull() && window->viewport != nullptr) { - auto* sprite = getGameState().entities.GetEntity(window->viewportTargetSprite); + auto* sprite = getGameState().entities.getEntity(window->viewportTargetSprite); if (sprite == nullptr) { return; @@ -635,7 +635,7 @@ namespace OpenRCT2 void ViewportUpdateSmartFollowEntity(WindowBase* window) { - auto entity = getGameState().entities.TryGetEntity(window->viewportSmartFollowSprite); + auto entity = getGameState().entities.tryGetEntity(window->viewportSmartFollowSprite); if (entity == nullptr || entity->type == EntityType::null) { window->viewportSmartFollowSprite = EntityId::GetNull(); @@ -696,7 +696,7 @@ namespace OpenRCT2 auto ride = GetRide(peep.currentRide); if (ride != nullptr && ride->flags.has(RideFlag::onTrack)) { - auto train = getGameState().entities.GetEntity(ride->vehicles[peep.currentTrain]); + auto train = getGameState().entities.getEntity(ride->vehicles[peep.currentTrain]); if (train != nullptr) { const auto car = train->GetCar(peep.currentCar); diff --git a/src/openrct2/management/Award.cpp b/src/openrct2/management/Award.cpp index 3a988ed5b7..59cb9c5cc8 100644 --- a/src/openrct2/management/Award.cpp +++ b/src/openrct2/management/Award.cpp @@ -280,8 +280,8 @@ static bool AwardIsDeservedBestStaff(GameState_t& gameState, Park::ParkData& par if (activeAwardTypes & EnumToFlag(AwardType::mostUntidy)) return false; - auto staffCount = gameState.entities.GetEntityListCount(EntityType::staff); - auto peepCount = gameState.entities.GetEntityListCount(EntityType::guest); + auto staffCount = gameState.entities.getEntityListCount(EntityType::staff); + auto peepCount = gameState.entities.getEntityListCount(EntityType::guest); FlagHolder foundStaffTypes{}; for (auto* staff : EntityList()) diff --git a/src/openrct2/management/NewsItem.cpp b/src/openrct2/management/NewsItem.cpp index 90f1429f0f..50de83641e 100644 --- a/src/openrct2/management/NewsItem.cpp +++ b/src/openrct2/management/NewsItem.cpp @@ -230,7 +230,7 @@ std::optional News::GetSubjectLocation(ItemType type, int32_t subject } case ItemType::peepOnRide: { - auto peep = gameState.entities.TryGetEntity(EntityId::FromUnderlying(subject)); + auto peep = gameState.entities.tryGetEntity(EntityId::FromUnderlying(subject)); if (peep == nullptr) break; @@ -253,11 +253,11 @@ std::optional News::GetSubjectLocation(ItemType type, int32_t subject } // Find the first car of the train peep is on - auto sprite = gameState.entities.TryGetEntity(ride->vehicles[peep->currentTrain]); + auto sprite = gameState.entities.tryGetEntity(ride->vehicles[peep->currentTrain]); // Find the actual car peep is on for (int32_t i = 0; i < peep->currentCar && sprite != nullptr; i++) { - sprite = gameState.entities.TryGetEntity(sprite->next_vehicle_on_train); + sprite = gameState.entities.tryGetEntity(sprite->next_vehicle_on_train); } if (sprite != nullptr) { @@ -267,7 +267,7 @@ std::optional News::GetSubjectLocation(ItemType type, int32_t subject } case ItemType::peep: { - auto peep = gameState.entities.TryGetEntity(EntityId::FromUnderlying(subject)); + auto peep = gameState.entities.tryGetEntity(EntityId::FromUnderlying(subject)); if (peep != nullptr) { subjectLoc = peep->getLocation(); @@ -380,7 +380,7 @@ void News::OpenSubject(ItemType type, int32_t subject) case ItemType::peepOnRide: case ItemType::peep: { - auto peep = getGameState().entities.TryGetEntity(EntityId::FromUnderlying(subject)); + auto peep = getGameState().entities.tryGetEntity(EntityId::FromUnderlying(subject)); if (peep != nullptr) { auto intent = Intent(WindowClass::peep); diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index b1bd4e2f83..ab19ec4450 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -856,8 +856,8 @@ namespace OpenRCT2::Network if (!storedTick.spriteHash.empty()) { - EntitiesChecksum checksum = getGameState().entities.GetAllEntitiesChecksum(); - std::string clientSpriteHash = checksum.ToString(); + EntitiesChecksum checksum = getGameState().entities.getAllEntitiesChecksum(); + std::string clientSpriteHash = checksum.toString(); if (clientSpriteHash != storedTick.spriteHash) { LOG_INFO( @@ -1601,8 +1601,8 @@ namespace OpenRCT2::Network packet << flags; if (flags & TickFlags::kChecksums) { - EntitiesChecksum checksum = getGameState().entities.GetAllEntitiesChecksum(); - packet.writeString(checksum.ToString()); + EntitiesChecksum checksum = getGameState().entities.getAllEntitiesChecksum(); + packet.writeString(checksum.toString()); } SendPacketToClients(packet); diff --git a/src/openrct2/paint/tile_element/Paint.Surface.cpp b/src/openrct2/paint/tile_element/Paint.Surface.cpp index bbcce2e1db..e48df864ed 100644 --- a/src/openrct2/paint/tile_element/Paint.Surface.cpp +++ b/src/openrct2/paint/tile_element/Paint.Surface.cpp @@ -821,7 +821,7 @@ std::optional GetPatrolAreaTileColour(const CoordsXY& else { auto& staffId = std::get(patrolAreaToRender); - auto* staff = getGameState().entities.GetEntity(staffId); + auto* staff = getGameState().entities.getEntity(staffId); if (staff != nullptr) { if (staff->isPatrolAreaSet(pos)) diff --git a/src/openrct2/paint/track/gentle/Circus.cpp b/src/openrct2/paint/track/gentle/Circus.cpp index f9d93bc3d6..2b688c8393 100644 --- a/src/openrct2/paint/track/gentle/Circus.cpp +++ b/src/openrct2/paint/track/gentle/Circus.cpp @@ -28,7 +28,7 @@ static void PaintCircusTent( if (rideEntry == nullptr) return; - auto vehicle = getGameState().entities.GetEntity(ride.vehicles[0]); + auto vehicle = getGameState().entities.getEntity(ride.vehicles[0]); if (ride.flags.has(RideFlag::onTrack) && vehicle != nullptr) { session.InteractionType = ViewportInteractionItem::entity; diff --git a/src/openrct2/paint/track/gentle/CrookedHouse.cpp b/src/openrct2/paint/track/gentle/CrookedHouse.cpp index 837a782791..b4242b9942 100644 --- a/src/openrct2/paint/track/gentle/CrookedHouse.cpp +++ b/src/openrct2/paint/track/gentle/CrookedHouse.cpp @@ -68,7 +68,7 @@ static void PaintCrookedHouseStructure( if (ride->flags.has(RideFlag::onTrack)) { - auto vehicle = getGameState().entities.GetEntity(ride->vehicles[0]); + auto vehicle = getGameState().entities.getEntity(ride->vehicles[0]); if (vehicle != nullptr) { session.InteractionType = ViewportInteractionItem::entity; diff --git a/src/openrct2/paint/track/gentle/FerrisWheel.cpp b/src/openrct2/paint/track/gentle/FerrisWheel.cpp index 86e2114bec..9afcf5c94e 100644 --- a/src/openrct2/paint/track/gentle/FerrisWheel.cpp +++ b/src/openrct2/paint/track/gentle/FerrisWheel.cpp @@ -50,7 +50,7 @@ static void PaintFerrisWheelRiders( { for (int32_t i = 0; i < 32; i += 2) { - auto* peep = getGameState().entities.GetEntity(vehicle.peep[i]); + auto* peep = getGameState().entities.getEntity(vehicle.peep[i]); if (peep == nullptr || peep->state != PeepState::onRide) continue; @@ -68,7 +68,7 @@ static void PaintFerrisWheelStructure( if (rideEntry == nullptr) return; - auto vehicle = getGameState().entities.GetEntity(ride.vehicles[0]); + auto vehicle = getGameState().entities.getEntity(ride.vehicles[0]); if (ride.flags.has(RideFlag::onTrack) && vehicle != nullptr) { session.InteractionType = ViewportInteractionItem::entity; diff --git a/src/openrct2/paint/track/gentle/HauntedHouse.cpp b/src/openrct2/paint/track/gentle/HauntedHouse.cpp index 95fe88db84..7e248d9f8b 100644 --- a/src/openrct2/paint/track/gentle/HauntedHouse.cpp +++ b/src/openrct2/paint/track/gentle/HauntedHouse.cpp @@ -36,7 +36,7 @@ static void PaintHauntedHouseStructure( if (rideEntry == nullptr) return; - auto vehicle = getGameState().entities.GetEntity(ride.vehicles[0]); + auto vehicle = getGameState().entities.getEntity(ride.vehicles[0]); if (ride.flags.has(RideFlag::onTrack) && vehicle != nullptr) { session.InteractionType = ViewportInteractionItem::entity; diff --git a/src/openrct2/paint/track/gentle/MerryGoRound.cpp b/src/openrct2/paint/track/gentle/MerryGoRound.cpp index d61ea2c4b2..52e0cbce90 100644 --- a/src/openrct2/paint/track/gentle/MerryGoRound.cpp +++ b/src/openrct2/paint/track/gentle/MerryGoRound.cpp @@ -63,7 +63,7 @@ static void PaintCarousel( if (rideEntry == nullptr) return; - auto vehicle = getGameState().entities.GetEntity(ride.vehicles[0]); + auto vehicle = getGameState().entities.getEntity(ride.vehicles[0]); if (ride.flags.has(RideFlag::onTrack) && vehicle != nullptr) { session.InteractionType = ViewportInteractionItem::entity; diff --git a/src/openrct2/paint/track/gentle/SpaceRings.cpp b/src/openrct2/paint/track/gentle/SpaceRings.cpp index d24684897e..955e0f3b34 100644 --- a/src/openrct2/paint/track/gentle/SpaceRings.cpp +++ b/src/openrct2/paint/track/gentle/SpaceRings.cpp @@ -50,7 +50,7 @@ static void PaintSpaceRingsStructure( int32_t frameNum = direction; uint32_t baseImageId = rideEntry->Cars[0].baseImageId; - auto vehicle = getGameState().entities.GetEntity(ride.vehicles[vehicleIndex]); + auto vehicle = getGameState().entities.getEntity(ride.vehicles[vehicleIndex]); if (ride.flags.has(RideFlag::onTrack) && vehicle != nullptr) { session.InteractionType = ViewportInteractionItem::entity; @@ -73,7 +73,7 @@ static void PaintSpaceRingsStructure( if (vehicle != nullptr && vehicle->num_peeps > 0) { - auto* rider = getGameState().entities.GetEntity(vehicle->peep[0]); + auto* rider = getGameState().entities.getEntity(vehicle->peep[0]); if (rider != nullptr) { stationColour = ImageId(0, rider->tShirtColour, rider->trousersColour); diff --git a/src/openrct2/paint/track/thrill/3dCinema.cpp b/src/openrct2/paint/track/thrill/3dCinema.cpp index a14f4620f3..9534724ac8 100644 --- a/src/openrct2/paint/track/thrill/3dCinema.cpp +++ b/src/openrct2/paint/track/thrill/3dCinema.cpp @@ -31,7 +31,7 @@ static void Paint3dCinemaDome( if (ride.flags.has(RideFlag::onTrack) && !ride.vehicles[0].IsNull()) { session.InteractionType = ViewportInteractionItem::entity; - session.CurrentlyDrawnEntity = getGameState().entities.GetEntity(ride.vehicles[0]); + session.CurrentlyDrawnEntity = getGameState().entities.getEntity(ride.vehicles[0]); } auto imageTemplate = ImageId(0, ride.vehicleColours[0].Body, ride.vehicleColours[0].Trim); diff --git a/src/openrct2/paint/track/thrill/Enterprise.cpp b/src/openrct2/paint/track/thrill/Enterprise.cpp index 5a60b1be95..4983e467ed 100644 --- a/src/openrct2/paint/track/thrill/Enterprise.cpp +++ b/src/openrct2/paint/track/thrill/Enterprise.cpp @@ -56,7 +56,7 @@ static void PaintEnterpriseStructure( Vehicle* vehicle = nullptr; if (ride.flags.has(RideFlag::onTrack)) { - vehicle = getGameState().entities.GetEntity(ride.vehicles[0]); + vehicle = getGameState().entities.getEntity(ride.vehicles[0]); if (vehicle != nullptr) { session.InteractionType = ViewportInteractionItem::entity; diff --git a/src/openrct2/paint/track/thrill/MagicCarpet.cpp b/src/openrct2/paint/track/thrill/MagicCarpet.cpp index 1d87fdbf7e..d065c6a17b 100644 --- a/src/openrct2/paint/track/thrill/MagicCarpet.cpp +++ b/src/openrct2/paint/track/thrill/MagicCarpet.cpp @@ -93,7 +93,7 @@ static Vehicle* GetFirstVehicle(const Ride& ride) { if (ride.flags.has(RideFlag::onTrack)) { - return getGameState().entities.GetEntity(ride.vehicles[0]); + return getGameState().entities.getEntity(ride.vehicles[0]); } return nullptr; } diff --git a/src/openrct2/paint/track/thrill/MotionSimulator.cpp b/src/openrct2/paint/track/thrill/MotionSimulator.cpp index f978375dbe..30d5ec3d1a 100644 --- a/src/openrct2/paint/track/thrill/MotionSimulator.cpp +++ b/src/openrct2/paint/track/thrill/MotionSimulator.cpp @@ -46,7 +46,7 @@ static void PaintMotionSimulatorVehicle( Vehicle* vehicle = nullptr; if (ride.flags.has(RideFlag::onTrack)) { - vehicle = getGameState().entities.GetEntity(ride.vehicles[0]); + vehicle = getGameState().entities.getEntity(ride.vehicles[0]); if (vehicle != nullptr) { session.InteractionType = ViewportInteractionItem::entity; diff --git a/src/openrct2/paint/track/thrill/SwingingInverterShip.cpp b/src/openrct2/paint/track/thrill/SwingingInverterShip.cpp index 2051c2b7c1..fd42a4a8ac 100644 --- a/src/openrct2/paint/track/thrill/SwingingInverterShip.cpp +++ b/src/openrct2/paint/track/thrill/SwingingInverterShip.cpp @@ -74,7 +74,7 @@ static void PaintSwingingInverterShipStructure( Vehicle* vehicle = nullptr; if (ride.flags.has(RideFlag::onTrack)) { - vehicle = getGameState().entities.GetEntity(ride.vehicles[0]); + vehicle = getGameState().entities.getEntity(ride.vehicles[0]); if (vehicle != nullptr) { session.InteractionType = ViewportInteractionItem::entity; diff --git a/src/openrct2/paint/track/thrill/SwingingShip.cpp b/src/openrct2/paint/track/thrill/SwingingShip.cpp index 0d9d2fad42..0f52863980 100644 --- a/src/openrct2/paint/track/thrill/SwingingShip.cpp +++ b/src/openrct2/paint/track/thrill/SwingingShip.cpp @@ -96,7 +96,7 @@ static void PaintSwingingShipStructure( Vehicle* vehicle = nullptr; if (ride.flags.has(RideFlag::onTrack) && !ride.vehicles[0].IsNull()) { - vehicle = getGameState().entities.GetEntity(ride.vehicles[0]); + vehicle = getGameState().entities.getEntity(ride.vehicles[0]); session.InteractionType = ViewportInteractionItem::entity; session.CurrentlyDrawnEntity = vehicle; } diff --git a/src/openrct2/paint/track/thrill/TopSpin.cpp b/src/openrct2/paint/track/thrill/TopSpin.cpp index 76275806e6..704b61e895 100644 --- a/src/openrct2/paint/track/thrill/TopSpin.cpp +++ b/src/openrct2/paint/track/thrill/TopSpin.cpp @@ -125,7 +125,7 @@ static void PaintTopSpinVehicle( height += 3; uint8_t seatRotation = 0; uint8_t armRotation = 0; - auto* vehicle = getGameState().entities.GetEntity(ride.vehicles[0]); + auto* vehicle = getGameState().entities.getEntity(ride.vehicles[0]); if (ride.flags.has(RideFlag::onTrack) && vehicle != nullptr) { session.InteractionType = ViewportInteractionItem::entity; diff --git a/src/openrct2/paint/track/thrill/Twist.cpp b/src/openrct2/paint/track/thrill/Twist.cpp index 952fa25a61..2887355e70 100644 --- a/src/openrct2/paint/track/thrill/Twist.cpp +++ b/src/openrct2/paint/track/thrill/Twist.cpp @@ -38,7 +38,7 @@ static void PaintTwistStructure( if (ride.flags.has(RideFlag::onTrack) && !ride.vehicles[0].IsNull()) { - vehicle = getGameState().entities.GetEntity(ride.vehicles[0]); + vehicle = getGameState().entities.getEntity(ride.vehicles[0]); session.InteractionType = ViewportInteractionItem::entity; session.CurrentlyDrawnEntity = vehicle; diff --git a/src/openrct2/paint/vehicle/Vehicle.MiniGolf.cpp b/src/openrct2/paint/vehicle/Vehicle.MiniGolf.cpp index 51d4ee224b..e9d843d069 100644 --- a/src/openrct2/paint/vehicle/Vehicle.MiniGolf.cpp +++ b/src/openrct2/paint/vehicle/Vehicle.MiniGolf.cpp @@ -117,7 +117,7 @@ namespace OpenRCT2 if (rideEntry == nullptr) return; - auto* peep = getGameState().entities.GetEntity(vehicle->peep[0]); + auto* peep = getGameState().entities.getEntity(vehicle->peep[0]); if (peep == nullptr) return; diff --git a/src/openrct2/paint/vehicle/Vehicle.ReverserRollerCoaster.cpp b/src/openrct2/paint/vehicle/Vehicle.ReverserRollerCoaster.cpp index 531cd67acf..cbb73cd164 100644 --- a/src/openrct2/paint/vehicle/Vehicle.ReverserRollerCoaster.cpp +++ b/src/openrct2/paint/vehicle/Vehicle.ReverserRollerCoaster.cpp @@ -26,8 +26,8 @@ namespace OpenRCT2 PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle, const CarEntry* carEntry) { - Vehicle* v1 = getGameState().entities.GetEntity(vehicle->prev_vehicle_on_ride); - Vehicle* v2 = getGameState().entities.GetEntity(vehicle->next_vehicle_on_ride); + Vehicle* v1 = getGameState().entities.getEntity(vehicle->prev_vehicle_on_ride); + Vehicle* v2 = getGameState().entities.getEntity(vehicle->next_vehicle_on_ride); if (v1 == nullptr || v2 == nullptr) { return; diff --git a/src/openrct2/paint/vehicle/Vehicle.SplashBoats.cpp b/src/openrct2/paint/vehicle/Vehicle.SplashBoats.cpp index 485c974315..e706c65d2c 100644 --- a/src/openrct2/paint/vehicle/Vehicle.SplashBoats.cpp +++ b/src/openrct2/paint/vehicle/Vehicle.SplashBoats.cpp @@ -38,8 +38,8 @@ namespace OpenRCT2 // TODO: pass as parameter? auto& entityRegistry = getGameState().entities; - auto* vehicleToPaint = vehicle->IsHead() ? entityRegistry.GetEntity(vehicle->next_vehicle_on_ride) - : entityRegistry.GetEntity(vehicle->prev_vehicle_on_ride); + auto* vehicleToPaint = vehicle->IsHead() ? entityRegistry.getEntity(vehicle->next_vehicle_on_ride) + : entityRegistry.getEntity(vehicle->prev_vehicle_on_ride); if (vehicleToPaint == nullptr) { return; diff --git a/src/openrct2/paint/vehicle/VehiclePaint.cpp b/src/openrct2/paint/vehicle/VehiclePaint.cpp index 1b50bef38f..7ff7c0248e 100644 --- a/src/openrct2/paint/vehicle/VehiclePaint.cpp +++ b/src/openrct2/paint/vehicle/VehiclePaint.cpp @@ -4606,7 +4606,7 @@ static void vehicle_visual_splash3_effect(PaintSession& session, const int32_t z */ static void vehicle_visual_splash4_effect(PaintSession& session, const int32_t z, const Vehicle* vehicle) { - Vehicle* vehicle2 = getGameState().entities.GetEntity(vehicle->prev_vehicle_on_ride); + Vehicle* vehicle2 = getGameState().entities.getEntity(vehicle->prev_vehicle_on_ride); if (vehicle2 == nullptr) { return; @@ -4634,7 +4634,7 @@ static void vehicle_visual_splash4_effect(PaintSession& session, const int32_t z */ static void vehicle_visual_splash5_effect(PaintSession& session, const int32_t z, const Vehicle* vehicle) { - Vehicle* vehicle2 = getGameState().entities.GetEntity(vehicle->prev_vehicle_on_ride); + Vehicle* vehicle2 = getGameState().entities.getEntity(vehicle->prev_vehicle_on_ride); if (vehicle2 == nullptr) { return; diff --git a/src/openrct2/park/ParkFile.cpp b/src/openrct2/park/ParkFile.cpp index 248b3f2c17..8aed43f7cd 100644 --- a/src/openrct2/park/ParkFile.cpp +++ b/src/openrct2/park/ParkFile.cpp @@ -2660,7 +2660,7 @@ namespace OpenRCT2 T placeholder{}; auto index = cs.read(); - auto* ent = getGameState().entities.CreateEntityAt(index); + auto* ent = getGameState().entities.createEntityAt(index); if (ent == nullptr) { // Unable to allocate entity @@ -2681,7 +2681,7 @@ namespace OpenRCT2 os.readWriteChunk(ParkFileChunkType::entities, [this, &gameState, &os](OrcaStream::ChunkStream& cs) { if (cs.getMode() == OrcaStream::Mode::reading) { - getGameState().entities.ResetAllEntities(); + getGameState().entities.resetAllEntities(); } std::vector entityIndices; diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index b4a40de13b..dde34e1c9c 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -2793,7 +2793,7 @@ namespace OpenRCT2::RCT1 template<> void S4Importer::ImportEntity<::Vehicle>(GameState_t& gameState, const RCT12EntityBase& srcBase) { - auto* dst = getGameState().entities.CreateEntityAt<::Vehicle>(EntityId::FromUnderlying(srcBase.EntityIndex)); + auto* dst = getGameState().entities.createEntityAt<::Vehicle>(EntityId::FromUnderlying(srcBase.EntityIndex)); auto* src = static_cast(&srcBase); const auto* ride = GetRide(RideId::FromUnderlying(src->Ride)); if (ride == nullptr) @@ -2916,7 +2916,7 @@ namespace OpenRCT2::RCT1 template<> void S4Importer::ImportEntity(GameState_t& gameState, const RCT12EntityBase& srcBase) { - auto* dst = getGameState().entities.CreateEntityAt(EntityId::FromUnderlying(srcBase.EntityIndex)); + auto* dst = getGameState().entities.createEntityAt(EntityId::FromUnderlying(srcBase.EntityIndex)); auto* src = static_cast(&srcBase); ImportPeep(dst, src); @@ -3011,7 +3011,7 @@ namespace OpenRCT2::RCT1 template<> void S4Importer::ImportEntity(GameState_t& gameState, const RCT12EntityBase& srcBase) { - auto* dst = getGameState().entities.CreateEntityAt(EntityId::FromUnderlying(srcBase.EntityIndex)); + auto* dst = getGameState().entities.createEntityAt(EntityId::FromUnderlying(srcBase.EntityIndex)); auto* src = static_cast(&srcBase); ImportPeep(dst, src); dst->assignedStaffType = StaffType(src->StaffType); @@ -3030,7 +3030,7 @@ namespace OpenRCT2::RCT1 template<> void S4Importer::ImportEntity(GameState_t& gameState, const RCT12EntityBase& srcBase) { - auto* dst = getGameState().entities.CreateEntityAt(EntityId::FromUnderlying(srcBase.EntityIndex)); + auto* dst = getGameState().entities.createEntityAt(EntityId::FromUnderlying(srcBase.EntityIndex)); auto* src = static_cast(&srcBase); ImportEntityCommonProperties(dst, src); @@ -3041,7 +3041,7 @@ namespace OpenRCT2::RCT1 template<> void S4Importer::ImportEntity(GameState_t& gameState, const RCT12EntityBase& srcBase) { - auto* dst = getGameState().entities.CreateEntityAt(EntityId::FromUnderlying(srcBase.EntityIndex)); + auto* dst = getGameState().entities.createEntityAt(EntityId::FromUnderlying(srcBase.EntityIndex)); auto* src = static_cast(&srcBase); ImportEntityCommonProperties(dst, src); @@ -3052,7 +3052,7 @@ namespace OpenRCT2::RCT1 template<> void S4Importer::ImportEntity(GameState_t& gameState, const RCT12EntityBase& srcBase) { - auto* dst = getGameState().entities.CreateEntityAt(EntityId::FromUnderlying(srcBase.EntityIndex)); + auto* dst = getGameState().entities.createEntityAt(EntityId::FromUnderlying(srcBase.EntityIndex)); auto* src = static_cast(&srcBase); ImportEntityCommonProperties(dst, src); @@ -3067,7 +3067,7 @@ namespace OpenRCT2::RCT1 template<> void S4Importer::ImportEntity(GameState_t& gameState, const RCT12EntityBase& srcBase) { - auto* dst = getGameState().entities.CreateEntityAt(EntityId::FromUnderlying(srcBase.EntityIndex)); + auto* dst = getGameState().entities.createEntityAt(EntityId::FromUnderlying(srcBase.EntityIndex)); auto* src = static_cast(&srcBase); ImportEntityCommonProperties(dst, src); dst->frame = src->Frame; @@ -3086,7 +3086,7 @@ namespace OpenRCT2::RCT1 template<> void S4Importer::ImportEntity(GameState_t& gameState, const RCT12EntityBase& srcBase) { - auto* dst = getGameState().entities.CreateEntityAt(EntityId::FromUnderlying(srcBase.EntityIndex)); + auto* dst = getGameState().entities.createEntityAt(EntityId::FromUnderlying(srcBase.EntityIndex)); auto* src = static_cast(&srcBase); ImportEntityCommonProperties(dst, src); dst->frame = src->Frame; @@ -3095,7 +3095,7 @@ namespace OpenRCT2::RCT1 template<> void S4Importer::ImportEntity(GameState_t& gameState, const RCT12EntityBase& srcBase) { - auto* dst = getGameState().entities.CreateEntityAt(EntityId::FromUnderlying(srcBase.EntityIndex)); + auto* dst = getGameState().entities.createEntityAt(EntityId::FromUnderlying(srcBase.EntityIndex)); auto* src = static_cast(&srcBase); ImportEntityCommonProperties(dst, src); dst->frame = src->Frame; @@ -3104,7 +3104,7 @@ namespace OpenRCT2::RCT1 template<> void S4Importer::ImportEntity(GameState_t& gameState, const RCT12EntityBase& srcBase) { - auto* dst = getGameState().entities.CreateEntityAt(EntityId::FromUnderlying(srcBase.EntityIndex)); + auto* dst = getGameState().entities.createEntityAt(EntityId::FromUnderlying(srcBase.EntityIndex)); auto* src = static_cast(&srcBase); ImportEntityCommonProperties(dst, src); dst->frame = src->Frame; @@ -3113,7 +3113,7 @@ namespace OpenRCT2::RCT1 template<> void S4Importer::ImportEntity(GameState_t& gameState, const RCT12EntityBase& srcBase) { - auto* dst = getGameState().entities.CreateEntityAt(EntityId::FromUnderlying(srcBase.EntityIndex)); + auto* dst = getGameState().entities.createEntityAt(EntityId::FromUnderlying(srcBase.EntityIndex)); auto* src = static_cast(&srcBase); auto fountainType = JumpingFountainType::water; @@ -3133,7 +3133,7 @@ namespace OpenRCT2::RCT1 template<> void S4Importer::ImportEntity(GameState_t& gameState, const RCT12EntityBase& srcBase) { - auto* dst = getGameState().entities.CreateEntityAt(EntityId::FromUnderlying(srcBase.EntityIndex)); + auto* dst = getGameState().entities.createEntityAt(EntityId::FromUnderlying(srcBase.EntityIndex)); auto* src = static_cast(&srcBase); ImportEntityCommonProperties(dst, src); @@ -3154,7 +3154,7 @@ namespace OpenRCT2::RCT1 template<> void S4Importer::ImportEntity(GameState_t& gameState, const RCT12EntityBase& srcBase) { - auto* dst = getGameState().entities.CreateEntityAt(EntityId::FromUnderlying(srcBase.EntityIndex)); + auto* dst = getGameState().entities.createEntityAt(EntityId::FromUnderlying(srcBase.EntityIndex)); auto* src = static_cast(&srcBase); ImportEntityCommonProperties(dst, src); diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 92f2b66ca8..e40b240b48 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1978,7 +1978,7 @@ namespace OpenRCT2::RCT2 template<> void S6Importer::ImportEntity<::Vehicle>(GameState_t& gameState, const RCT12EntityBase& baseSrc) { - auto dst = getGameState().entities.CreateEntityAt<::Vehicle>(EntityId::FromUnderlying(baseSrc.EntityIndex)); + auto dst = getGameState().entities.createEntityAt<::Vehicle>(EntityId::FromUnderlying(baseSrc.EntityIndex)); auto src = static_cast(&baseSrc); const auto& ride = _s6.Rides[src->Ride]; @@ -2104,7 +2104,7 @@ namespace OpenRCT2::RCT2 template<> void S6Importer::ImportEntity<::Guest>(GameState_t& gameState, const RCT12EntityBase& baseSrc) { - auto dst = getGameState().entities.CreateEntityAt<::Guest>(EntityId::FromUnderlying(baseSrc.EntityIndex)); + auto dst = getGameState().entities.createEntityAt<::Guest>(EntityId::FromUnderlying(baseSrc.EntityIndex)); auto src = static_cast(&baseSrc); ImportEntityPeep(dst, src); @@ -2179,7 +2179,7 @@ namespace OpenRCT2::RCT2 template<> void S6Importer::ImportEntity<::Staff>(GameState_t& gameState, const RCT12EntityBase& baseSrc) { - auto dst = getGameState().entities.CreateEntityAt<::Staff>(EntityId::FromUnderlying(baseSrc.EntityIndex)); + auto dst = getGameState().entities.createEntityAt<::Staff>(EntityId::FromUnderlying(baseSrc.EntityIndex)); auto src = static_cast(&baseSrc); ImportEntityPeep(dst, src); @@ -2200,7 +2200,7 @@ namespace OpenRCT2::RCT2 template<> void S6Importer::ImportEntity<::SteamParticle>(GameState_t& gameState, const RCT12EntityBase& baseSrc) { - auto dst = getGameState().entities.CreateEntityAt<::SteamParticle>(EntityId::FromUnderlying(baseSrc.EntityIndex)); + auto dst = getGameState().entities.createEntityAt<::SteamParticle>(EntityId::FromUnderlying(baseSrc.EntityIndex)); auto src = static_cast(&baseSrc); ImportEntityCommonProperties(dst, src); dst->timeToMove = src->TimeToMove; @@ -2210,7 +2210,7 @@ namespace OpenRCT2::RCT2 template<> void S6Importer::ImportEntity<::MoneyEffect>(GameState_t& gameState, const RCT12EntityBase& baseSrc) { - auto dst = getGameState().entities.CreateEntityAt<::MoneyEffect>(EntityId::FromUnderlying(baseSrc.EntityIndex)); + auto dst = getGameState().entities.createEntityAt<::MoneyEffect>(EntityId::FromUnderlying(baseSrc.EntityIndex)); auto src = static_cast(&baseSrc); ImportEntityCommonProperties(dst, src); dst->moveDelay = src->MoveDelay; @@ -2224,7 +2224,7 @@ namespace OpenRCT2::RCT2 template<> void S6Importer::ImportEntity<::VehicleCrashParticle>(GameState_t& gameState, const RCT12EntityBase& baseSrc) { - auto dst = getGameState().entities.CreateEntityAt<::VehicleCrashParticle>( + auto dst = getGameState().entities.createEntityAt<::VehicleCrashParticle>( EntityId::FromUnderlying(baseSrc.EntityIndex)); auto src = static_cast(&baseSrc); ImportEntityCommonProperties(dst, src); @@ -2245,7 +2245,7 @@ namespace OpenRCT2::RCT2 template<> void S6Importer::ImportEntity<::ExplosionCloud>(GameState_t& gameState, const RCT12EntityBase& baseSrc) { - auto dst = getGameState().entities.CreateEntityAt<::ExplosionCloud>(EntityId::FromUnderlying(baseSrc.EntityIndex)); + auto dst = getGameState().entities.createEntityAt<::ExplosionCloud>(EntityId::FromUnderlying(baseSrc.EntityIndex)); auto src = static_cast(&baseSrc); ImportEntityCommonProperties(dst, src); dst->frame = src->Frame; @@ -2254,7 +2254,7 @@ namespace OpenRCT2::RCT2 template<> void S6Importer::ImportEntity<::ExplosionFlare>(GameState_t& gameState, const RCT12EntityBase& baseSrc) { - auto dst = getGameState().entities.CreateEntityAt<::ExplosionFlare>(EntityId::FromUnderlying(baseSrc.EntityIndex)); + auto dst = getGameState().entities.createEntityAt<::ExplosionFlare>(EntityId::FromUnderlying(baseSrc.EntityIndex)); auto src = static_cast(&baseSrc); ImportEntityCommonProperties(dst, src); dst->frame = src->Frame; @@ -2263,7 +2263,7 @@ namespace OpenRCT2::RCT2 template<> void S6Importer::ImportEntity<::CrashSplashParticle>(GameState_t& gameState, const RCT12EntityBase& baseSrc) { - auto dst = getGameState().entities.CreateEntityAt<::CrashSplashParticle>(EntityId::FromUnderlying(baseSrc.EntityIndex)); + auto dst = getGameState().entities.createEntityAt<::CrashSplashParticle>(EntityId::FromUnderlying(baseSrc.EntityIndex)); auto src = static_cast(&baseSrc); ImportEntityCommonProperties(dst, src); dst->frame = src->Frame; @@ -2272,7 +2272,7 @@ namespace OpenRCT2::RCT2 template<> void S6Importer::ImportEntity<::JumpingFountain>(GameState_t& gameState, const RCT12EntityBase& baseSrc) { - auto dst = getGameState().entities.CreateEntityAt<::JumpingFountain>(EntityId::FromUnderlying(baseSrc.EntityIndex)); + auto dst = getGameState().entities.createEntityAt<::JumpingFountain>(EntityId::FromUnderlying(baseSrc.EntityIndex)); auto src = static_cast(&baseSrc); ImportEntityCommonProperties(dst, src); dst->numTicksAlive = src->NumTicksAlive; @@ -2289,7 +2289,7 @@ namespace OpenRCT2::RCT2 template<> void S6Importer::ImportEntity<::Balloon>(GameState_t& gameState, const RCT12EntityBase& baseSrc) { - auto dst = getGameState().entities.CreateEntityAt<::Balloon>(EntityId::FromUnderlying(baseSrc.EntityIndex)); + auto dst = getGameState().entities.createEntityAt<::Balloon>(EntityId::FromUnderlying(baseSrc.EntityIndex)); auto src = static_cast(&baseSrc); ImportEntityCommonProperties(dst, src); dst->popped = src->Popped; @@ -2301,7 +2301,7 @@ namespace OpenRCT2::RCT2 template<> void S6Importer::ImportEntity<::Duck>(GameState_t& gameState, const RCT12EntityBase& baseSrc) { - auto dst = getGameState().entities.CreateEntityAt<::Duck>(EntityId::FromUnderlying(baseSrc.EntityIndex)); + auto dst = getGameState().entities.createEntityAt<::Duck>(EntityId::FromUnderlying(baseSrc.EntityIndex)); auto src = static_cast(&baseSrc); ImportEntityCommonProperties(dst, src); dst->frame = src->Frame; @@ -2313,7 +2313,7 @@ namespace OpenRCT2::RCT2 template<> void S6Importer::ImportEntity<::Litter>(GameState_t& gameState, const RCT12EntityBase& baseSrc) { - auto dst = getGameState().entities.CreateEntityAt<::Litter>(EntityId::FromUnderlying(baseSrc.EntityIndex)); + auto dst = getGameState().entities.createEntityAt<::Litter>(EntityId::FromUnderlying(baseSrc.EntityIndex)); auto src = static_cast(&baseSrc); ImportEntityCommonProperties(dst, src); dst->subType = ::Litter::Type(src->Type); diff --git a/src/openrct2/ride/CableLift.cpp b/src/openrct2/ride/CableLift.cpp index 79bae839ee..055c68a755 100644 --- a/src/openrct2/ride/CableLift.cpp +++ b/src/openrct2/ride/CableLift.cpp @@ -30,7 +30,7 @@ using namespace OpenRCT2::TrackMetadata; Vehicle* CableLiftSegmentCreate( Ride& ride, int32_t x, int32_t y, int32_t z, int32_t direction, uint16_t var_44, int32_t remaining_distance, bool head) { - Vehicle* current = getGameState().entities.CreateEntity(); + Vehicle* current = getGameState().entities.createEntity(); current->ride = ride.id; current->ride_subtype = kObjectEntryIndexNull; if (head) @@ -161,8 +161,8 @@ void Vehicle::CableLiftUpdateWaitingToDepart() // Next check to see if the second part of the cable lift // is at the front of the passenger vehicle to simulate the // cable being attached underneath the train. - Vehicle* passengerVehicle = getGameState().entities.GetEntity(cable_lift_target); - Vehicle* cableLiftSecondPart = getGameState().entities.GetEntity(prev_vehicle_on_ride); + Vehicle* passengerVehicle = getGameState().entities.getEntity(cable_lift_target); + Vehicle* cableLiftSecondPart = getGameState().entities.getEntity(prev_vehicle_on_ride); if (passengerVehicle == nullptr || cableLiftSecondPart == nullptr) { return; @@ -189,7 +189,7 @@ void Vehicle::CableLiftUpdateDeparting() if (sub_state < 16) return; - Vehicle* passengerVehicle = getGameState().entities.GetEntity(cable_lift_target); + Vehicle* passengerVehicle = getGameState().entities.getEntity(cable_lift_target); if (passengerVehicle == nullptr) { return; @@ -204,7 +204,7 @@ void Vehicle::CableLiftUpdateDeparting() */ void Vehicle::CableLiftUpdateTravelling() { - Vehicle* passengerVehicle = getGameState().entities.GetEntity(cable_lift_target); + Vehicle* passengerVehicle = getGameState().entities.getEntity(cable_lift_target); if (passengerVehicle == nullptr) { return; @@ -421,13 +421,13 @@ int32_t Vehicle::CableLiftUpdateTrackMotion() vehicle->acceleration /= _vehicleSubpositionsMoved; if (_vehicleVelocity >= 0) { - vehicle = getGameState().entities.GetEntity(vehicle->next_vehicle_on_train); + vehicle = getGameState().entities.getEntity(vehicle->next_vehicle_on_train); } else { if (vehicle == this) break; - vehicle = getGameState().entities.GetEntity(vehicle->prev_vehicle_on_ride); + vehicle = getGameState().entities.getEntity(vehicle->prev_vehicle_on_ride); } } @@ -435,8 +435,8 @@ int32_t Vehicle::CableLiftUpdateTrackMotion() uint16_t massTotal = 0; int32_t accelerationTotal = 0; - for (Vehicle* vehicle = getGameState().entities.GetEntity(id); vehicle != nullptr; - vehicle = getGameState().entities.GetEntity(vehicle->next_vehicle_on_train)) + for (Vehicle* vehicle = getGameState().entities.getEntity(id); vehicle != nullptr; + vehicle = getGameState().entities.getEntity(vehicle->next_vehicle_on_train)) { vehicleCount++; diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 7a03762d3b..377e654fba 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -356,7 +356,7 @@ namespace OpenRCT2 Guest* peep; Guest* result = nullptr; auto spriteIndex = getStation(stationIndex).LastPeepInQueue; - while ((peep = getGameState().entities.TryGetEntity(spriteIndex)) != nullptr) + while ((peep = getGameState().entities.tryGetEntity(spriteIndex)) != nullptr) { spriteIndex = peep->guestNextInQueue; result = peep; @@ -370,7 +370,7 @@ namespace OpenRCT2 Guest* peep; auto& station = getStation(stationIndex); auto spriteIndex = station.LastPeepInQueue; - while ((peep = getGameState().entities.TryGetEntity(spriteIndex)) != nullptr) + while ((peep = getGameState().entities.tryGetEntity(spriteIndex)) != nullptr) { spriteIndex = peep->guestNextInQueue; count++; @@ -565,7 +565,7 @@ namespace OpenRCT2 } else if (mode == RideMode::race && !flags.has(RideFlag::passStationNoStopping) && !raceWinner.IsNull()) { - auto peep = getGameState().entities.GetEntity(raceWinner); + auto peep = getGameState().entities.getEntity(raceWinner); if (peep != nullptr) { ft.Add(STR_RACE_WON_BY); @@ -976,7 +976,7 @@ namespace OpenRCT2 { ride.slideInUse = 0; - auto* peep = getGameState().entities.GetEntity(ride.slidePeep); + auto* peep = getGameState().entities.getEntity(ride.slidePeep); if (peep != nullptr) { peep->spiralSlideSubstate = PeepSpiralSlideSubState::finishedSliding; @@ -1280,7 +1280,7 @@ namespace OpenRCT2 ride.brokenCar = ScenarioRand() % ride.numCarsPerTrain; // Set flag on broken car - vehicle = getGameState().entities.GetEntity(ride.vehicles[ride.brokenTrain]); + vehicle = getGameState().entities.getEntity(ride.vehicles[ride.brokenTrain]); if (vehicle != nullptr) { vehicle = vehicle->GetCar(ride.brokenCar); @@ -1297,7 +1297,7 @@ namespace OpenRCT2 ride.brokenCar = 0; // Set flag on broken train, first car - vehicle = getGameState().entities.GetEntity(ride.vehicles[ride.brokenTrain]); + vehicle = getGameState().entities.getEntity(ride.vehicles[ride.brokenTrain]); if (vehicle != nullptr) { vehicle->flags.set(VehicleFlag::trainIsBroken); @@ -1569,7 +1569,7 @@ namespace OpenRCT2 Staff* RideGetMechanic(const Ride& ride) { - auto staff = getGameState().entities.GetEntity(ride.mechanic); + auto staff = getGameState().entities.getEntity(ride.mechanic); if (staff != nullptr && staff->isMechanic()) { return staff; @@ -1655,7 +1655,7 @@ namespace OpenRCT2 */ void CircusMusicUpdate(Ride& ride) { - Vehicle* vehicle = getGameState().entities.GetEntity(ride.vehicles[0]); + Vehicle* vehicle = getGameState().entities.getEntity(ride.vehicles[0]); if (vehicle == nullptr || vehicle->status != Vehicle::Status::doingCircusShow) { ride.musicPosition = 0; @@ -1735,7 +1735,7 @@ namespace OpenRCT2 if (measurement.vehicle_index >= std::size(ride.vehicles)) return; - auto vehicle = getGameState().entities.GetEntity(ride.vehicles[measurement.vehicle_index]); + auto vehicle = getGameState().entities.getEntity(ride.vehicles[measurement.vehicle_index]); if (vehicle == nullptr) return; @@ -1832,7 +1832,7 @@ namespace OpenRCT2 for (int32_t j = 0; j < ride.numTrains; j++) { auto vehicleSpriteIdx = ride.vehicles[j]; - auto vehicle = gameState.entities.GetEntity(vehicleSpriteIdx); + auto vehicle = gameState.entities.getEntity(vehicleSpriteIdx); if (vehicle != nullptr) { if (vehicle->status == Vehicle::Status::departing @@ -2935,8 +2935,8 @@ namespace OpenRCT2 static int32_t count_free_misc_sprite_slots() { auto& gameState = getGameState(); - int32_t miscSpriteCount = gameState.entities.GetMiscEntityCount(); - int32_t remainingSpriteCount = gameState.entities.GetNumFreeEntities(); + int32_t miscSpriteCount = gameState.entities.getMiscEntityCount(); + int32_t remainingSpriteCount = gameState.entities.getNumFreeEntities(); return std::max(0, miscSpriteCount + remainingSpriteCount - 300); } @@ -2978,7 +2978,7 @@ namespace OpenRCT2 auto& carEntry = rideEntry->Cars[carEntryIndex]; - auto* vehicle = getGameState().entities.CreateEntity(); + auto* vehicle = getGameState().entities.createEntity(); if (vehicle == nullptr) return nullptr; @@ -3263,7 +3263,7 @@ namespace OpenRCT2 */ static void RidecreateVehiclesFindFirstBlock(const Ride& ride, CoordsXYE* outXYElement) { - Vehicle* vehicle = getGameState().entities.GetEntity(ride.vehicles[0]); + Vehicle* vehicle = getGameState().entities.getEntity(ride.vehicles[0]); if (vehicle == nullptr) return; @@ -3403,7 +3403,7 @@ namespace OpenRCT2 { for (int32_t i = 0; i < numTrains; i++) { - Vehicle* vehicle = getGameState().entities.GetEntity(vehicles[i]); + Vehicle* vehicle = getGameState().entities.getEntity(vehicles[i]); if (vehicle == nullptr) { continue; @@ -3447,7 +3447,7 @@ namespace OpenRCT2 for (int32_t i = 0; i < numTrains; i++) { - auto train = getGameState().entities.GetEntity(vehicles[i]); + auto train = getGameState().entities.getEntity(vehicles[i]); if (train == nullptr) continue; @@ -3484,7 +3484,7 @@ namespace OpenRCT2 } firstBlock.setBrakeClosed(true); for (Vehicle* car = train; car != nullptr; - car = getGameState().entities.GetEntity(car->next_vehicle_on_train)) + car = getGameState().entities.getEntity(car->next_vehicle_on_train)) { car->velocity = 0; car->acceleration = 0; @@ -3501,7 +3501,7 @@ namespace OpenRCT2 BlockBrakeSetLinkedBrakesClosed(firstBlockPosition, firstBlock, true); } for (Vehicle* car = train; car != nullptr; - car = getGameState().entities.GetEntity(car->next_vehicle_on_train)) + car = getGameState().entities.getEntity(car->next_vehicle_on_train)) { car->flags.unset(VehicleFlag::collisionDisabled); car->SetState(Vehicle::Status::travelling, car->sub_state); @@ -4403,7 +4403,7 @@ namespace OpenRCT2 { for (int32_t i = 0; i < ride.numTrains; i++) { - Vehicle* vehicle = getGameState().entities.GetEntity(ride.vehicles[i]); + Vehicle* vehicle = getGameState().entities.getEntity(ride.vehicles[i]); if (vehicle != nullptr) { vehicle->flags.unset(VehicleFlag::testing); @@ -4431,8 +4431,8 @@ namespace OpenRCT2 { for (int32_t i = 0; i < ride.numTrains; i++) { - for (Vehicle* vehicle = getGameState().entities.GetEntity(ride.vehicles[i]); vehicle != nullptr; - vehicle = getGameState().entities.GetEntity(vehicle->next_vehicle_on_train)) + for (Vehicle* vehicle = getGameState().entities.getEntity(ride.vehicles[i]); vehicle != nullptr; + vehicle = getGameState().entities.getEntity(vehicle->next_vehicle_on_train)) { vehicle->flags.unset( VehicleFlag::stoppedBySafetyCutout, VehicleFlag::carIsBroken, VehicleFlag::trainIsBroken); @@ -4460,8 +4460,8 @@ namespace OpenRCT2 for (int32_t i = 0; i <= Limits::kMaxTrainsPerRide; i++) { int32_t carIndex = 0; - for (Vehicle* vehicle = entities.GetEntity(ride.vehicles[i]); vehicle != nullptr; - vehicle = entities.GetEntity(vehicle->next_vehicle_on_train)) + for (Vehicle* vehicle = entities.getEntity(ride.vehicles[i]); vehicle != nullptr; + vehicle = entities.getEntity(vehicle->next_vehicle_on_train)) { VehicleColour colours = {}; switch (ride.vehicleColourSettings) @@ -5013,7 +5013,7 @@ namespace OpenRCT2 */ void Ride::crash(uint8_t vehicleIndex) { - Vehicle* vehicle = getGameState().entities.GetEntity(vehicles[vehicleIndex]); + Vehicle* vehicle = getGameState().entities.getEntity(vehicles[vehicleIndex]); if (gLegacyScene != LegacyScene::titleSequence && vehicle != nullptr) { @@ -5059,7 +5059,7 @@ namespace OpenRCT2 Vehicle* RideGetBrokenVehicle(const Ride& ride) { auto vehicleIndex = ride.vehicles[ride.brokenTrain]; - Vehicle* vehicle = getGameState().entities.GetEntity(vehicleIndex); + Vehicle* vehicle = getGameState().entities.getEntity(vehicleIndex); if (vehicle != nullptr) { return vehicle->GetCar(ride.brokenCar); @@ -5233,8 +5233,8 @@ namespace OpenRCT2 { for (auto entityIndex : ride.vehicles) { - for (Vehicle* vehicle = getGameState().entities.TryGetEntity(entityIndex); vehicle != nullptr; - vehicle = getGameState().entities.TryGetEntity(vehicle->next_vehicle_on_train)) + for (Vehicle* vehicle = getGameState().entities.tryGetEntity(entityIndex); vehicle != nullptr; + vehicle = getGameState().entities.tryGetEntity(vehicle->next_vehicle_on_train)) { auto carEntry = vehicle->Entry(); if (carEntry == nullptr) diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index 796d6bac3b..53ab9b225a 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -362,14 +362,14 @@ namespace OpenRCT2 auto spriteIndex = ride.cableLift; do { - Vehicle* vehicle = getGameState().entities.GetEntity(spriteIndex); + Vehicle* vehicle = getGameState().entities.getEntity(spriteIndex); if (vehicle == nullptr) { return; } vehicle->invalidate(); spriteIndex = vehicle->next_vehicle_on_train; - getGameState().entities.EntityRemove(vehicle); + getGameState().entities.entityRemove(vehicle); } while (!spriteIndex.IsNull()); } } @@ -389,14 +389,14 @@ namespace OpenRCT2 auto spriteIndex = vehicles[i]; while (!spriteIndex.IsNull()) { - Vehicle* vehicle = getGameState().entities.GetEntity(spriteIndex); + Vehicle* vehicle = getGameState().entities.getEntity(spriteIndex); if (vehicle == nullptr) { break; } vehicle->invalidate(); spriteIndex = vehicle->next_vehicle_on_train; - getGameState().entities.EntityRemove(vehicle); + getGameState().entities.entityRemove(vehicle); } vehicles[i] = EntityId::GetNull(); @@ -411,7 +411,7 @@ namespace OpenRCT2 if (vehicle->ride == id) { vehicle->invalidate(); - getGameState().entities.EntityRemove(vehicle); + getGameState().entities.entityRemove(vehicle); } } } diff --git a/src/openrct2/ride/Station.cpp b/src/openrct2/ride/Station.cpp index d4007c8dc7..db4f5807fb 100644 --- a/src/openrct2/ride/Station.cpp +++ b/src/openrct2/ride/Station.cpp @@ -108,7 +108,7 @@ namespace OpenRCT2 int32_t dh = (dx >> 8) & 0xFF; for (size_t i = 0; i < ride.numTrains; i++) { - Vehicle* vehicle = getGameState().entities.GetEntity(ride.vehicles[i]); + Vehicle* vehicle = getGameState().entities.getEntity(ride.vehicles[i]); if (vehicle == nullptr) continue; @@ -129,7 +129,7 @@ namespace OpenRCT2 // Check if all vehicles are ready to go for (size_t i = 0; i < ride.numTrains; i++) { - Vehicle* vehicle = getGameState().entities.GetEntity(ride.vehicles[i]); + Vehicle* vehicle = getGameState().entities.getEntity(ride.vehicles[i]); if (vehicle == nullptr) continue; @@ -206,7 +206,7 @@ namespace OpenRCT2 for (size_t i = 0; i < ride.numTrains; i++) { - Vehicle* vehicle = getGameState().entities.GetEntity(ride.vehicles[i]); + Vehicle* vehicle = getGameState().entities.getEntity(ride.vehicles[i]); if (vehicle == nullptr) continue; @@ -215,7 +215,7 @@ namespace OpenRCT2 // Found a winner if (vehicle->num_peeps != 0) { - auto* peep = getGameState().entities.GetEntity(vehicle->peep[0]); + auto* peep = getGameState().entities.getEntity(vehicle->peep[0]); if (peep != nullptr) { ride.raceWinner = peep->id; @@ -242,7 +242,7 @@ namespace OpenRCT2 // Check if all vehicles are ready to go for (size_t i = 0; i < ride.numTrains; i++) { - Vehicle* vehicle = getGameState().entities.GetEntity(ride.vehicles[i]); + Vehicle* vehicle = getGameState().entities.getEntity(ride.vehicles[i]); if (vehicle == nullptr) continue; @@ -279,7 +279,7 @@ namespace OpenRCT2 { for (size_t i = 0; i < ride.numTrains; i++) { - Vehicle* vehicle = getGameState().entities.GetEntity(ride.vehicles[i]); + Vehicle* vehicle = getGameState().entities.getEntity(ride.vehicles[i]); if (vehicle == nullptr) continue; @@ -291,7 +291,7 @@ namespace OpenRCT2 if (vehicle->num_peeps != 0) { - auto* guest = getGameState().entities.GetEntity(vehicle->peep[0]); + auto* guest = getGameState().entities.getEntity(vehicle->peep[0]); // Easter egg names should only work on guests if (guest != nullptr) diff --git a/src/openrct2/ride/TrainManager.cpp b/src/openrct2/ride/TrainManager.cpp index 4190cb94c9..66e6a498e5 100644 --- a/src/openrct2/ride/TrainManager.cpp +++ b/src/openrct2/ride/TrainManager.cpp @@ -21,7 +21,7 @@ namespace OpenRCT2::TrainManager while (iter != end && Entity == nullptr) { - Entity = getGameState().entities.GetEntity(*iter++); + Entity = getGameState().entities.getEntity(*iter++); if (Entity != nullptr && !Entity->IsHead()) { Entity = nullptr; @@ -32,6 +32,6 @@ namespace OpenRCT2::TrainManager View::View() { - vec = &getGameState().entities.GetEntityList(EntityType::vehicle); + vec = &getGameState().entities.getEntityList(EntityType::vehicle); } } // namespace OpenRCT2::TrainManager diff --git a/src/openrct2/ride/Vehicle.Collision.cpp b/src/openrct2/ride/Vehicle.Collision.cpp index 46b3c6e0ef..7084496f15 100644 --- a/src/openrct2/ride/Vehicle.Collision.cpp +++ b/src/openrct2/ride/Vehicle.Collision.cpp @@ -68,7 +68,7 @@ bool Vehicle::UpdateMotionCollisionDetection(const CoordsXYZ& loc, EntityId* oth if (otherVehicleIndex == nullptr) return false; - Vehicle* collideVehicle = getGameState().entities.GetEntity(*otherVehicleIndex); + Vehicle* collideVehicle = getGameState().entities.getEntity(*otherVehicleIndex); if (collideVehicle == nullptr) return false; @@ -258,8 +258,8 @@ bool Vehicle::UpdateMotionCollisionDetection(const CoordsXYZ& loc, EntityId* oth */ void Vehicle::ReverseReverserCar() { - Vehicle* previousVehicle = getGameState().entities.GetEntity(prev_vehicle_on_ride); - Vehicle* nextVehicle = getGameState().entities.GetEntity(next_vehicle_on_ride); + Vehicle* previousVehicle = getGameState().entities.getEntity(prev_vehicle_on_ride); + Vehicle* nextVehicle = getGameState().entities.getEntity(next_vehicle_on_ride); if (previousVehicle == nullptr || nextVehicle == nullptr) { return; diff --git a/src/openrct2/ride/Vehicle.Crash.cpp b/src/openrct2/ride/Vehicle.Crash.cpp index 8303865e0e..92c4dc3476 100644 --- a/src/openrct2/ride/Vehicle.Crash.cpp +++ b/src/openrct2/ride/Vehicle.Crash.cpp @@ -112,8 +112,8 @@ void Vehicle::UpdateCollisionSetup() KillAllPassengersInTrain(); Vehicle* lastVehicle = this; - for (Vehicle* train = getGameState().entities.GetEntity(id); train != nullptr; - train = getGameState().entities.GetEntity(train->next_vehicle_on_train)) + for (Vehicle* train = getGameState().entities.getEntity(id); train != nullptr; + train = getGameState().entities.getEntity(train->next_vehicle_on_train)) { lastVehicle = train; @@ -147,8 +147,8 @@ void Vehicle::UpdateCollisionSetup() } // Remove the current train from the ride linked list of trains - auto prevTrain = getGameState().entities.GetEntity(prev_vehicle_on_ride); - auto nextTrain = getGameState().entities.GetEntity(lastVehicle->next_vehicle_on_ride); + auto prevTrain = getGameState().entities.getEntity(prev_vehicle_on_ride); + auto nextTrain = getGameState().entities.getEntity(lastVehicle->next_vehicle_on_ride); if (prevTrain == nullptr || nextTrain == nullptr) { LOG_ERROR("Corrupted vehicle list for ride!"); @@ -187,7 +187,7 @@ void Vehicle::UpdateCrashSetup() auto spriteId = id; for (Vehicle* trainVehicle; !spriteId.IsNull(); spriteId = trainVehicle->next_vehicle_on_train) { - trainVehicle = getGameState().entities.GetEntity(spriteId); + trainVehicle = getGameState().entities.getEntity(spriteId); if (trainVehicle == nullptr) { break; @@ -225,8 +225,8 @@ void Vehicle::UpdateCrashSetup() } // Remove the current train from the ride linked list of trains - auto prevTrain = getGameState().entities.GetEntity(prev_vehicle_on_ride); - auto nextTrain = getGameState().entities.GetEntity(lastVehicle->next_vehicle_on_ride); + auto prevTrain = getGameState().entities.getEntity(prev_vehicle_on_ride); + auto nextTrain = getGameState().entities.getEntity(lastVehicle->next_vehicle_on_ride); if (prevTrain == nullptr || nextTrain == nullptr) { LOG_ERROR("Corrupted vehicle list for ride!"); @@ -321,8 +321,8 @@ void Vehicle::KillAllPassengersInTrain() ride_train_crash(*curRide, NumPeepsUntilTrainTail()); - for (Vehicle* trainCar = getGameState().entities.GetEntity(id); trainCar != nullptr; - trainCar = getGameState().entities.GetEntity(trainCar->next_vehicle_on_train)) + for (Vehicle* trainCar = getGameState().entities.getEntity(id); trainCar != nullptr; + trainCar = getGameState().entities.getEntity(trainCar->next_vehicle_on_train)) { trainCar->KillPassengers(*curRide); } @@ -338,7 +338,7 @@ void Vehicle::KillPassengers(const Ride& curRide) for (auto i = 0; i < num_peeps; i++) { - auto* curPeep = getGameState().entities.GetEntity(peep[i]); + auto* curPeep = getGameState().entities.getEntity(peep[i]); if (curPeep == nullptr) continue; @@ -498,8 +498,8 @@ void Vehicle::CrashOnWater() */ void Vehicle::UpdateCrash() { - for (Vehicle* curVehicle = getGameState().entities.GetEntity(id); curVehicle != nullptr; - curVehicle = getGameState().entities.GetEntity(curVehicle->next_vehicle_on_train)) + for (Vehicle* curVehicle = getGameState().entities.getEntity(id); curVehicle != nullptr; + curVehicle = getGameState().entities.getEntity(curVehicle->next_vehicle_on_train)) { CoordsXYZ curPos = curVehicle->getLocation(); diff --git a/src/openrct2/ride/Vehicle.Dodgems.cpp b/src/openrct2/ride/Vehicle.Dodgems.cpp index 31ac71a3b9..9ed876635f 100644 --- a/src/openrct2/ride/Vehicle.Dodgems.cpp +++ b/src/openrct2/ride/Vehicle.Dodgems.cpp @@ -217,7 +217,7 @@ int32_t Vehicle::UpdateMotionDodgems() velocity = 0; uint8_t direction = orientation | 1; - Vehicle* collideVehicle = getGameState().entities.GetEntity(collideSprite.value()); + Vehicle* collideVehicle = getGameState().entities.getEntity(collideSprite.value()); if (collideVehicle != nullptr) { var_34 = (ScenarioRand() & 1) ? 1 : -1; diff --git a/src/openrct2/ride/Vehicle.MiniGolf.cpp b/src/openrct2/ride/Vehicle.MiniGolf.cpp index 80e8c1fc31..472cf77543 100644 --- a/src/openrct2/ride/Vehicle.MiniGolf.cpp +++ b/src/openrct2/ride/Vehicle.MiniGolf.cpp @@ -89,7 +89,7 @@ void OpenRCT2::RideUpdateMeasurementsSpecialElements_MiniGolf(Ride& ride, const if (miniGolfFlags.has(MiniGolfFlag::flag0)) { auto vehicleIdx = IsHead() ? next_vehicle_on_ride : prev_vehicle_on_ride; - Vehicle* vEDI = getGameState().entities.GetEntity(vehicleIdx); + Vehicle* vEDI = getGameState().entities.getEntity(vehicleIdx); if (vEDI == nullptr) { return UpdateMiniGolfSubroutineStatus::stop; @@ -135,7 +135,7 @@ void OpenRCT2::RideUpdateMeasurementsSpecialElements_MiniGolf(Ride& ride, const if (miniGolfFlags.has(MiniGolfFlag::flag1)) { auto vehicleIdx = IsHead() ? next_vehicle_on_ride : prev_vehicle_on_ride; - Vehicle* vEDI = getGameState().entities.GetEntity(vehicleIdx); + Vehicle* vEDI = getGameState().entities.getEntity(vehicleIdx); if (vEDI == nullptr) { return UpdateMiniGolfSubroutineStatus::stop; @@ -184,7 +184,7 @@ void OpenRCT2::RideUpdateMeasurementsSpecialElements_MiniGolf(Ride& ride, const for (;;) { - vEDI = getGameState().entities.GetEntity(vEDI->prev_vehicle_on_ride); + vEDI = getGameState().entities.getEntity(vEDI->prev_vehicle_on_ride); if (vEDI == this || vEDI == nullptr) { break; @@ -271,7 +271,7 @@ void OpenRCT2::RideUpdateMeasurementsSpecialElements_MiniGolf(Ride& ride, const if (!IsHead()) { - Vehicle* prevVehicle = getGameState().entities.GetEntity(prev_vehicle_on_ride); + Vehicle* prevVehicle = getGameState().entities.getEntity(prev_vehicle_on_ride); if (prevVehicle != nullptr) { TrackSubposition = prevVehicle->TrackSubposition; @@ -353,7 +353,7 @@ void OpenRCT2::RideUpdateMeasurementsSpecialElements_MiniGolf(Ride& ride, const // When the ride is closed occasionally the peep is removed // but the vehicle is still on the track. This will prevent // it from crashing in that situation. - auto* curPeep = getGameState().entities.TryGetEntity(peep[0]); + auto* curPeep = getGameState().entities.tryGetEntity(peep[0]); if (curPeep != nullptr) { if (animation == MiniGolfAnimation::swingLeft) @@ -507,7 +507,7 @@ void OpenRCT2::RideUpdateMeasurementsSpecialElements_MiniGolf(Ride& ride, const _vehicleRemainingDistance -= remaining_distance - 0x368A; remaining_distance = 0x368A; { - Vehicle* vEBP = getGameState().entities.GetEntity(otherVehicleIndex); + Vehicle* vEBP = getGameState().entities.getEntity(otherVehicleIndex); if (vEBP == nullptr) { return UpdateMiniGolfSubroutineStatus::stop; @@ -644,7 +644,7 @@ int32_t Vehicle::UpdateTrackMotionMiniGolfCalculateAcceleration(const CarEntry& uint16_t totalMass = 0; for (Vehicle* vehicle = this; vehicle != nullptr; - vehicle = getGameState().entities.GetEntity(vehicle->next_vehicle_on_train)) + vehicle = getGameState().entities.getEntity(vehicle->next_vehicle_on_train)) { numVehicles++; totalMass += vehicle->mass; @@ -711,7 +711,7 @@ int32_t Vehicle::UpdateTrackMotionMiniGolf(int32_t* outStation) } if (_vehicleVelocity >= 0) { - vehicle = getGameState().entities.GetEntity(vehicle->next_vehicle_on_train); + vehicle = getGameState().entities.getEntity(vehicle->next_vehicle_on_train); } else { @@ -719,7 +719,7 @@ int32_t Vehicle::UpdateTrackMotionMiniGolf(int32_t* outStation) { break; } - vehicle = getGameState().entities.GetEntity(vehicle->prev_vehicle_on_ride); + vehicle = getGameState().entities.getEntity(vehicle->prev_vehicle_on_ride); } } diff --git a/src/openrct2/ride/Vehicle.Sound.cpp b/src/openrct2/ride/Vehicle.Sound.cpp index dbbcc30be6..6e85ae197c 100644 --- a/src/openrct2/ride/Vehicle.Sound.cpp +++ b/src/openrct2/ride/Vehicle.Sound.cpp @@ -212,8 +212,8 @@ namespace OpenRCT2 if (velocity > -2.75_mph) return SoundId::null; - for (Vehicle* vehicle2 = getGameState().entities.GetEntity(id); vehicle2 != nullptr; - vehicle2 = getGameState().entities.GetEntity(vehicle2->next_vehicle_on_train)) + for (Vehicle* vehicle2 = getGameState().entities.getEntity(id); vehicle2 != nullptr; + vehicle2 = getGameState().entities.getEntity(vehicle2->next_vehicle_on_train)) { if (vehicle2->pitch < VehiclePitch::up12) continue; @@ -234,8 +234,8 @@ namespace OpenRCT2 if (velocity < 2.75_mph) return SoundId::null; - for (Vehicle* vehicle2 = getGameState().entities.GetEntity(id); vehicle2 != nullptr; - vehicle2 = getGameState().entities.GetEntity(vehicle2->next_vehicle_on_train)) + for (Vehicle* vehicle2 = getGameState().entities.getEntity(id); vehicle2 != nullptr; + vehicle2 = getGameState().entities.getEntity(vehicle2->next_vehicle_on_train)) { if (vehicle2->pitch < VehiclePitch::down12) continue; diff --git a/src/openrct2/ride/Vehicle.Station.cpp b/src/openrct2/ride/Vehicle.Station.cpp index 968cd1b08a..eff5f03dea 100644 --- a/src/openrct2/ride/Vehicle.Station.cpp +++ b/src/openrct2/ride/Vehicle.Station.cpp @@ -102,7 +102,7 @@ static bool try_add_synchronised_station(const CoordsXYZ& coords) // Look for a vehicle on this station waiting to depart. for (int32_t i = 0; i < ride->numTrains; i++) { - auto* vehicle = getGameState().entities.GetEntity(ride->vehicles[i]); + auto* vehicle = getGameState().entities.getEntity(ride->vehicles[i]); if (vehicle == nullptr) { continue; @@ -240,7 +240,7 @@ static bool ride_station_can_depart_synchronised(const Ride& ride, StationIndex { for (int32_t i = 0; i < curRide->numTrains; i++) { - Vehicle* v = getGameState().entities.GetEntity(curRide->vehicles[i]); + Vehicle* v = getGameState().entities.getEntity(curRide->vehicles[i]); if (v == nullptr) { continue; @@ -278,7 +278,7 @@ static bool ride_station_can_depart_synchronised(const Ride& ride, StationIndex auto currentStation = sv->stationIndex; for (int32_t i = 0; i < sv_ride->numTrains; i++) { - auto* otherVehicle = getGameState().entities.GetEntity(sv_ride->vehicles[i]); + auto* otherVehicle = getGameState().entities.getEntity(sv_ride->vehicles[i]); if (otherVehicle == nullptr) { continue; @@ -322,7 +322,7 @@ static bool ride_station_can_depart_synchronised(const Ride& ride, StationIndex // At this point all vehicles in _snychronisedVehicles can depart. for (SynchronisedVehicle* sv = _synchronisedVehicles; sv < _lastSynchronisedVehicle; sv++) { - auto v = getGameState().entities.GetEntity(sv->vehicle_id); + auto v = getGameState().entities.getEntity(sv->vehicle_id); if (v != nullptr) { v->flags.unset(VehicleFlag::waitingOnAdjacentStation); @@ -559,8 +559,8 @@ void Vehicle::UpdateWaitingForPassengers() // 0xF64E31, 0xF64E32, 0xF64E33 uint8_t num_peeps_on_train = 0, num_used_seats_on_train = 0, num_seats_on_train = 0; - for (const Vehicle* trainCar = getGameState().entities.GetEntity(id); trainCar != nullptr; - trainCar = getGameState().entities.GetEntity(trainCar->next_vehicle_on_train)) + for (const Vehicle* trainCar = getGameState().entities.getEntity(id); trainCar != nullptr; + trainCar = getGameState().entities.getEntity(trainCar->next_vehicle_on_train)) { num_peeps_on_train += trainCar->num_peeps; num_used_seats_on_train += trainCar->next_free_seat; @@ -614,7 +614,7 @@ void Vehicle::UpdateWaitingForPassengers() if (train_id == id) continue; - Vehicle* train = getGameState().entities.GetEntity(train_id); + Vehicle* train = getGameState().entities.getEntity(train_id); if (train == nullptr) continue; @@ -729,8 +729,8 @@ void Vehicle::UpdateWaitingToDepart() } else { - for (const Vehicle* trainCar = getGameState().entities.GetEntity(id); trainCar != nullptr; - trainCar = getGameState().entities.GetEntity(trainCar->next_vehicle_on_train)) + for (const Vehicle* trainCar = getGameState().entities.getEntity(id); trainCar != nullptr; + trainCar = getGameState().entities.getEntity(trainCar->next_vehicle_on_train)) { if (trainCar->num_peeps != 0) { @@ -929,7 +929,7 @@ void Vehicle::UpdateUnloadingPassengers() { next_free_seat -= 2; - auto firstGuest = getGameState().entities.GetEntity(peep[seat * 2]); + auto firstGuest = getGameState().entities.getEntity(peep[seat * 2]); peep[seat * 2] = EntityId::GetNull(); if (firstGuest != nullptr) @@ -938,7 +938,7 @@ void Vehicle::UpdateUnloadingPassengers() firstGuest->rideSubState = PeepRideSubState::leaveVehicle; } - auto secondGuest = getGameState().entities.GetEntity(peep[seat * 2 + 1]); + auto secondGuest = getGameState().entities.getEntity(peep[seat * 2 + 1]); peep[seat * 2 + 1] = EntityId::GetNull(); if (secondGuest != nullptr) @@ -964,8 +964,8 @@ void Vehicle::UpdateUnloadingPassengers() return; } - for (Vehicle* train = getGameState().entities.GetEntity(id); train != nullptr; - train = getGameState().entities.GetEntity(train->next_vehicle_on_train)) + for (Vehicle* train = getGameState().entities.getEntity(id); train != nullptr; + train = getGameState().entities.getEntity(train->next_vehicle_on_train)) { if (train->restraints_position != 255) continue; @@ -976,7 +976,7 @@ void Vehicle::UpdateUnloadingPassengers() train->next_free_seat = 0; for (uint8_t peepIndex = 0; peepIndex < train->num_peeps; peepIndex++) { - Peep* curPeep = getGameState().entities.GetEntity(train->peep[peepIndex]); + Peep* curPeep = getGameState().entities.getEntity(train->peep[peepIndex]); if (curPeep != nullptr) { curPeep->setState(PeepState::leavingRide); @@ -989,8 +989,8 @@ void Vehicle::UpdateUnloadingPassengers() if (sub_state != 1) return; - for (Vehicle* train = getGameState().entities.GetEntity(id); train != nullptr; - train = getGameState().entities.GetEntity(train->next_vehicle_on_train)) + for (Vehicle* train = getGameState().entities.getEntity(id); train != nullptr; + train = getGameState().entities.getEntity(train->next_vehicle_on_train)) { if (train->num_peeps != train->next_free_seat) return; diff --git a/src/openrct2/ride/Vehicle.TrackMotion.cpp b/src/openrct2/ride/Vehicle.TrackMotion.cpp index 7ee44fca1a..43b481dee8 100644 --- a/src/openrct2/ride/Vehicle.TrackMotion.cpp +++ b/src/openrct2/ride/Vehicle.TrackMotion.cpp @@ -373,11 +373,11 @@ namespace OpenRCT2 { if (IsOnCoveredTrack()) { - Vehicle* nextVehicle = getGameState().entities.GetEntity(next_vehicle_on_ride); + Vehicle* nextVehicle = getGameState().entities.getEntity(next_vehicle_on_ride); if (nextVehicle == nullptr) return; - Vehicle* nextNextVehicle = getGameState().entities.GetEntity( + Vehicle* nextNextVehicle = getGameState().entities.getEntity( nextVehicle->next_vehicle_on_ride); if (nextNextVehicle == nullptr) return; @@ -933,7 +933,7 @@ namespace OpenRCT2 remaining_distance = -1; // Might need to be bp rather than this, but hopefully not - auto otherVeh = getGameState().entities.GetEntity(otherVehicleIndex); + auto otherVeh = getGameState().entities.getEntity(otherVehicleIndex); if (otherVeh == nullptr) { // This can never happen as prev_vehicle_on_ride will always be set to a vehicle @@ -1229,7 +1229,7 @@ namespace OpenRCT2 _vehicleRemainingDistance -= remaining_distance - 0x368A; remaining_distance = 0x368A; - Vehicle* v3 = getGameState().entities.GetEntity(otherVehicleIndex); + Vehicle* v3 = getGameState().entities.getEntity(otherVehicleIndex); Vehicle* v4 = gCurrentVehicle; if (v3 == nullptr) { @@ -1494,7 +1494,7 @@ namespace OpenRCT2 auto spriteId = vehicle->id; while (!spriteId.IsNull()) { - Vehicle* car = getGameState().entities.GetEntity(spriteId); + Vehicle* car = getGameState().entities.getEntity(spriteId); if (car == nullptr) { break; @@ -1542,7 +1542,7 @@ namespace OpenRCT2 // ebx int32_t numVehicles = 0; - for (; vehicle != nullptr; vehicle = getGameState().entities.GetEntity(vehicle->next_vehicle_on_train)) + for (; vehicle != nullptr; vehicle = getGameState().entities.getEntity(vehicle->next_vehicle_on_train)) { numVehicles++; totalMass += vehicle->mass; diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index db6789a85d..95a9dcf2df 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -218,7 +218,7 @@ namespace OpenRCT2 Vehicle* TryGetVehicle(EntityId spriteIndex) { - return getGameState().entities.TryGetEntity(spriteIndex); + return getGameState().entities.tryGetEntity(spriteIndex); } /** @@ -253,8 +253,8 @@ namespace OpenRCT2 return true; bool restraintsClosed = true; - for (Vehicle* vehicle = getGameState().entities.GetEntity(id); vehicle != nullptr; - vehicle = getGameState().entities.GetEntity(vehicle->next_vehicle_on_train)) + for (Vehicle* vehicle = getGameState().entities.getEntity(id); vehicle != nullptr; + vehicle = getGameState().entities.getEntity(vehicle->next_vehicle_on_train)) { if (vehicle->flags.has(VehicleFlag::carIsBroken) && vehicle->restraints_position != 0 && (curRide->breakdownReasonPending == Breakdown::restraintsStuckOpen @@ -271,7 +271,7 @@ namespace OpenRCT2 curRide->mechanicStatus = MechanicStatus::calling; - Vehicle* broken_vehicle = getGameState().entities.GetEntity( + Vehicle* broken_vehicle = getGameState().entities.getEntity( curRide->vehicles[curRide->brokenTrain]); if (broken_vehicle != nullptr) { @@ -303,8 +303,8 @@ namespace OpenRCT2 bool Vehicle::OpenRestraints() { int32_t restraintsOpen = true; - for (Vehicle* vehicle = getGameState().entities.GetEntity(id); vehicle != nullptr; - vehicle = getGameState().entities.GetEntity(vehicle->next_vehicle_on_train)) + for (Vehicle* vehicle = getGameState().entities.getEntity(id); vehicle != nullptr; + vehicle = getGameState().entities.getEntity(vehicle->next_vehicle_on_train)) { vehicle->SwingPosition = 0; vehicle->SwingSpeed = 0; @@ -389,7 +389,7 @@ namespace OpenRCT2 curRide->mechanicStatus = MechanicStatus::calling; - Vehicle* broken_vehicle = getGameState().entities.GetEntity( + Vehicle* broken_vehicle = getGameState().entities.getEntity( curRide->vehicles[curRide->brokenTrain]); if (broken_vehicle != nullptr) { @@ -892,12 +892,12 @@ namespace OpenRCT2 */ void Vehicle::PeepEasterEggHereWeAre() const { - for (Vehicle* vehicle = getGameState().entities.GetEntity(id); vehicle != nullptr; - vehicle = getGameState().entities.GetEntity(vehicle->next_vehicle_on_train)) + for (Vehicle* vehicle = getGameState().entities.getEntity(id); vehicle != nullptr; + vehicle = getGameState().entities.getEntity(vehicle->next_vehicle_on_train)) { for (int32_t i = 0; i < vehicle->num_peeps; ++i) { - auto* curPeep = getGameState().entities.GetEntity(vehicle->peep[i]); + auto* curPeep = getGameState().entities.getEntity(vehicle->peep[i]); if (curPeep != nullptr && curPeep->peepFlags.has(PeepFlag::hereWeAre)) { curPeep->insertNewThought(PeepThoughtType::hereWeAre, curPeep->currentRide); @@ -1048,7 +1048,7 @@ namespace OpenRCT2 if (curRide == nullptr) return; - Vehicle* cableLift = getGameState().entities.GetEntity(curRide->cableLift); + Vehicle* cableLift = getGameState().entities.getEntity(curRide->cableLift); if (cableLift == nullptr) return; @@ -1217,7 +1217,7 @@ namespace OpenRCT2 for (;;) { - prevVehicle = getGameState().entities.GetEntity(vehicle->prev_vehicle_on_ride); + prevVehicle = getGameState().entities.getEntity(vehicle->prev_vehicle_on_ride); if (prevVehicle == nullptr) return nullptr; if (prevVehicle->next_vehicle_on_train.IsNull()) @@ -1236,7 +1236,7 @@ namespace OpenRCT2 EntityId spriteIndex = vehicle->next_vehicle_on_train; while (!spriteIndex.IsNull()) { - vehicle = getGameState().entities.GetEntity(spriteIndex); + vehicle = getGameState().entities.getEntity(spriteIndex); if (vehicle == nullptr) { return const_cast(this); @@ -1280,8 +1280,8 @@ namespace OpenRCT2 int32_t Vehicle::NumPeepsUntilTrainTail() const { int32_t numPeeps = 0; - for (const Vehicle* vehicle = getGameState().entities.GetEntity(id); vehicle != nullptr; - vehicle = getGameState().entities.GetEntity(vehicle->next_vehicle_on_train)) + for (const Vehicle* vehicle = getGameState().entities.getEntity(id); vehicle != nullptr; + vehicle = getGameState().entities.getEntity(vehicle->next_vehicle_on_train)) { numPeeps += vehicle->num_peeps; } @@ -1445,7 +1445,7 @@ namespace OpenRCT2 auto v = this; while (v != nullptr && !v->IsHead()) { - v = getGameState().entities.GetEntity(v->prev_vehicle_on_ride); + v = getGameState().entities.getEntity(v->prev_vehicle_on_ride); } return v; } @@ -1460,7 +1460,7 @@ namespace OpenRCT2 auto car = const_cast(this); for (; carIndex != 0; carIndex--) { - car = getGameState().entities.GetEntity(car->next_vehicle_on_train); + car = getGameState().entities.getEntity(car->next_vehicle_on_train); if (car == nullptr) { LOG_ERROR("Tried to get non-existent car from index!"); @@ -1487,7 +1487,7 @@ namespace OpenRCT2 { assert(this->IsHead()); for (auto vehicle = this; vehicle != nullptr; - vehicle = getGameState().entities.GetEntity(vehicle->next_vehicle_on_train)) + vehicle = getGameState().entities.getEntity(vehicle->next_vehicle_on_train)) { vehicle->flags.unset(VehicleFlag::collisionDisabled); } diff --git a/src/openrct2/ride/VehicleRiderControl.cpp b/src/openrct2/ride/VehicleRiderControl.cpp index 5c77db3aba..7a35b75885 100644 --- a/src/openrct2/ride/VehicleRiderControl.cpp +++ b/src/openrct2/ride/VehicleRiderControl.cpp @@ -137,7 +137,7 @@ int32_t Vehicle::CalculateRiderBraking() const RiderControlSettings riderSettings = riderTable[peep[0].ToUnderlying() & 0xFF]; // Brake if close to the vehicle in front - Vehicle* prevVehicle = getGameState().entities.GetEntity(prev_vehicle_on_ride); + Vehicle* prevVehicle = getGameState().entities.getEntity(prev_vehicle_on_ride); if (prevVehicle != nullptr && this != prevVehicle && _vehicleVelocity > minFollowVelocity) { int32_t followDistance = std::max(minFollowDistance, (riderSettings.followDistance * _vehicleVelocity) >> 15); diff --git a/src/openrct2/scenes/editor/EditorScene.cpp b/src/openrct2/scenes/editor/EditorScene.cpp index 3c31f671e0..42ee763e0d 100644 --- a/src/openrct2/scenes/editor/EditorScene.cpp +++ b/src/openrct2/scenes/editor/EditorScene.cpp @@ -186,7 +186,7 @@ void EditorScene::clearMapForEditing() } auto& gameState = getGameState(); - gameState.entities.ResetAllEntities(); + gameState.entities.resetAllEntities(); UpdateConsolidatedPatrolAreas(); diff --git a/src/openrct2/scripting/bindings/entity/ScBalloon.cpp b/src/openrct2/scripting/bindings/entity/ScBalloon.cpp index fdaacad64b..48c7aaf58a 100644 --- a/src/openrct2/scripting/bindings/entity/ScBalloon.cpp +++ b/src/openrct2/scripting/bindings/entity/ScBalloon.cpp @@ -33,7 +33,7 @@ namespace OpenRCT2::Scripting Balloon* ScBalloon::GetBalloon(JSValue thisVal) { auto id = GetEntityId(thisVal); - return getGameState().entities.GetEntity(id); + return getGameState().entities.getEntity(id); } JSValue ScBalloon::colour_get(JSContext* ctx, JSValue thisVal) diff --git a/src/openrct2/scripting/bindings/entity/ScEntity.cpp b/src/openrct2/scripting/bindings/entity/ScEntity.cpp index 9defeca698..dd669b799a 100644 --- a/src/openrct2/scripting/bindings/entity/ScEntity.cpp +++ b/src/openrct2/scripting/bindings/entity/ScEntity.cpp @@ -172,7 +172,7 @@ namespace OpenRCT2::Scripting case EntityType::balloon: case EntityType::duck: case EntityType::litter: - getGameState().entities.EntityRemove(entity); + getGameState().entities.entityRemove(entity); break; case EntityType::null: break; @@ -191,7 +191,7 @@ namespace OpenRCT2::Scripting EntityBase* ScEntity::GetEntity(JSValue thisVal) { auto id = GetEntityId(thisVal); - return OpenRCT2::getGameState().entities.GetEntity(id); + return OpenRCT2::getGameState().entities.getEntity(id); } JSValue ScEntity::NewInstance(JSContext* ctx, EntityId entityId) diff --git a/src/openrct2/scripting/bindings/entity/ScGuest.cpp b/src/openrct2/scripting/bindings/entity/ScGuest.cpp index c1eb666ec9..f8e00c8913 100644 --- a/src/openrct2/scripting/bindings/entity/ScGuest.cpp +++ b/src/openrct2/scripting/bindings/entity/ScGuest.cpp @@ -201,7 +201,7 @@ namespace OpenRCT2::Scripting Guest* ScGuest::GetGuest(JSValue thisVal) { auto id = GetEntityId(thisVal); - return getGameState().entities.GetEntity(id); + return getGameState().entities.getEntity(id); } JSValue ScGuest::tshirtColour_get(JSContext* ctx, JSValue thisVal) diff --git a/src/openrct2/scripting/bindings/entity/ScLitter.cpp b/src/openrct2/scripting/bindings/entity/ScLitter.cpp index 5d358a3cea..3541593fe4 100644 --- a/src/openrct2/scripting/bindings/entity/ScLitter.cpp +++ b/src/openrct2/scripting/bindings/entity/ScLitter.cpp @@ -52,7 +52,7 @@ namespace OpenRCT2::Scripting Litter* ScLitter::GetLitter(JSValue thisVal) { auto id = GetEntityId(thisVal); - return getGameState().entities.GetEntity(id); + return getGameState().entities.getEntity(id); } JSValue ScLitter::litterType_get(JSContext* ctx, JSValue thisVal) diff --git a/src/openrct2/scripting/bindings/entity/ScMoneyEffect.cpp b/src/openrct2/scripting/bindings/entity/ScMoneyEffect.cpp index ac2c4154e5..b0997e5e03 100644 --- a/src/openrct2/scripting/bindings/entity/ScMoneyEffect.cpp +++ b/src/openrct2/scripting/bindings/entity/ScMoneyEffect.cpp @@ -33,7 +33,7 @@ namespace OpenRCT2::Scripting MoneyEffect* ScMoneyEffect::GetMoneyEffect(JSValue thisVal) { auto id = GetEntityId(thisVal); - return getGameState().entities.GetEntity(id); + return getGameState().entities.getEntity(id); } JSValue ScMoneyEffect::value_get(JSContext* ctx, JSValue thisVal) diff --git a/src/openrct2/scripting/bindings/entity/ScParticle.cpp b/src/openrct2/scripting/bindings/entity/ScParticle.cpp index ff6e7a84a8..fdfb803650 100644 --- a/src/openrct2/scripting/bindings/entity/ScParticle.cpp +++ b/src/openrct2/scripting/bindings/entity/ScParticle.cpp @@ -54,7 +54,7 @@ namespace OpenRCT2::Scripting VehicleCrashParticle* ScCrashedVehicleParticle::GetCrashedVehicleParticle(JSValue thisVal) { auto id = GetEntityId(thisVal); - return getGameState().entities.GetEntity(id); + return getGameState().entities.getEntity(id); } JSValue ScCrashedVehicleParticle::frame_set(JSContext* ctx, JSValue thisVal, JSValue jsValue) diff --git a/src/openrct2/scripting/bindings/entity/ScPeep.hpp b/src/openrct2/scripting/bindings/entity/ScPeep.hpp index 716951436d..eb42b0064d 100644 --- a/src/openrct2/scripting/bindings/entity/ScPeep.hpp +++ b/src/openrct2/scripting/bindings/entity/ScPeep.hpp @@ -198,7 +198,7 @@ namespace OpenRCT2::Scripting static Peep* GetPeep(JSValue thisVal) { auto id = GetEntityId(thisVal); - return getGameState().entities.GetEntity(id); + return getGameState().entities.getEntity(id); } }; diff --git a/src/openrct2/scripting/bindings/entity/ScStaff.cpp b/src/openrct2/scripting/bindings/entity/ScStaff.cpp index 7e2f8ab325..dad7587357 100644 --- a/src/openrct2/scripting/bindings/entity/ScStaff.cpp +++ b/src/openrct2/scripting/bindings/entity/ScStaff.cpp @@ -51,7 +51,7 @@ namespace OpenRCT2::Scripting Staff* ScStaff::GetStaff(JSValue thisVal) { auto id = GetEntityId(thisVal); - return getGameState().entities.GetEntity(id); + return getGameState().entities.getEntity(id); } JSValue ScStaff::staffType_get(JSContext* ctx, JSValue thisVal) @@ -606,7 +606,7 @@ namespace OpenRCT2::Scripting Staff* ScPatrolArea::GetStaff(JSValue thisVal) { OpaquePatrolAreaData* data = gScPatrolArea.GetOpaque(thisVal); - return getGameState().entities.GetEntity(data->staffId); + return getGameState().entities.getEntity(data->staffId); } void ScPatrolArea::ModifyArea(JSContext* ctx, JSValue thisVal, JSValue coordsOrRange, bool reset) diff --git a/src/openrct2/scripting/bindings/entity/ScVehicle.cpp b/src/openrct2/scripting/bindings/entity/ScVehicle.cpp index bc09dc8b8c..6d8271f136 100644 --- a/src/openrct2/scripting/bindings/entity/ScVehicle.cpp +++ b/src/openrct2/scripting/bindings/entity/ScVehicle.cpp @@ -110,7 +110,7 @@ namespace OpenRCT2::Scripting Vehicle* ScVehicle::GetVehicle(JSValue thisVal) { auto id = GetEntityId(thisVal); - return getGameState().entities.GetEntity(id); + return getGameState().entities.getEntity(id); } JSValue ScVehicle::rideObject_get(JSContext* ctx, JSValue thisVal) diff --git a/src/openrct2/scripting/bindings/world/ScMap.cpp b/src/openrct2/scripting/bindings/world/ScMap.cpp index d4903c5be6..42d3a408e4 100644 --- a/src/openrct2/scripting/bindings/world/ScMap.cpp +++ b/src/openrct2/scripting/bindings/world/ScMap.cpp @@ -95,7 +95,7 @@ namespace OpenRCT2::Scripting if (id >= 0 && id < kMaxEntities) { auto spriteId = EntityId::FromUnderlying(id); - auto sprite = getGameState().entities.GetEntity(spriteId); + auto sprite = getGameState().entities.getEntity(spriteId); if (sprite != nullptr && sprite->type != EntityType::null) { return GetEntityAsDukValue(ctx, sprite); @@ -123,7 +123,7 @@ namespace OpenRCT2::Scripting { for (auto carId = trainHead->id; !carId.IsNull();) { - auto car = getGameState().entities.GetEntity(carId); + auto car = getGameState().entities.getEntity(carId); if (car == nullptr) { @@ -186,7 +186,7 @@ namespace OpenRCT2::Scripting { for (auto sprite : EntityList()) { - auto staff = getGameState().entities.GetEntity(sprite->id); + auto staff = getGameState().entities.getEntity(sprite->id); if (staff != nullptr) { switch (staff->assignedStaffType) @@ -286,7 +286,7 @@ namespace OpenRCT2::Scripting { for (auto sprite : EntityTileList(pos)) { - auto staff = getGameState().entities.GetEntity(sprite->id); + auto staff = getGameState().entities.getEntity(sprite->id); if (staff != nullptr) { switch (staff->assignedStaffType) @@ -332,7 +332,7 @@ namespace OpenRCT2::Scripting template JSValue createEntityType(JSContext* ctx, JSValue initializer) { - TEntityType* entity = getGameState().entities.CreateEntity(); + TEntityType* entity = getGameState().entities.createEntity(); if (entity == nullptr) { // Probably no more space for entities for this specified entity type. @@ -354,7 +354,7 @@ namespace OpenRCT2::Scripting JSValue res; if (type == "car") { - Vehicle* entity = getGameState().entities.CreateEntity(); + Vehicle* entity = getGameState().entities.createEntity(); if (entity == nullptr) { // Probably no more space for entities for this specified entity type. @@ -531,7 +531,7 @@ namespace OpenRCT2::Scripting return ScVehicle::New(ctx, spriteId); case EntityType::staff: { - auto staff = getGameState().entities.GetEntity(spriteId); + auto staff = getGameState().entities.getEntity(spriteId); if (staff != nullptr) { switch (staff->assignedStaffType) diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index c552ad7080..a4630de408 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -144,7 +144,7 @@ namespace OpenRCT2 for (auto* litter : removals) { litter->invalidate(); - getGameState().entities.EntityRemove(litter); + getGameState().entities.entityRemove(litter); } } diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index e753e3c683..08bf005262 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -2195,10 +2195,10 @@ namespace OpenRCT2 for (auto i = 0; i < EnumValue(EntityType::count); i++) { auto entityType = static_cast(i); - auto& list = getGameState().entities.GetEntityList(entityType); + auto& list = getGameState().entities.getEntityList(entityType); for (const auto& entityId : list) { - auto entity = getGameState().entities.GetEntity(entityId); + auto entity = getGameState().entities.getEntity(entityId); // Do not tween the entity entityTweener.RemoveEntity(entity); diff --git a/test/tests/EntityImportTests.cpp b/test/tests/EntityImportTests.cpp index 526131413c..7a2b2d168c 100644 --- a/test/tests/EntityImportTests.cpp +++ b/test/tests/EntityImportTests.cpp @@ -48,15 +48,15 @@ protected: TEST_F(EntityImportTests, CreateEntityAtDuplicateIndexReturnsNull) { auto& gameState = getGameState(); - gameState.entities.ResetAllEntities(); + gameState.entities.resetAllEntities(); // Create an entity at index 100 - auto* entity1 = gameState.entities.CreateEntityAt(EntityId::FromUnderlying(100)); + auto* entity1 = gameState.entities.createEntityAt(EntityId::FromUnderlying(100)); ASSERT_NE(entity1, nullptr); EXPECT_EQ(entity1->id.ToUnderlying(), 100u); // Try to create another entity at the same index, which should return nullptr - auto* entity2 = gameState.entities.CreateEntityAt(EntityId::FromUnderlying(100)); + auto* entity2 = gameState.entities.createEntityAt(EntityId::FromUnderlying(100)); EXPECT_EQ(entity2, nullptr); } diff --git a/test/tests/PlayTests.cpp b/test/tests/PlayTests.cpp index 8fc02e150e..7b520f1c31 100644 --- a/test/tests/PlayTests.cpp +++ b/test/tests/PlayTests.cpp @@ -57,7 +57,7 @@ static std::unique_ptr localStartGame(const std::string& parkPath) auto& gameState = getGameState(); importer->Import(gameState); - gameState.entities.ResetEntitySpatialIndices(); + gameState.entities.resetEntitySpatialIndices(); ResetAllSpriteQuadrantPlacements(); LoadPalette(); diff --git a/test/tests/S6ImportExportTests.cpp b/test/tests/S6ImportExportTests.cpp index ff37eac420..c8743dce79 100644 --- a/test/tests/S6ImportExportTests.cpp +++ b/test/tests/S6ImportExportTests.cpp @@ -57,7 +57,7 @@ static void GameInit(bool retainSpatialIndices) { auto& gameState = getGameState(); if (!retainSpatialIndices) - gameState.entities.ResetEntitySpatialIndices(); + gameState.entities.resetEntitySpatialIndices(); ResetAllSpriteQuadrantPlacements(); LoadPalette();