Rename ride_id_t to RideId

This commit is contained in:
ζeh Matt 2022-01-19 15:17:11 +02:00
parent b5f649c972
commit a2470c0573
No known key found for this signature in database
GPG Key ID: 18CE582C71A225B0
95 changed files with 287 additions and 287 deletions

View File

@ -183,9 +183,9 @@ public:
case WD_BANNER: case WD_BANNER:
return WindowBannerOpen(id); return WindowBannerOpen(id);
case WD_DEMOLISH_RIDE: case WD_DEMOLISH_RIDE:
return WindowRideDemolishPromptOpen(get_ride(static_cast<ride_id_t>(id))); return WindowRideDemolishPromptOpen(get_ride(static_cast<RideId>(id)));
case WD_REFURBISH_RIDE: case WD_REFURBISH_RIDE:
return WindowRideRefurbishPromptOpen(get_ride(static_cast<ride_id_t>(id))); return WindowRideRefurbishPromptOpen(get_ride(static_cast<RideId>(id)));
case WD_NEW_CAMPAIGN: case WD_NEW_CAMPAIGN:
return WindowNewCampaignOpen(id); return WindowNewCampaignOpen(id);
case WD_SIGN: case WD_SIGN:
@ -263,7 +263,7 @@ public:
} }
case WC_RIDE: case WC_RIDE:
{ {
const auto rideId = static_cast<ride_id_t>(intent->GetSIntExtra(INTENT_EXTRA_RIDE_ID)); const auto rideId = static_cast<RideId>(intent->GetSIntExtra(INTENT_EXTRA_RIDE_ID));
auto ride = get_ride(rideId); auto ride = get_ride(rideId);
return ride == nullptr ? nullptr : WindowRideMainOpen(ride); return ride == nullptr ? nullptr : WindowRideMainOpen(ride);
} }
@ -365,13 +365,13 @@ public:
if (w == nullptr || w->number != rideIndex) if (w == nullptr || w->number != rideIndex)
{ {
window_close_construction_windows(); window_close_construction_windows();
_currentRideIndex = static_cast<ride_id_t>(rideIndex); _currentRideIndex = static_cast<RideId>(rideIndex);
OpenWindow(WC_RIDE_CONSTRUCTION); OpenWindow(WC_RIDE_CONSTRUCTION);
} }
else else
{ {
ride_construction_invalidate_current_track(); ride_construction_invalidate_current_track();
_currentRideIndex = static_cast<ride_id_t>(rideIndex); _currentRideIndex = static_cast<RideId>(rideIndex);
} }
break; break;
} }

View File

@ -1006,7 +1006,7 @@ static void WindowEditorObjectiveOptionsRidesScrollmousedown(
if (i < 0 || i >= w->no_list_items) if (i < 0 || i >= w->no_list_items)
return; return;
const auto rideId = static_cast<ride_id_t>(w->list_item_positions[i]); const auto rideId = static_cast<RideId>(w->list_item_positions[i]);
auto ride = get_ride(rideId); auto ride = get_ride(rideId);
if (ride != nullptr) if (ride != nullptr)
{ {
@ -1100,7 +1100,7 @@ static void WindowEditorObjectiveOptionsRidesScrollpaint(rct_window* w, rct_draw
} }
// Checkbox mark // Checkbox mark
const auto rideId = static_cast<ride_id_t>(w->list_item_positions[i]); const auto rideId = static_cast<RideId>(w->list_item_positions[i]);
auto ride = get_ride(rideId); auto ride = get_ride(rideId);
if (ride != nullptr) if (ride != nullptr)
{ {

View File

@ -1638,7 +1638,7 @@ void WindowGuestRidesScrollPaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t
stringId = STR_WINDOW_COLOUR_2_STRINGID; stringId = STR_WINDOW_COLOUR_2_STRINGID;
} }
const auto rideId = static_cast<ride_id_t>(w->list_item_positions[list_index]); const auto rideId = static_cast<RideId>(w->list_item_positions[list_index]);
auto ride = get_ride(rideId); auto ride = get_ride(rideId);
if (ride != nullptr) if (ride != nullptr)
{ {

View File

@ -185,7 +185,7 @@ public:
{ {
case GuestListFilterType::GuestsOnRide: case GuestListFilterType::GuestsOnRide:
{ {
auto guestRide = get_ride(static_cast<ride_id_t>(index)); auto guestRide = get_ride(static_cast<RideId>(index));
if (guestRide != nullptr) if (guestRide != nullptr)
{ {
ft.Add<rct_string_id>( ft.Add<rct_string_id>(
@ -201,7 +201,7 @@ public:
} }
case GuestListFilterType::GuestsInQueue: case GuestListFilterType::GuestsInQueue:
{ {
auto guestRide = get_ride(static_cast<ride_id_t>(index)); auto guestRide = get_ride(static_cast<RideId>(index));
if (guestRide != nullptr) if (guestRide != nullptr)
{ {
ft.Add<rct_string_id>(STR_QUEUING_FOR); ft.Add<rct_string_id>(STR_QUEUING_FOR);
@ -216,7 +216,7 @@ public:
} }
case GuestListFilterType::GuestsThinkingAboutRide: case GuestListFilterType::GuestsThinkingAboutRide:
{ {
auto guestRide = get_ride(static_cast<ride_id_t>(index)); auto guestRide = get_ride(static_cast<RideId>(index));
if (guestRide != nullptr) if (guestRide != nullptr)
{ {
ft.Add<rct_string_id>(STR_NONE); ft.Add<rct_string_id>(STR_NONE);

View File

@ -346,7 +346,7 @@ private:
if (gRideEntranceExitPlaceDirection == INVALID_DIRECTION) if (gRideEntranceExitPlaceDirection == INVALID_DIRECTION)
return; return;
ride_id_t rideIndex = gRideEntranceExitPlaceRideIndex; RideId rideIndex = gRideEntranceExitPlaceRideIndex;
auto rideEntranceExitPlaceAction = RideEntranceExitPlaceAction( auto rideEntranceExitPlaceAction = RideEntranceExitPlaceAction(
entranceOrExitCoords, direction_reverse(entranceOrExitCoords.direction), rideIndex, entranceOrExitCoords, direction_reverse(entranceOrExitCoords.direction), rideIndex,

View File

@ -60,10 +60,10 @@ static rct_widget window_new_campaign_widgets[] = {
class NewCampaignWindow final : public Window class NewCampaignWindow final : public Window
{ {
private: private:
std::vector<ride_id_t> RideList; std::vector<RideId> RideList;
std::vector<ShopItem> ShopItems; std::vector<ShopItem> ShopItems;
static bool RideValueCompare(const ride_id_t& a, const ride_id_t& b) static bool RideValueCompare(const RideId& a, const RideId& b)
{ {
auto valueA = 0; auto valueA = 0;
auto rideA = get_ride(a); auto rideA = get_ride(a);
@ -78,7 +78,7 @@ private:
return (valueB - valueA) < 0; return (valueB - valueA) < 0;
} }
static int32_t RideNameCompare(const ride_id_t& a, const ride_id_t& b) static int32_t RideNameCompare(const RideId& a, const RideId& b)
{ {
std::string rideAName = ""; std::string rideAName = "";
auto rideA = get_ride(a); auto rideA = get_ride(a);

View File

@ -1559,7 +1559,7 @@ static void WindowRideAnchorBorderWidgets(rct_window* w)
static std::optional<StationIndex> GetStationIndexFromViewSelection(const rct_window& w) static std::optional<StationIndex> GetStationIndexFromViewSelection(const rct_window& w)
{ {
const auto* ride = get_ride(static_cast<ride_id_t>(w.number)); const auto* ride = get_ride(static_cast<RideId>(w.number));
if (ride == nullptr) if (ride == nullptr)
return std::nullopt; return std::nullopt;

View File

@ -190,10 +190,10 @@ static void WindowRideConstructionEntranceClick(rct_window* w);
static void WindowRideConstructionExitClick(rct_window* w); static void WindowRideConstructionExitClick(rct_window* w);
static void WindowRideConstructionDrawTrackPiece( static void WindowRideConstructionDrawTrackPiece(
rct_window* w, rct_drawpixelinfo* dpi, ride_id_t rideIndex, int32_t trackType, int32_t trackDirection, int32_t unknown, rct_window* w, rct_drawpixelinfo* dpi, RideId rideIndex, int32_t trackType, int32_t trackDirection, int32_t unknown,
int32_t width, int32_t height); int32_t width, int32_t height);
static void Sub6CbcE2( static void Sub6CbcE2(
rct_drawpixelinfo* dpi, ride_id_t rideIndex, int32_t trackType, int32_t trackDirection, int32_t edx, rct_drawpixelinfo* dpi, RideId rideIndex, int32_t trackType, int32_t trackDirection, int32_t edx,
const CoordsXY& originCoords, int32_t originZ); const CoordsXY& originCoords, int32_t originZ);
static void WindowRideConstructionUpdateMapSelection(); static void WindowRideConstructionUpdateMapSelection();
static void WindowRideConstructionUpdatePossibleRideConfigurations(); static void WindowRideConstructionUpdatePossibleRideConfigurations();
@ -226,7 +226,7 @@ static int32_t RideGetAlternativeType(Ride* ride)
} }
/* move to ride.c */ /* move to ride.c */
static void CloseRideWindowForConstruction(ride_id_t rideId) static void CloseRideWindowForConstruction(RideId rideId)
{ {
rct_window* w = window_find_by_number(WC_RIDE, EnumValue(rideId)); rct_window* w = window_find_by_number(WC_RIDE, EnumValue(rideId));
if (w != nullptr && w->page == 1) if (w != nullptr && w->page == 1)
@ -239,7 +239,7 @@ static void CloseRideWindowForConstruction(ride_id_t rideId)
*/ */
rct_window* WindowRideConstructionOpen() rct_window* WindowRideConstructionOpen()
{ {
ride_id_t rideIndex = _currentRideIndex; RideId rideIndex = _currentRideIndex;
CloseRideWindowForConstruction(rideIndex); CloseRideWindowForConstruction(rideIndex);
auto ride = get_ride(rideIndex); auto ride = get_ride(rideIndex);
@ -1507,7 +1507,7 @@ static void RideConstructPlacedBackwardGameActionCallback(const GameAction* ga,
*/ */
static void WindowRideConstructionConstruct(rct_window* w) static void WindowRideConstructionConstruct(rct_window* w)
{ {
ride_id_t rideIndex; RideId rideIndex;
int32_t trackType, trackDirection, liftHillAndAlternativeState, properties; int32_t trackType, trackDirection, liftHillAndAlternativeState, properties;
CoordsXYZ trackPos{}; CoordsXYZ trackPos{};
@ -2054,7 +2054,7 @@ static void WindowRideConstructionPaint(rct_window* w, rct_drawpixelinfo* dpi)
if (widget->type == WindowWidgetType::Empty) if (widget->type == WindowWidgetType::Empty)
return; return;
ride_id_t rideIndex; RideId rideIndex;
int32_t trackType, trackDirection, liftHillAndInvertedState; int32_t trackType, trackDirection, liftHillAndInvertedState;
if (window_ride_construction_update_state( if (window_ride_construction_update_state(
&trackType, &trackDirection, &rideIndex, &liftHillAndInvertedState, nullptr, nullptr)) &trackType, &trackDirection, &rideIndex, &liftHillAndInvertedState, nullptr, nullptr))
@ -2085,7 +2085,7 @@ static void WindowRideConstructionPaint(rct_window* w, rct_drawpixelinfo* dpi)
} }
static void WindowRideConstructionDrawTrackPiece( static void WindowRideConstructionDrawTrackPiece(
rct_window* w, rct_drawpixelinfo* dpi, ride_id_t rideIndex, int32_t trackType, int32_t trackDirection, rct_window* w, rct_drawpixelinfo* dpi, RideId rideIndex, int32_t trackType, int32_t trackDirection,
int32_t liftHillAndInvertedState, int32_t width, int32_t height) int32_t liftHillAndInvertedState, int32_t width, int32_t height)
{ {
auto ride = get_ride(rideIndex); auto ride = get_ride(rideIndex);
@ -2133,7 +2133,7 @@ static TileElement* _backupTileElementArrays[5];
* dh: trackType * dh: trackType
*/ */
static void Sub6CbcE2( static void Sub6CbcE2(
rct_drawpixelinfo* dpi, ride_id_t rideIndex, int32_t trackType, int32_t trackDirection, int32_t liftHillAndInvertedState, rct_drawpixelinfo* dpi, RideId rideIndex, int32_t trackType, int32_t trackDirection, int32_t liftHillAndInvertedState,
const CoordsXY& originCoords, int32_t originZ) const CoordsXY& originCoords, int32_t originZ)
{ {
paint_session* session = PaintSessionAlloc(dpi, 0); paint_session* session = PaintSessionAlloc(dpi, 0);
@ -2273,7 +2273,7 @@ void WindowRideConstructionUpdateEnabledTrackPieces()
*/ */
void UpdateGhostTrackAndArrow() void UpdateGhostTrackAndArrow()
{ {
ride_id_t rideIndex; RideId rideIndex;
int32_t direction, type, liftHillAndAlternativeState; int32_t direction, type, liftHillAndAlternativeState;
CoordsXYZ trackPos{}; CoordsXYZ trackPos{};
@ -3192,7 +3192,7 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords)
gMapSelectionTiles.clear(); gMapSelectionTiles.clear();
gMapSelectionTiles.push_back(*mapCoords); gMapSelectionTiles.push_back(*mapCoords);
ride_id_t rideIndex; RideId rideIndex;
int32_t trackType, trackDirection, liftHillAndAlternativeState; int32_t trackType, trackDirection, liftHillAndAlternativeState;
if (window_ride_construction_update_state( if (window_ride_construction_update_state(
&trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, nullptr, nullptr)) &trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, nullptr, nullptr))
@ -3412,7 +3412,7 @@ void ride_construction_toolupdate_entrance_exit(const ScreenCoordsXY& screenCoor
void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords) void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords)
{ {
const CursorState* state = context_get_cursor_state(); const CursorState* state = context_get_cursor_state();
ride_id_t rideIndex; RideId rideIndex;
int32_t trackType, trackDirection, liftHillAndAlternativeState, z, properties, highestZ; int32_t trackType, trackDirection, liftHillAndAlternativeState, z, properties, highestZ;
rct_window* w; rct_window* w;

View File

@ -149,7 +149,7 @@ class RideListWindow final : public Window
private: private:
bool _quickDemolishMode = false; bool _quickDemolishMode = false;
int32_t _windowRideListInformationType = INFORMATION_TYPE_STATUS; int32_t _windowRideListInformationType = INFORMATION_TYPE_STATUS;
std::vector<ride_id_t> _rideList; std::vector<RideId> _rideList;
public: public:
void OnOpen() override void OnOpen() override

View File

@ -1916,7 +1916,7 @@ static void WindowTileInspectorPaint(rct_window* w, rct_drawpixelinfo* dpi)
case TileElementType::Track: case TileElementType::Track:
{ {
auto trackElement = tileElement->AsTrack(); auto trackElement = tileElement->AsTrack();
ride_id_t rideId = trackElement->GetRideIndex(); RideId rideId = trackElement->GetRideIndex();
auto ride = get_ride(rideId); auto ride = get_ride(rideId);
// Ride ID // Ride ID
@ -2091,7 +2091,7 @@ static void WindowTileInspectorPaint(rct_window* w, rct_drawpixelinfo* dpi)
{ {
// Ride ID // Ride ID
ft = Formatter(); ft = Formatter();
ft.Add<ride_id_t>(tileElement->AsEntrance()->GetRideIndex()); ft.Add<RideId>(tileElement->AsEntrance()->GetRideIndex());
DrawTextBasic( DrawTextBasic(
dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRANCE_RIDE_ID, ft, dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRANCE_RIDE_ID, ft,
{ w->colours[1] }); { w->colours[1] });

View File

@ -97,7 +97,7 @@ static rct_window_event_list window_track_place_events([](auto& events)
static std::vector<uint8_t> _window_track_place_mini_preview; static std::vector<uint8_t> _window_track_place_mini_preview;
static CoordsXY _windowTrackPlaceLast; static CoordsXY _windowTrackPlaceLast;
static ride_id_t _window_track_place_ride_index; static RideId _window_track_place_ride_index;
static bool _window_track_place_last_was_valid; static bool _window_track_place_last_was_valid;
static CoordsXYZ _windowTrackPlaceLastValid; static CoordsXYZ _windowTrackPlaceLastValid;
static money32 _window_track_place_last_cost; static money32 _window_track_place_last_cost;
@ -292,7 +292,7 @@ static void WindowTrackPlaceToolupdate(rct_window* w, rct_widgetindex widgetInde
tdAction.SetCallback([trackLoc](const GameAction*, const GameActions::Result* result) { tdAction.SetCallback([trackLoc](const GameAction*, const GameActions::Result* result) {
if (result->Error == GameActions::Status::Ok) if (result->Error == GameActions::Status::Ok)
{ {
_window_track_place_ride_index = result->GetData<ride_id_t>(); _window_track_place_ride_index = result->GetData<RideId>();
_windowTrackPlaceLastValid = trackLoc; _windowTrackPlaceLastValid = trackLoc;
_window_track_place_last_was_valid = true; _window_track_place_last_was_valid = true;
} }
@ -339,7 +339,7 @@ static void WindowTrackPlaceTooldown(rct_window* w, rct_widgetindex widgetIndex,
tdAction.SetCallback([trackLoc](const GameAction*, const GameActions::Result* result) { tdAction.SetCallback([trackLoc](const GameAction*, const GameActions::Result* result) {
if (result->Error == GameActions::Status::Ok) if (result->Error == GameActions::Status::Ok)
{ {
const auto rideId = result->GetData<ride_id_t>(); const auto rideId = result->GetData<RideId>();
auto ride = get_ride(rideId); auto ride = get_ride(rideId);
if (ride != nullptr) if (ride != nullptr)
{ {

View File

@ -69,7 +69,7 @@ void ride_construct_new(RideSelection listItem)
gameAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) { gameAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) {
if (result->Error != GameActions::Status::Ok) if (result->Error != GameActions::Status::Ok)
return; return;
const auto rideIndex = result->GetData<ride_id_t>(); const auto rideIndex = result->GetData<RideId>();
auto ride = get_ride(rideIndex); auto ride = get_ride(rideIndex);
ride_construct(ride); ride_construct(ride);
}); });
@ -118,7 +118,7 @@ void guest_set_name(uint16_t spriteIndex, const char* name)
#pragma endregion #pragma endregion
#pragma region MazeSetTrack #pragma region MazeSetTrack
money32 maze_set_track(const CoordsXYZD& loc, uint8_t flags, bool initialPlacement, ride_id_t rideIndex, uint8_t mode) money32 maze_set_track(const CoordsXYZD& loc, uint8_t flags, bool initialPlacement, RideId rideIndex, uint8_t mode)
{ {
auto gameAction = MazeSetTrackAction(loc, initialPlacement, rideIndex, mode); auto gameAction = MazeSetTrackAction(loc, initialPlacement, rideIndex, mode);
gameAction.SetFlags(flags); gameAction.SetFlags(flags);

View File

@ -272,7 +272,7 @@ rct_string_id LandSetHeightAction::CheckRideSupports() const
{ {
for (auto* trackElement : TileElementsView<TrackElement>(_coords)) for (auto* trackElement : TileElementsView<TrackElement>(_coords))
{ {
ride_id_t rideIndex = trackElement->GetRideIndex(); RideId rideIndex = trackElement->GetRideIndex();
auto ride = get_ride(rideIndex); auto ride = get_ride(rideIndex);
if (ride == nullptr) if (ride == nullptr)

View File

@ -230,7 +230,7 @@ GameActions::Result LargeSceneryPlaceAction::Execute() const
banner->type = 0; banner->type = 0;
banner->position = TileCoordsXY(_loc); banner->position = TileCoordsXY(_loc);
ride_id_t rideIndex = banner_get_closest_ride_index({ _loc, maxHeight }); RideId rideIndex = banner_get_closest_ride_index({ _loc, maxHeight });
if (rideIndex != RIDE_ID_NULL) if (rideIndex != RIDE_ID_NULL)
{ {
banner->ride_index = rideIndex; banner->ride_index = rideIndex;

View File

@ -70,7 +70,7 @@ GameActions::Result ParkMarketingAction::Execute() const
campaign.Flags = MarketingCampaignFlags::FIRST_WEEK; campaign.Flags = MarketingCampaignFlags::FIRST_WEEK;
if (campaign.Type == ADVERTISING_CAMPAIGN_RIDE_FREE || campaign.Type == ADVERTISING_CAMPAIGN_RIDE) if (campaign.Type == ADVERTISING_CAMPAIGN_RIDE_FREE || campaign.Type == ADVERTISING_CAMPAIGN_RIDE)
{ {
campaign.RideId = static_cast<ride_id_t>(_item); campaign.RideId = static_cast<RideId>(_item);
} }
else if (campaign.Type == ADVERTISING_CAMPAIGN_FOOD_OR_DRINK_FREE) else if (campaign.Type == ADVERTISING_CAMPAIGN_FOOD_OR_DRINK_FREE)
{ {

View File

@ -110,7 +110,7 @@ GameActions::Result RideCreateAction::Query() const
} }
auto res = GameActions::Result(); auto res = GameActions::Result();
res.SetData(ride_id_t{ rideIndex }); res.SetData(RideId{ rideIndex });
return res; return res;
} }
@ -310,7 +310,7 @@ GameActions::Result RideCreateAction::Execute() const
window_invalidate_by_class(WC_RIDE_LIST); window_invalidate_by_class(WC_RIDE_LIST);
res.Expenditure = ExpenditureType::RideConstruction; res.Expenditure = ExpenditureType::RideConstruction;
res.SetData(ride_id_t{ rideIndex }); res.SetData(RideId{ rideIndex });
return res; return res;
} }

View File

@ -31,7 +31,7 @@
using namespace OpenRCT2; using namespace OpenRCT2;
RideDemolishAction::RideDemolishAction(ride_id_t rideIndex, uint8_t modifyType) RideDemolishAction::RideDemolishAction(RideId rideIndex, uint8_t modifyType)
: _rideIndex(rideIndex) : _rideIndex(rideIndex)
, _modifyType(modifyType) , _modifyType(modifyType)
{ {

View File

@ -19,7 +19,7 @@ private:
public: public:
RideDemolishAction() = default; RideDemolishAction() = default;
RideDemolishAction(ride_id_t rideIndex, uint8_t modifyType); RideDemolishAction(RideId rideIndex, uint8_t modifyType);
void AcceptParameters(GameActionParameterVisitor& visitor) override; void AcceptParameters(GameActionParameterVisitor& visitor) override;

View File

@ -17,7 +17,7 @@
#include "../world/MapAnimation.h" #include "../world/MapAnimation.h"
RideEntranceExitPlaceAction::RideEntranceExitPlaceAction( RideEntranceExitPlaceAction::RideEntranceExitPlaceAction(
const CoordsXY& loc, Direction direction, ride_id_t rideIndex, StationIndex stationNum, bool isExit) const CoordsXY& loc, Direction direction, RideId rideIndex, StationIndex stationNum, bool isExit)
: _loc(loc) : _loc(loc)
, _direction(direction) , _direction(direction)
, _rideIndex(rideIndex) , _rideIndex(rideIndex)

View File

@ -24,7 +24,7 @@ private:
public: public:
RideEntranceExitPlaceAction() = default; RideEntranceExitPlaceAction() = default;
RideEntranceExitPlaceAction( RideEntranceExitPlaceAction(
const CoordsXY& loc, Direction direction, ride_id_t rideIndex, StationIndex stationNum, bool isExit); const CoordsXY& loc, Direction direction, RideId rideIndex, StationIndex stationNum, bool isExit);
void AcceptParameters(GameActionParameterVisitor& visitor) override; void AcceptParameters(GameActionParameterVisitor& visitor) override;

View File

@ -17,7 +17,7 @@
using namespace OpenRCT2; using namespace OpenRCT2;
RideEntranceExitRemoveAction::RideEntranceExitRemoveAction( RideEntranceExitRemoveAction::RideEntranceExitRemoveAction(
const CoordsXY& loc, ride_id_t rideIndex, StationIndex stationNum, bool isExit) const CoordsXY& loc, RideId rideIndex, StationIndex stationNum, bool isExit)
: _loc(loc) : _loc(loc)
, _rideIndex(rideIndex) , _rideIndex(rideIndex)
, _stationNum(stationNum) , _stationNum(stationNum)
@ -46,7 +46,7 @@ void RideEntranceExitRemoveAction::Serialise(DataSerialiser& stream)
} }
static TileElement* FindEntranceElement( static TileElement* FindEntranceElement(
const CoordsXY& loc, ride_id_t rideIndex, int32_t stationNum, int32_t entranceType, uint32_t flags) const CoordsXY& loc, RideId rideIndex, int32_t stationNum, int32_t entranceType, uint32_t flags)
{ {
const bool isGhost = flags & GAME_COMMAND_FLAG_GHOST; const bool isGhost = flags & GAME_COMMAND_FLAG_GHOST;
for (auto* entranceElement : TileElementsView<EntranceElement>(loc)) for (auto* entranceElement : TileElementsView<EntranceElement>(loc))

View File

@ -21,7 +21,7 @@ private:
public: public:
RideEntranceExitRemoveAction() = default; RideEntranceExitRemoveAction() = default;
RideEntranceExitRemoveAction(const CoordsXY& loc, ride_id_t rideIndex, StationIndex stationNum, bool isExit); RideEntranceExitRemoveAction(const CoordsXY& loc, RideId rideIndex, StationIndex stationNum, bool isExit);
void AcceptParameters(GameActionParameterVisitor& visitor) override; void AcceptParameters(GameActionParameterVisitor& visitor) override;

View File

@ -22,7 +22,7 @@
#include "../world/Park.h" #include "../world/Park.h"
RideSetAppearanceAction::RideSetAppearanceAction( RideSetAppearanceAction::RideSetAppearanceAction(
ride_id_t rideIndex, RideSetAppearanceType type, uint16_t value, uint32_t index) RideId rideIndex, RideSetAppearanceType type, uint16_t value, uint32_t index)
: _rideIndex(rideIndex) : _rideIndex(rideIndex)
, _type(type) , _type(type)
, _value(value) , _value(value)

View File

@ -34,7 +34,7 @@ private:
public: public:
RideSetAppearanceAction() = default; RideSetAppearanceAction() = default;
RideSetAppearanceAction(ride_id_t rideIndex, RideSetAppearanceType type, uint16_t value, uint32_t index); RideSetAppearanceAction(RideId rideIndex, RideSetAppearanceType type, uint16_t value, uint32_t index);
void AcceptParameters(GameActionParameterVisitor& visitor) override; void AcceptParameters(GameActionParameterVisitor& visitor) override;

View File

@ -21,7 +21,7 @@
#include "../ui/WindowManager.h" #include "../ui/WindowManager.h"
#include "../world/Park.h" #include "../world/Park.h"
RideSetNameAction::RideSetNameAction(ride_id_t rideIndex, const std::string& name) RideSetNameAction::RideSetNameAction(RideId rideIndex, const std::string& name)
: _rideIndex(rideIndex) : _rideIndex(rideIndex)
, _name(name) , _name(name)
{ {

View File

@ -19,7 +19,7 @@ private:
public: public:
RideSetNameAction() = default; RideSetNameAction() = default;
RideSetNameAction(ride_id_t rideIndex, const std::string& name); RideSetNameAction(RideId rideIndex, const std::string& name);
void AcceptParameters(GameActionParameterVisitor& visitor) override; void AcceptParameters(GameActionParameterVisitor& visitor) override;

View File

@ -21,7 +21,7 @@
#include "../ride/ShopItem.h" #include "../ride/ShopItem.h"
#include "../world/Park.h" #include "../world/Park.h"
RideSetPriceAction::RideSetPriceAction(ride_id_t rideIndex, money16 price, bool primaryPrice) RideSetPriceAction::RideSetPriceAction(RideId rideIndex, money16 price, bool primaryPrice)
: _rideIndex(rideIndex) : _rideIndex(rideIndex)
, _price(price) , _price(price)
, _primaryPrice(primaryPrice) , _primaryPrice(primaryPrice)

View File

@ -20,7 +20,7 @@ private:
public: public:
RideSetPriceAction() = default; RideSetPriceAction() = default;
RideSetPriceAction(ride_id_t rideIndex, money16 price, bool primaryPrice); RideSetPriceAction(RideId rideIndex, money16 price, bool primaryPrice);
void AcceptParameters(GameActionParameterVisitor& visitor) override; void AcceptParameters(GameActionParameterVisitor& visitor) override;

View File

@ -14,7 +14,7 @@
#include "../ride/Ride.h" #include "../ride/Ride.h"
#include "../ride/RideData.h" #include "../ride/RideData.h"
RideSetSettingAction::RideSetSettingAction(ride_id_t rideIndex, RideSetSetting setting, uint8_t value) RideSetSettingAction::RideSetSettingAction(RideId rideIndex, RideSetSetting setting, uint8_t value)
: _rideIndex(rideIndex) : _rideIndex(rideIndex)
, _setting(setting) , _setting(setting)
, _value(value) , _value(value)

View File

@ -35,7 +35,7 @@ private:
public: public:
RideSetSettingAction() = default; RideSetSettingAction() = default;
RideSetSettingAction(ride_id_t rideIndex, RideSetSetting setting, uint8_t value); RideSetSettingAction(RideId rideIndex, RideSetSetting setting, uint8_t value);
void AcceptParameters(GameActionParameterVisitor& visitor) override; void AcceptParameters(GameActionParameterVisitor& visitor) override;

View File

@ -29,7 +29,7 @@ static rct_string_id _StatusErrorTitles[] = {
STR_CANT_SIMULATE, STR_CANT_SIMULATE,
}; };
RideSetStatusAction::RideSetStatusAction(ride_id_t rideIndex, RideStatus status) RideSetStatusAction::RideSetStatusAction(RideId rideIndex, RideStatus status)
: _rideIndex(rideIndex) : _rideIndex(rideIndex)
, _status(status) , _status(status)
{ {

View File

@ -19,7 +19,7 @@ private:
public: public:
RideSetStatusAction() = default; RideSetStatusAction() = default;
RideSetStatusAction(ride_id_t rideIndex, RideStatus status); RideSetStatusAction(RideId rideIndex, RideStatus status);
void AcceptParameters(GameActionParameterVisitor& visitor) override; void AcceptParameters(GameActionParameterVisitor& visitor) override;

View File

@ -31,7 +31,7 @@ constexpr static rct_string_id SetVehicleTypeErrorTitle[] = {
STR_RIDE_SET_VEHICLE_TYPE_FAIL, STR_RIDE_SET_VEHICLE_TYPE_FAIL,
}; };
RideSetVehicleAction::RideSetVehicleAction(ride_id_t rideIndex, RideSetVehicleType type, uint8_t value, uint8_t colour) RideSetVehicleAction::RideSetVehicleAction(RideId rideIndex, RideSetVehicleType type, uint8_t value, uint8_t colour)
: _rideIndex(rideIndex) : _rideIndex(rideIndex)
, _type(type) , _type(type)
, _value(value) , _value(value)

View File

@ -29,7 +29,7 @@ private:
public: public:
RideSetVehicleAction() = default; RideSetVehicleAction() = default;
RideSetVehicleAction(ride_id_t rideIndex, RideSetVehicleType type, uint8_t value, uint8_t colour = 0); RideSetVehicleAction(RideId rideIndex, RideSetVehicleType type, uint8_t value, uint8_t colour = 0);
void AcceptParameters(GameActionParameterVisitor& visitor) override; void AcceptParameters(GameActionParameterVisitor& visitor) override;

View File

@ -72,7 +72,7 @@ GameActions::Result SignSetNameAction::Execute() const
else else
{ {
// If empty name take closest ride name. // If empty name take closest ride name.
ride_id_t rideIndex = banner_get_closest_ride_index({ banner->position.ToCoordsXY(), 16 }); RideId rideIndex = banner_get_closest_ride_index({ banner->position.ToCoordsXY(), 16 });
if (rideIndex == RIDE_ID_NULL) if (rideIndex == RIDE_ID_NULL)
{ {
banner->flags &= ~BANNER_FLAG_LINKED_TO_RIDE; banner->flags &= ~BANNER_FLAG_LINKED_TO_RIDE;

View File

@ -84,7 +84,7 @@ GameActions::Result TrackDesignAction::Query() const
return GameActions::Result(GameActions::Status::NoFreeElements, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_NONE); return GameActions::Result(GameActions::Status::NoFreeElements, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_NONE);
} }
const auto rideIndex = r.GetData<ride_id_t>(); const auto rideIndex = r.GetData<RideId>();
auto ride = get_ride(rideIndex); auto ride = get_ride(rideIndex);
if (ride == nullptr) if (ride == nullptr)
{ {
@ -122,7 +122,7 @@ GameActions::Result TrackDesignAction::Query() const
} }
res.Cost = queryRes.Cost; res.Cost = queryRes.Cost;
res.SetData(ride_id_t{ RIDE_ID_NULL }); res.SetData(RideId{ RIDE_ID_NULL });
return res; return res;
} }
@ -156,7 +156,7 @@ GameActions::Result TrackDesignAction::Execute() const
return GameActions::Result(GameActions::Status::NoFreeElements, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_NONE); return GameActions::Result(GameActions::Status::NoFreeElements, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_NONE);
} }
const auto rideIndex = r.GetData<ride_id_t>(); const auto rideIndex = r.GetData<RideId>();
auto ride = get_ride(rideIndex); auto ride = get_ride(rideIndex);
if (ride == nullptr) if (ride == nullptr)
{ {
@ -273,7 +273,7 @@ GameActions::Result TrackDesignAction::Execute() const
r = GameActions::ExecuteNested(&gameAction); r = GameActions::ExecuteNested(&gameAction);
} }
res.Cost = execRes.Cost; res.Cost = execRes.Cost;
res.SetData(ride_id_t{ ride->id }); res.SetData(RideId{ ride->id });
return res; return res;
} }

View File

@ -121,7 +121,7 @@ GameActions::Result TrackRemoveAction::Query() const
STR_YOU_ARE_NOT_ALLOWED_TO_REMOVE_THIS_SECTION); STR_YOU_ARE_NOT_ALLOWED_TO_REMOVE_THIS_SECTION);
} }
ride_id_t rideIndex = tileElement->AsTrack()->GetRideIndex(); RideId rideIndex = tileElement->AsTrack()->GetRideIndex();
const auto trackType = tileElement->AsTrack()->GetTrackType(); const auto trackType = tileElement->AsTrack()->GetTrackType();
auto ride = get_ride(rideIndex); auto ride = get_ride(rideIndex);
@ -308,7 +308,7 @@ GameActions::Result TrackRemoveAction::Execute() const
return GameActions::Result(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); return GameActions::Result(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE);
} }
ride_id_t rideIndex = tileElement->AsTrack()->GetRideIndex(); RideId rideIndex = tileElement->AsTrack()->GetRideIndex();
const auto trackType = tileElement->AsTrack()->GetTrackType(); const auto trackType = tileElement->AsTrack()->GetTrackType();
bool isLiftHill = tileElement->AsTrack()->HasChain(); bool isLiftHill = tileElement->AsTrack()->HasChain();

View File

@ -347,7 +347,7 @@ GameActions::Result WallPlaceAction::Execute() const
banner->type = 0; // Banner must be deleted after this point in an early return banner->type = 0; // Banner must be deleted after this point in an early return
banner->position = TileCoordsXY(_loc); banner->position = TileCoordsXY(_loc);
ride_id_t rideIndex = banner_get_closest_ride_index(targetLoc); RideId rideIndex = banner_get_closest_ride_index(targetLoc);
if (rideIndex != RIDE_ID_NULL) if (rideIndex != RIDE_ID_NULL)
{ {
banner->ride_index = rideIndex; banner->ride_index = rideIndex;

View File

@ -439,7 +439,7 @@ static void peep_decide_whether_to_leave_park(Guest* peep);
static void peep_leave_park(Guest* peep); static void peep_leave_park(Guest* peep);
static void peep_head_for_nearest_ride_type(Guest* peep, int32_t rideType); static void peep_head_for_nearest_ride_type(Guest* peep, int32_t rideType);
static void peep_head_for_nearest_ride_with_flags(Guest* peep, int32_t rideTypeFlags); static void peep_head_for_nearest_ride_with_flags(Guest* peep, int32_t rideTypeFlags);
bool loc_690FD0(Peep* peep, ride_id_t* rideToView, uint8_t* rideSeatToView, TileElement* tileElement); bool loc_690FD0(Peep* peep, RideId* rideToView, uint8_t* rideSeatToView, TileElement* tileElement);
template<> bool EntityBase::Is<Guest>() const template<> bool EntityBase::Is<Guest>() const
{ {
@ -3155,7 +3155,7 @@ template<typename T> static void peep_head_for_nearest_ride(Guest* peep, bool co
} }
// Filter the considered rides // Filter the considered rides
ride_id_t potentialRides[OpenRCT2::Limits::MaxRidesInPark]; RideId potentialRides[OpenRCT2::Limits::MaxRidesInPark];
size_t numPotentialRides = 0; size_t numPotentialRides = 0;
for (auto& ride : GetRideManager()) for (auto& ride : GetRideManager())
{ {
@ -3271,7 +3271,7 @@ void Guest::StopPurchaseThought(uint8_t ride_type)
* *
* rct2: 0x0069AEB7 * rct2: 0x0069AEB7
*/ */
static bool peep_should_use_cash_machine(Guest* peep, ride_id_t rideIndex) static bool peep_should_use_cash_machine(Guest* peep, RideId rideIndex)
{ {
if (gParkFlags & PARK_FLAGS_NO_MONEY) if (gParkFlags & PARK_FLAGS_NO_MONEY)
return false; return false;
@ -5178,7 +5178,7 @@ void Guest::UpdateRide()
} }
static void peep_update_walking_break_scenery(Guest* peep); static void peep_update_walking_break_scenery(Guest* peep);
static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, ride_id_t* rideToView, uint8_t* rideSeatToView); static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, RideId* rideToView, uint8_t* rideSeatToView);
/** /**
* *
@ -5394,7 +5394,7 @@ void Guest::UpdateWalking()
for (; !(edges & (1 << chosen_edge));) for (; !(edges & (1 << chosen_edge));)
chosen_edge = (chosen_edge + 1) & 3; chosen_edge = (chosen_edge + 1) & 3;
ride_id_t ride_to_view; RideId ride_to_view;
uint8_t ride_seat_to_view; uint8_t ride_seat_to_view;
if (!peep_find_ride_to_look_at(this, chosen_edge, &ride_to_view, &ride_seat_to_view)) if (!peep_find_ride_to_look_at(this, chosen_edge, &ride_to_view, &ride_seat_to_view))
return; return;
@ -6197,7 +6197,7 @@ static bool peep_should_watch_ride(TileElement* tileElement)
return true; return true;
} }
bool loc_690FD0(Peep* peep, ride_id_t* rideToView, uint8_t* rideSeatToView, TileElement* tileElement) bool loc_690FD0(Peep* peep, RideId* rideToView, uint8_t* rideSeatToView, TileElement* tileElement)
{ {
auto ride = get_ride(tileElement->AsTrack()->GetRideIndex()); auto ride = get_ride(tileElement->AsTrack()->GetRideIndex());
if (ride == nullptr) if (ride == nullptr)
@ -6244,7 +6244,7 @@ bool loc_690FD0(Peep* peep, ride_id_t* rideToView, uint8_t* rideSeatToView, Tile
* @param[out] rideSeatToView (ch) * @param[out] rideSeatToView (ch)
* @return !CF * @return !CF
*/ */
static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, ride_id_t* rideToView, uint8_t* rideSeatToView) static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, RideId* rideToView, uint8_t* rideSeatToView)
{ {
TileElement* tileElement; TileElement* tileElement;
@ -6822,7 +6822,7 @@ void Guest::InsertNewThought(PeepThoughtType thought_type, ShopItem shopItem)
InsertNewThought(thought_type, static_cast<uint16_t>(shopItem)); InsertNewThought(thought_type, static_cast<uint16_t>(shopItem));
} }
void Guest::InsertNewThought(PeepThoughtType thought_type, ride_id_t rideId) void Guest::InsertNewThought(PeepThoughtType thought_type, RideId rideId)
{ {
InsertNewThought(thought_type, static_cast<uint16_t>(rideId)); InsertNewThought(thought_type, static_cast<uint16_t>(rideId));
} }
@ -7399,7 +7399,7 @@ static bool IsThoughtShopItemRelated(const PeepThoughtType type)
return false; return false;
} }
void Guest::RemoveRideFromMemory(ride_id_t rideId) void Guest::RemoveRideFromMemory(RideId rideId)
{ {
if (State == PeepState::Watching) if (State == PeepState::Watching)
{ {

View File

@ -191,7 +191,7 @@ struct PeepThought
PeepThoughtType type; PeepThoughtType type;
union union
{ {
ride_id_t rideId; RideId rideId;
ShopItem shopItem; ShopItem shopItem;
uint16_t item; uint16_t item;
}; };
@ -263,7 +263,7 @@ public:
uint8_t GuestNumRides; uint8_t GuestNumRides;
uint16_t GuestNextInQueue; uint16_t GuestNextInQueue;
int32_t ParkEntryTime; int32_t ParkEntryTime;
ride_id_t GuestHeadingToRideId; RideId GuestHeadingToRideId;
uint8_t GuestIsLostCountdown; uint8_t GuestIsLostCountdown;
uint8_t GuestTimeOnRide; uint8_t GuestTimeOnRide;
money16 PaidToEnter; money16 PaidToEnter;
@ -285,13 +285,13 @@ public:
uint16_t TimeInQueue; uint16_t TimeInQueue;
money32 CashInPocket; money32 CashInPocket;
money32 CashSpent; money32 CashSpent;
ride_id_t Photo1RideRef; RideId Photo1RideRef;
ride_id_t Photo2RideRef; RideId Photo2RideRef;
ride_id_t Photo3RideRef; RideId Photo3RideRef;
ride_id_t Photo4RideRef; RideId Photo4RideRef;
int8_t RejoinQueueTimeout; // whilst waiting for a free vehicle (or pair) in the entrance int8_t RejoinQueueTimeout; // whilst waiting for a free vehicle (or pair) in the entrance
ride_id_t PreviousRide; RideId PreviousRide;
uint16_t PreviousRideTimeOut; uint16_t PreviousRideTimeOut;
std::array<PeepThought, PEEP_MAX_THOUGHTS> Thoughts; std::array<PeepThought, PEEP_MAX_THOUGHTS> Thoughts;
// 0x3F Litter Count split into lots of 3 with time, 0xC0 Time since last recalc // 0x3F Litter Count split into lots of 3 with time, 0xC0 Time since last recalc
@ -305,7 +305,7 @@ public:
uint8_t VoucherType; uint8_t VoucherType;
union union
{ {
ride_id_t VoucherRideId; RideId VoucherRideId;
ShopItemIndex VoucherShopItem; ShopItemIndex VoucherShopItem;
}; };
uint8_t SurroundingsThoughtTimeout; uint8_t SurroundingsThoughtTimeout;
@ -315,7 +315,7 @@ public:
uint8_t BalloonColour; uint8_t BalloonColour;
uint8_t UmbrellaColour; uint8_t UmbrellaColour;
uint8_t HatColour; uint8_t HatColour;
ride_id_t FavouriteRide; RideId FavouriteRide;
uint8_t FavouriteRideRating; uint8_t FavouriteRideRating;
uint64_t ItemFlags; uint64_t ItemFlags;
@ -358,7 +358,7 @@ public:
void UpdateEasterEggInteractions(); void UpdateEasterEggInteractions();
void InsertNewThought(PeepThoughtType thought_type); void InsertNewThought(PeepThoughtType thought_type);
void InsertNewThought(PeepThoughtType thought_type, ShopItem thought_arguments); void InsertNewThought(PeepThoughtType thought_type, ShopItem thought_arguments);
void InsertNewThought(PeepThoughtType thought_type, ride_id_t rideId); void InsertNewThought(PeepThoughtType thought_type, RideId rideId);
void InsertNewThought(PeepThoughtType thought_type, uint16_t thought_arguments); void InsertNewThought(PeepThoughtType thought_type, uint16_t thought_arguments);
static Guest* Generate(const CoordsXYZ& coords); static Guest* Generate(const CoordsXYZ& coords);
bool UpdateQueuePosition(PeepActionType previous_action); bool UpdateQueuePosition(PeepActionType previous_action);
@ -374,7 +374,7 @@ public:
// Removes the ride from the guests memory, this includes // Removes the ride from the guests memory, this includes
// the history, thoughts, etc. // the history, thoughts, etc.
void RemoveRideFromMemory(ride_id_t rideId); void RemoveRideFromMemory(RideId rideId);
private: private:
void UpdateRide(); void UpdateRide();

View File

@ -2188,7 +2188,7 @@ static void peep_interact_with_path(Peep* peep, const CoordsXYE& coords)
*/ */
static bool peep_interact_with_shop(Peep* peep, const CoordsXYE& coords) static bool peep_interact_with_shop(Peep* peep, const CoordsXYE& coords)
{ {
ride_id_t rideIndex = coords.element->AsTrack()->GetRideIndex(); RideId rideIndex = coords.element->AsTrack()->GetRideIndex();
auto ride = get_ride(rideIndex); auto ride = get_ride(rideIndex);
if (ride == nullptr || !ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP)) if (ride == nullptr || !ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP))
return false; return false;

View File

@ -332,7 +332,7 @@ struct Peep : EntityBase
uint8_t EnergyTarget; uint8_t EnergyTarget;
uint8_t Mass; uint8_t Mass;
uint8_t WindowInvalidateFlags; uint8_t WindowInvalidateFlags;
ride_id_t CurrentRide; RideId CurrentRide;
StationIndex CurrentRideStation; StationIndex CurrentRideStation;
uint8_t CurrentTrain; uint8_t CurrentTrain;
union union
@ -364,7 +364,7 @@ struct Peep : EntityBase
uint8_t MazeLastEdge; uint8_t MazeLastEdge;
Direction PeepDirection; // Direction ? Direction PeepDirection; // Direction ?
}; };
ride_id_t InteractionRideIndex; RideId InteractionRideIndex;
uint32_t Id; uint32_t Id;
uint8_t PathCheckOptimisation; // see peep.checkForPath uint8_t PathCheckOptimisation; // see peep.checkForPath
TileCoordsXYZD PathfindGoal; TileCoordsXYZD PathfindGoal;

View File

@ -2599,7 +2599,7 @@ bool Staff::UpdateFixingLeaveByEntranceExit(bool firstRun, const Ride* ride)
/** /**
* rct2: 0x6B7588 * rct2: 0x6B7588
*/ */
void Staff::UpdateRideInspected(ride_id_t rideIndex) void Staff::UpdateRideInspected(RideId rideIndex)
{ {
auto ride = get_ride(rideIndex); auto ride = get_ride(rideIndex);
if (ride != nullptr) if (ride != nullptr)

View File

@ -94,7 +94,7 @@ private:
bool UpdateFixingMoveToStationExit(bool firstRun, const Ride* ride); bool UpdateFixingMoveToStationExit(bool firstRun, const Ride* ride);
bool UpdateFixingFinishFixOrInspect(bool firstRun, int32_t steps, Ride* ride); bool UpdateFixingFinishFixOrInspect(bool firstRun, int32_t steps, Ride* ride);
bool UpdateFixingLeaveByEntranceExit(bool firstRun, const Ride* ride); bool UpdateFixingLeaveByEntranceExit(bool firstRun, const Ride* ride);
void UpdateRideInspected(ride_id_t rideIndex); void UpdateRideInspected(RideId rideIndex);
void UpdateHeadingToInspect(); void UpdateHeadingToInspect();
bool DoHandymanPathFinding(); bool DoHandymanPathFinding();

View File

@ -196,7 +196,7 @@ static int32_t cc_rides(InteractiveConsole& console, const arguments_t& argv)
} }
else else
{ {
int32_t res = set_operating_setting(static_cast<ride_id_t>(ride_index), RideSetSetting::RideType, type); int32_t res = set_operating_setting(static_cast<RideId>(ride_index), RideSetSetting::RideType, type);
if (res == MONEY32_UNDEFINED) if (res == MONEY32_UNDEFINED)
{ {
if (!gCheatsAllowArbitraryRideTypeChanges) if (!gCheatsAllowArbitraryRideTypeChanges)
@ -226,7 +226,7 @@ static int32_t cc_rides(InteractiveConsole& console, const arguments_t& argv)
} }
else else
{ {
auto ride = get_ride(static_cast<ride_id_t>(ride_index)); auto ride = get_ride(static_cast<RideId>(ride_index));
if (mode >= static_cast<uint8_t>(RideMode::Count)) if (mode >= static_cast<uint8_t>(RideMode::Count))
{ {
console.WriteFormatLine("Invalid ride mode."); console.WriteFormatLine("Invalid ride mode.");
@ -258,7 +258,7 @@ static int32_t cc_rides(InteractiveConsole& console, const arguments_t& argv)
} }
else else
{ {
auto ride = get_ride(static_cast<ride_id_t>(ride_index)); auto ride = get_ride(static_cast<RideId>(ride_index));
if (mass <= 0) if (mass <= 0)
{ {
console.WriteFormatLine("Friction value must be strictly positive"); console.WriteFormatLine("Friction value must be strictly positive");
@ -296,7 +296,7 @@ static int32_t cc_rides(InteractiveConsole& console, const arguments_t& argv)
} }
else else
{ {
auto ride = get_ride(static_cast<ride_id_t>(ride_index)); auto ride = get_ride(static_cast<RideId>(ride_index));
if (excitement <= 0) if (excitement <= 0)
{ {
console.WriteFormatLine("Excitement value must be strictly positive"); console.WriteFormatLine("Excitement value must be strictly positive");
@ -327,7 +327,7 @@ static int32_t cc_rides(InteractiveConsole& console, const arguments_t& argv)
} }
else else
{ {
auto ride = get_ride(static_cast<ride_id_t>(ride_index)); auto ride = get_ride(static_cast<RideId>(ride_index));
if (intensity <= 0) if (intensity <= 0)
{ {
console.WriteFormatLine("Intensity value must be strictly positive"); console.WriteFormatLine("Intensity value must be strictly positive");
@ -358,7 +358,7 @@ static int32_t cc_rides(InteractiveConsole& console, const arguments_t& argv)
} }
else else
{ {
auto ride = get_ride(static_cast<ride_id_t>(ride_index)); auto ride = get_ride(static_cast<RideId>(ride_index));
if (nausea <= 0) if (nausea <= 0)
{ {
console.WriteFormatLine("Nausea value must be strictly positive"); console.WriteFormatLine("Nausea value must be strictly positive");
@ -428,7 +428,7 @@ static int32_t cc_rides(InteractiveConsole& console, const arguments_t& argv)
} }
else else
{ {
auto rideSetPrice = RideSetPriceAction(static_cast<ride_id_t>(rideId), price, true); auto rideSetPrice = RideSetPriceAction(static_cast<RideId>(rideId), price, true);
GameActions::Execute(&rideSetPrice); GameActions::Execute(&rideSetPrice);
} }
} }

View File

@ -269,7 +269,7 @@ struct campaign_variables
int16_t no_weeks; // 0x482 int16_t no_weeks; // 0x482
union union
{ {
ride_id_t RideId; // 0x484 RideId RideId; // 0x484
ObjectEntryIndex ShopItemId; // 0x484 ObjectEntryIndex ShopItemId; // 0x484
}; };
uint32_t pad_486; uint32_t pad_486;
@ -858,10 +858,10 @@ void window_follow_sprite(rct_window* w, size_t spriteIndex);
void window_unfollow_sprite(rct_window* w); void window_unfollow_sprite(rct_window* w);
bool window_ride_construction_update_state( bool window_ride_construction_update_state(
int32_t* trackType, int32_t* trackDirection, ride_id_t* rideIndex, int32_t* _liftHillAndAlternativeState, int32_t* trackType, int32_t* trackDirection, RideId* rideIndex, int32_t* _liftHillAndAlternativeState,
CoordsXYZ* trackPos, int32_t* properties); CoordsXYZ* trackPos, int32_t* properties);
money32 place_provisional_track_piece( money32 place_provisional_track_piece(
ride_id_t rideIndex, int32_t trackType, int32_t trackDirection, int32_t liftHillAndAlternativeState, RideId rideIndex, int32_t trackType, int32_t trackDirection, int32_t liftHillAndAlternativeState,
const CoordsXYZ& trackPos); const CoordsXYZ& trackPos);
extern RideConstructionState _rideConstructionState2; extern RideConstructionState _rideConstructionState2;

View File

@ -48,7 +48,7 @@ struct rct_window
union union
{ {
rct_windownumber number{}; rct_windownumber number{};
ride_id_t rideId; RideId rideId;
}; };
uint16_t flags{}; uint16_t flags{};
rct_scroll scrolls[3]; rct_scroll scrolls[3];

View File

@ -17,7 +17,7 @@
#include <cstring> #include <cstring>
extern thread_local uint8_t gCommonFormatArgs[80]; extern thread_local uint8_t gCommonFormatArgs[80];
enum class ride_id_t : uint16_t; enum class RideId : uint16_t;
class Formatter class Formatter
{ {
@ -91,7 +91,7 @@ public:
std::is_same_v<typename std::remove_cv<TSpecified>::type, int32_t> || std::is_same_v<typename std::remove_cv<TSpecified>::type, int32_t> ||
std::is_same_v<typename std::remove_cv<TSpecified>::type, money32> || std::is_same_v<typename std::remove_cv<TSpecified>::type, money32> ||
std::is_same_v<typename std::remove_cv<TSpecified>::type, money64> || std::is_same_v<typename std::remove_cv<TSpecified>::type, money64> ||
std::is_same_v<typename std::remove_cv<TSpecified>::type, ride_id_t> || std::is_same_v<typename std::remove_cv<TSpecified>::type, RideId> ||
std::is_same_v<typename std::remove_cv<TSpecified>::type, rct_string_id> || std::is_same_v<typename std::remove_cv<TSpecified>::type, rct_string_id> ||
std::is_same_v<typename std::remove_cv<TSpecified>::type, uint16_t> || std::is_same_v<typename std::remove_cv<TSpecified>::type, uint16_t> ||
std::is_same_v<typename std::remove_cv<TSpecified>::type, uint32_t> || std::is_same_v<typename std::remove_cv<TSpecified>::type, uint32_t> ||

View File

@ -243,7 +243,7 @@ void marketing_new_campaign(const MarketingCampaign& campaign)
} }
} }
void MarketingCancelCampaignsForRide(const ride_id_t rideId) void MarketingCancelCampaignsForRide(const RideId rideId)
{ {
auto isCampaignForRideFn = [&rideId](MarketingCampaign& campaign) { auto isCampaignForRideFn = [&rideId](MarketingCampaign& campaign) {
if (campaign.Type == ADVERTISING_CAMPAIGN_RIDE_FREE || campaign.Type == ADVERTISING_CAMPAIGN_RIDE) if (campaign.Type == ADVERTISING_CAMPAIGN_RIDE_FREE || campaign.Type == ADVERTISING_CAMPAIGN_RIDE)

View File

@ -50,7 +50,7 @@ struct MarketingCampaign
uint8_t Flags{}; uint8_t Flags{};
union union
{ {
ride_id_t RideId{}; RideId RideId{};
ShopItemIndex ShopItemType; ShopItemIndex ShopItemType;
}; };
}; };
@ -69,4 +69,4 @@ void marketing_set_guest_campaign(Guest* peep, int32_t campaign);
bool marketing_is_campaign_type_applicable(int32_t campaignType); bool marketing_is_campaign_type_applicable(int32_t campaignType);
MarketingCampaign* marketing_get_campaign(int32_t campaignType); MarketingCampaign* marketing_get_campaign(int32_t campaignType);
void marketing_new_campaign(const MarketingCampaign& campaign); void marketing_new_campaign(const MarketingCampaign& campaign);
void MarketingCancelCampaignsForRide(const ride_id_t rideId); void MarketingCancelCampaignsForRide(const RideId rideId);

View File

@ -213,7 +213,7 @@ std::optional<CoordsXYZ> News::GetSubjectLocation(News::ItemType type, int32_t s
{ {
case News::ItemType::Ride: case News::ItemType::Ride:
{ {
Ride* ride = get_ride(static_cast<ride_id_t>(subject)); Ride* ride = get_ride(static_cast<RideId>(subject));
if (ride == nullptr || ride->overall_view.IsNull()) if (ride == nullptr || ride->overall_view.IsNull())
{ {
break; break;

View File

@ -126,7 +126,7 @@ template<typename T, size_t _TypeID> struct NetworkObjectId_t
}; };
#pragma pack(pop) #pragma pack(pop)
using NetworkRideId_t = ride_id_t; using NetworkRideId_t = RideId;
// NOTE: When adding new types make sure to have no duplicate _TypeID's otherwise // NOTE: When adding new types make sure to have no duplicate _TypeID's otherwise
// there is no way to specialize templates if they have the exact symbol. // there is no way to specialize templates if they have the exact symbol.

View File

@ -1051,7 +1051,7 @@ namespace OpenRCT2
{ {
const auto version = os.GetHeader().TargetVersion; const auto version = os.GetHeader().TargetVersion;
os.ReadWriteChunk(ParkFileChunkType::RIDES, [this, &version](OrcaStream::ChunkStream& cs) { os.ReadWriteChunk(ParkFileChunkType::RIDES, [this, &version](OrcaStream::ChunkStream& cs) {
std::vector<ride_id_t> rideIds; std::vector<RideId> rideIds;
if (cs.GetMode() == OrcaStream::Mode::READING) if (cs.GetMode() == OrcaStream::Mode::READING)
{ {
ride_init_all(); ride_init_all();
@ -1078,7 +1078,7 @@ namespace OpenRCT2
} }
} }
} }
cs.ReadWriteVector(rideIds, [&cs, &version](ride_id_t& rideId) { cs.ReadWriteVector(rideIds, [&cs, &version](RideId& rideId) {
// Ride ID // Ride ID
cs.ReadWrite(rideId); cs.ReadWrite(rideId);
@ -1356,14 +1356,14 @@ namespace OpenRCT2
} }
return ridesTypesBeenOn; return ridesTypesBeenOn;
} }
static std::vector<ride_id_t> LegacyGetRidesBeenOn(const std::array<uint8_t, 32>& srcArray) static std::vector<RideId> LegacyGetRidesBeenOn(const std::array<uint8_t, 32>& srcArray)
{ {
std::vector<ride_id_t> ridesBeenOn; std::vector<RideId> ridesBeenOn;
for (uint16_t i = 0; i < RCT2::Limits::MaxRidesInPark; i++) for (uint16_t i = 0; i < RCT2::Limits::MaxRidesInPark; i++)
{ {
if (srcArray[i / 8] & (1 << (i % 8))) if (srcArray[i / 8] & (1 << (i % 8)))
{ {
ridesBeenOn.push_back(static_cast<ride_id_t>(i)); ridesBeenOn.push_back(static_cast<RideId>(i));
} }
} }
return ridesBeenOn; return ridesBeenOn;
@ -1516,9 +1516,9 @@ namespace OpenRCT2
return true; return true;
}); });
cs.Ignore<uint64_t>(); cs.Ignore<uint64_t>();
cs.Ignore<ride_id_t>(); cs.Ignore<RideId>();
cs.Ignore<ride_id_t>(); cs.Ignore<RideId>();
cs.Ignore<ride_id_t>(); cs.Ignore<RideId>();
} }
} }
@ -1610,7 +1610,7 @@ namespace OpenRCT2
cs.Ignore<money32>(); cs.Ignore<money32>();
cs.ReadWrite(staff->HireDate); cs.ReadWrite(staff->HireDate);
cs.Ignore<int8_t>(); cs.Ignore<int8_t>();
cs.Ignore<ride_id_t>(); cs.Ignore<RideId>();
cs.Ignore<uint16_t>(); cs.Ignore<uint16_t>();
std::vector<PeepThought> temp; std::vector<PeepThought> temp;
@ -1636,9 +1636,9 @@ namespace OpenRCT2
} }
else else
{ {
cs.Ignore<ride_id_t>(); cs.Ignore<RideId>();
cs.ReadWrite(staff->StaffOrders); cs.ReadWrite(staff->StaffOrders);
cs.Ignore<ride_id_t>(); cs.Ignore<RideId>();
} }
} }
@ -1697,7 +1697,7 @@ namespace OpenRCT2
cs.Ignore<uint8_t>(); cs.Ignore<uint8_t>();
cs.Ignore<uint8_t>(); cs.Ignore<uint8_t>();
cs.Ignore<uint8_t>(); cs.Ignore<uint8_t>();
cs.Ignore<ride_id_t>(); cs.Ignore<RideId>();
cs.Ignore<uint8_t>(); cs.Ignore<uint8_t>();
cs.Ignore<uint8_t>(); cs.Ignore<uint8_t>();
cs.Ignore<uint8_t>(); cs.Ignore<uint8_t>();
@ -1705,7 +1705,7 @@ namespace OpenRCT2
cs.Ignore<uint8_t>(); cs.Ignore<uint8_t>();
cs.Ignore<uint8_t>(); cs.Ignore<uint8_t>();
cs.Ignore<uint8_t>(); cs.Ignore<uint8_t>();
cs.Ignore<ride_id_t>(); cs.Ignore<RideId>();
cs.Ignore<uint8_t>(); cs.Ignore<uint8_t>();
} }
} }
@ -1895,8 +1895,8 @@ namespace OpenRCT2
{ {
if (cs.GetMode() == OrcaStream::Mode::READING) if (cs.GetMode() == OrcaStream::Mode::READING)
{ {
std::vector<ride_id_t> rideUse; std::vector<RideId> rideUse;
cs.ReadWriteVector(rideUse, [&cs](ride_id_t& rideId) { cs.ReadWrite(rideId); }); cs.ReadWriteVector(rideUse, [&cs](RideId& rideId) { cs.ReadWrite(rideId); });
OpenRCT2::RideUse::GetHistory().Set(guest.sprite_index, std::move(rideUse)); OpenRCT2::RideUse::GetHistory().Set(guest.sprite_index, std::move(rideUse));
std::vector<ObjectEntryIndex> rideTypeUse; std::vector<ObjectEntryIndex> rideTypeUse;
cs.ReadWriteVector(rideTypeUse, [&cs](ObjectEntryIndex& rideType) { cs.ReadWrite(rideType); }); cs.ReadWriteVector(rideTypeUse, [&cs](ObjectEntryIndex& rideType) { cs.ReadWrite(rideType); });
@ -1907,12 +1907,12 @@ namespace OpenRCT2
auto* rideUse = OpenRCT2::RideUse::GetHistory().GetAll(guest.sprite_index); auto* rideUse = OpenRCT2::RideUse::GetHistory().GetAll(guest.sprite_index);
if (rideUse == nullptr) if (rideUse == nullptr)
{ {
std::vector<ride_id_t> empty; std::vector<RideId> empty;
cs.ReadWriteVector(empty, [&cs](ride_id_t& rideId) { cs.ReadWrite(rideId); }); cs.ReadWriteVector(empty, [&cs](RideId& rideId) { cs.ReadWrite(rideId); });
} }
else else
{ {
cs.ReadWriteVector(*rideUse, [&cs](ride_id_t& rideId) { cs.ReadWrite(rideId); }); cs.ReadWriteVector(*rideUse, [&cs](RideId& rideId) { cs.ReadWrite(rideId); });
} }
auto* rideTypeUse = OpenRCT2::RideUse::GetTypeHistory().GetAll(guest.sprite_index); auto* rideTypeUse = OpenRCT2::RideUse::GetTypeHistory().GetAll(guest.sprite_index);
if (rideTypeUse == nullptr) if (rideTypeUse == nullptr)

View File

@ -34,7 +34,7 @@ static uint8_t _peepPathFindFewestNumSteps;
TileCoordsXYZ gPeepPathFindGoalPosition; TileCoordsXYZ gPeepPathFindGoalPosition;
bool gPeepPathFindIgnoreForeignQueues; bool gPeepPathFindIgnoreForeignQueues;
ride_id_t gPeepPathFindQueueRideIndex; RideId gPeepPathFindQueueRideIndex;
#if defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1 #if defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1
// Use to guard calls to log messages // Use to guard calls to log messages
@ -322,7 +322,7 @@ static uint8_t footpath_element_next_in_direction(TileCoordsXYZ loc, PathElement
* This is the recursive portion of footpath_element_destination_in_direction(). * This is the recursive portion of footpath_element_destination_in_direction().
*/ */
static uint8_t footpath_element_dest_in_dir( static uint8_t footpath_element_dest_in_dir(
TileCoordsXYZ loc, Direction chosenDirection, ride_id_t* outRideIndex, int32_t level) TileCoordsXYZ loc, Direction chosenDirection, RideId* outRideIndex, int32_t level)
{ {
TileElement* tileElement; TileElement* tileElement;
Direction direction; Direction direction;
@ -347,7 +347,7 @@ static uint8_t footpath_element_dest_in_dir(
{ {
if (loc.z != tileElement->base_height) if (loc.z != tileElement->base_height)
continue; continue;
ride_id_t rideIndex = tileElement->AsTrack()->GetRideIndex(); RideId rideIndex = tileElement->AsTrack()->GetRideIndex();
auto ride = get_ride(rideIndex); auto ride = get_ride(rideIndex);
if (ride != nullptr && ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP)) if (ride != nullptr && ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP))
{ {
@ -444,7 +444,7 @@ static uint8_t footpath_element_dest_in_dir(
* width path, for example that leads from a ride exit back to the main path. * width path, for example that leads from a ride exit back to the main path.
*/ */
static uint8_t footpath_element_destination_in_direction( static uint8_t footpath_element_destination_in_direction(
TileCoordsXYZ loc, PathElement* pathElement, Direction chosenDirection, ride_id_t* outRideIndex) TileCoordsXYZ loc, PathElement* pathElement, Direction chosenDirection, RideId* outRideIndex)
{ {
if (pathElement->IsSloped()) if (pathElement->IsSloped())
{ {
@ -756,7 +756,7 @@ static void peep_pathfind_heuristic_search(
if (tileElement->IsGhost()) if (tileElement->IsGhost())
continue; continue;
ride_id_t rideIndex = RIDE_ID_NULL; RideId rideIndex = RIDE_ID_NULL;
switch (tileElement->GetType()) switch (tileElement->GetType())
{ {
case TileElementType::Track: case TileElementType::Track:
@ -2096,7 +2096,7 @@ int32_t guest_path_finding(Guest* peep)
if (!(adjustedEdges & (1 << chosenDirection))) if (!(adjustedEdges & (1 << chosenDirection)))
continue; continue;
ride_id_t rideIndex = RIDE_ID_NULL; RideId rideIndex = RIDE_ID_NULL;
auto pathSearchResult = footpath_element_destination_in_direction(loc, pathElement, chosenDirection, &rideIndex); auto pathSearchResult = footpath_element_destination_in_direction(loc, pathElement, chosenDirection, &rideIndex);
switch (pathSearchResult) switch (pathSearchResult)
{ {
@ -2156,7 +2156,7 @@ int32_t guest_path_finding(Guest* peep)
} }
// Peep is heading for a ride. // Peep is heading for a ride.
ride_id_t rideIndex = peep->GuestHeadingToRideId; RideId rideIndex = peep->GuestHeadingToRideId;
auto ride = get_ride(rideIndex); auto ride = get_ride(rideIndex);
if (ride == nullptr || ride->status != RideStatus::Open) if (ride == nullptr || ride->status != RideStatus::Open)
{ {

View File

@ -27,7 +27,7 @@ extern TileCoordsXYZ gPeepPathFindGoalPosition;
// When the heuristic pathfinder is examining neighboring tiles, one possibility is that it finds a // When the heuristic pathfinder is examining neighboring tiles, one possibility is that it finds a
// queue tile; furthermore, this queue tile may or may not be for the ride that the peep is trying // queue tile; furthermore, this queue tile may or may not be for the ride that the peep is trying
// to get to, if any. This first var is used to store the ride that the peep is currently headed to. // to get to, if any. This first var is used to store the ride that the peep is currently headed to.
extern ride_id_t gPeepPathFindQueueRideIndex; extern RideId gPeepPathFindQueueRideIndex;
// Furthermore, staff members don't care about this stuff; even if they are e.g. a mechanic headed // Furthermore, staff members don't care about this stuff; even if they are e.g. a mechanic headed
// to a particular ride, they have no issues with walking over queues for other rides to get there. // to a particular ride, they have no issues with walking over queues for other rides to get there.

View File

@ -13,7 +13,7 @@
namespace OpenRCT2::RideUse namespace OpenRCT2::RideUse
{ {
using RideHistory = GroupVector<uint16_t, ride_id_t>; using RideHistory = GroupVector<uint16_t, RideId>;
using RideTypeHistory = GroupVector<uint16_t, uint16_t>; using RideTypeHistory = GroupVector<uint16_t, uint16_t>;
RideHistory& GetHistory(); RideHistory& GetHistory();

View File

@ -775,13 +775,13 @@ namespace RCT1
{ {
if (_s4.rides[i].type != RideType::Null) if (_s4.rides[i].type != RideType::Null)
{ {
const auto rideId = static_cast<ride_id_t>(i); const auto rideId = static_cast<RideId>(i);
ImportRide(GetOrAllocateRide(rideId), &_s4.rides[i], rideId); ImportRide(GetOrAllocateRide(rideId), &_s4.rides[i], rideId);
} }
} }
} }
void ImportRide(::Ride* dst, RCT1::Ride* src, ride_id_t rideIndex) void ImportRide(::Ride* dst, RCT1::Ride* src, RideId rideIndex)
{ {
*dst = {}; *dst = {};
dst->id = rideIndex; dst->id = rideIndex;
@ -2518,7 +2518,7 @@ namespace RCT1
{ {
if (_s4.scenario_slot_index == SC_URBAN_PARK && _isScenario) if (_s4.scenario_slot_index == SC_URBAN_PARK && _isScenario)
{ {
const auto merryGoRoundId = static_cast<ride_id_t>(0); const auto merryGoRoundId = static_cast<RideId>(0);
// First, make the queuing peep exit // First, make the queuing peep exit
for (auto peep : EntityList<Guest>()) for (auto peep : EntityList<Guest>())
@ -2588,7 +2588,7 @@ namespace RCT1
continue; continue;
} }
ride_id_t rideIndex = tileElement->AsTrack()->GetRideIndex(); RideId rideIndex = tileElement->AsTrack()->GetRideIndex();
auto ride = get_ride(rideIndex); auto ride = get_ride(rideIndex);
if (ride != nullptr) if (ride != nullptr)
{ {
@ -2704,13 +2704,13 @@ namespace RCT1
{ {
auto* dst = CreateEntityAt<::Vehicle>(srcBase.sprite_index); auto* dst = CreateEntityAt<::Vehicle>(srcBase.sprite_index);
auto* src = static_cast<const RCT1::Vehicle*>(&srcBase); auto* src = static_cast<const RCT1::Vehicle*>(&srcBase);
const auto* ride = get_ride(static_cast<ride_id_t>(src->ride)); const auto* ride = get_ride(static_cast<RideId>(src->ride));
if (ride == nullptr) if (ride == nullptr)
return; return;
uint8_t vehicleEntryIndex = RCT1::GetVehicleSubEntryIndex(src->vehicle_type); uint8_t vehicleEntryIndex = RCT1::GetVehicleSubEntryIndex(src->vehicle_type);
dst->ride = static_cast<ride_id_t>(src->ride); dst->ride = static_cast<RideId>(src->ride);
dst->ride_subtype = RCTEntryIndexToOpenRCT2EntryIndex(ride->subtype); dst->ride_subtype = RCTEntryIndexToOpenRCT2EntryIndex(ride->subtype);
dst->vehicle_type = vehicleEntryIndex; dst->vehicle_type = vehicleEntryIndex;

View File

@ -487,12 +487,12 @@ ObjectEntryIndex RCTEntryIndexToOpenRCT2EntryIndex(const RCT12ObjectEntryIndex i
return index; return index;
} }
ride_id_t RCT12RideIdToOpenRCT2RideId(const RCT12RideId rideId) RideId RCT12RideIdToOpenRCT2RideId(const RCT12RideId rideId)
{ {
if (rideId == RCT12_RIDE_ID_NULL) if (rideId == RCT12_RIDE_ID_NULL)
return RIDE_ID_NULL; return RIDE_ID_NULL;
return static_cast<ride_id_t>(rideId); return static_cast<RideId>(rideId);
} }
static bool RCT12IsFormatChar(codepoint_t c) static bool RCT12IsFormatChar(codepoint_t c)

View File

@ -847,7 +847,7 @@ assert_struct_size(RCT12ResearchItem, 5);
#pragma pack(pop) #pragma pack(pop)
ObjectEntryIndex RCTEntryIndexToOpenRCT2EntryIndex(const RCT12ObjectEntryIndex index); ObjectEntryIndex RCTEntryIndexToOpenRCT2EntryIndex(const RCT12ObjectEntryIndex index);
ride_id_t RCT12RideIdToOpenRCT2RideId(const RCT12RideId rideId); RideId RCT12RideIdToOpenRCT2RideId(const RCT12RideId rideId);
bool IsLikelyUTF8(std::string_view s); bool IsLikelyUTF8(std::string_view s);
std::string RCT12RemoveFormattingUTF8(std::string_view s); std::string RCT12RemoveFormattingUTF8(std::string_view s);
std::string ConvertFormattedStringToOpenRCT2(std::string_view buffer); std::string ConvertFormattedStringToOpenRCT2(std::string_view buffer);
@ -874,14 +874,14 @@ template<typename T> std::vector<uint16_t> RCT12GetRideTypesBeenOn(T* srcPeep)
} }
return ridesTypesBeenOn; return ridesTypesBeenOn;
} }
template<typename T> std::vector<ride_id_t> RCT12GetRidesBeenOn(T* srcPeep) template<typename T> std::vector<RideId> RCT12GetRidesBeenOn(T* srcPeep)
{ {
std::vector<ride_id_t> ridesBeenOn; std::vector<RideId> ridesBeenOn;
for (uint16_t i = 0; i < RCT12::Limits::MaxRidesInPark; i++) for (uint16_t i = 0; i < RCT12::Limits::MaxRidesInPark; i++)
{ {
if (srcPeep->rides_been_on[i / 8] & (1 << (i % 8))) if (srcPeep->rides_been_on[i / 8] & (1 << (i % 8)))
{ {
ridesBeenOn.push_back(static_cast<ride_id_t>(i)); ridesBeenOn.push_back(static_cast<RideId>(i));
} }
} }
return ridesBeenOn; return ridesBeenOn;

View File

@ -566,7 +566,7 @@ namespace RCT2
auto src = &_s6.rides[index]; auto src = &_s6.rides[index];
if (src->type != RIDE_TYPE_NULL) if (src->type != RIDE_TYPE_NULL)
{ {
const auto rideId = static_cast<ride_id_t>(index); const auto rideId = static_cast<RideId>(index);
auto dst = GetOrAllocateRide(rideId); auto dst = GetOrAllocateRide(rideId);
ImportRide(dst, src, rideId); ImportRide(dst, src, rideId);
} }
@ -621,7 +621,7 @@ namespace RCT2
return _isFlatRide[rct12RideIndex]; return _isFlatRide[rct12RideIndex];
} }
void ImportRide(::Ride* dst, const RCT2::Ride* src, const ride_id_t rideIndex) void ImportRide(::Ride* dst, const RCT2::Ride* src, const RideId rideIndex)
{ {
*dst = {}; *dst = {};
dst->id = rideIndex; dst->id = rideIndex;
@ -960,7 +960,7 @@ namespace RCT2
{ {
if (src.ride_index != RCT12_RIDE_ID_NULL) if (src.ride_index != RCT12_RIDE_ID_NULL)
{ {
const auto rideId = static_cast<ride_id_t>(src.ride_index); const auto rideId = static_cast<RideId>(src.ride_index);
auto ride = get_ride(rideId); auto ride = get_ride(rideId);
if (ride != nullptr) if (ride != nullptr)
{ {
@ -1090,7 +1090,7 @@ namespace RCT2
} }
} }
void ImportNumRiders(::Ride* dst, const ride_id_t rideIndex) void ImportNumRiders(::Ride* dst, const RideId rideIndex)
{ {
// The number of riders might have overflown or underflown. Re-calculate the value. // The number of riders might have overflown or underflown. Re-calculate the value.
uint16_t numRiders = 0; uint16_t numRiders = 0;
@ -1795,7 +1795,7 @@ namespace RCT2
dst->remaining_distance = src->remaining_distance; dst->remaining_distance = src->remaining_distance;
dst->velocity = src->velocity; dst->velocity = src->velocity;
dst->acceleration = src->acceleration; dst->acceleration = src->acceleration;
dst->ride = static_cast<ride_id_t>(src->ride); dst->ride = static_cast<RideId>(src->ride);
dst->vehicle_type = src->vehicle_type; dst->vehicle_type = src->vehicle_type;
dst->colours = src->colours; dst->colours = src->colours;
dst->track_progress = src->track_progress; dst->track_progress = src->track_progress;

View File

@ -135,7 +135,7 @@ RideManager::Iterator RideManager::end()
return RideManager::Iterator(*this, _rides.size(), _rides.size()); return RideManager::Iterator(*this, _rides.size(), _rides.size());
} }
ride_id_t GetNextFreeRideId() RideId GetNextFreeRideId()
{ {
size_t result = _rides.size(); size_t result = _rides.size();
for (size_t i = 0; i < _rides.size(); i++) for (size_t i = 0; i < _rides.size(); i++)
@ -150,10 +150,10 @@ ride_id_t GetNextFreeRideId()
{ {
return RIDE_ID_NULL; return RIDE_ID_NULL;
} }
return static_cast<ride_id_t>(result); return static_cast<RideId>(result);
} }
Ride* GetOrAllocateRide(ride_id_t index) Ride* GetOrAllocateRide(RideId index)
{ {
const auto idx = static_cast<size_t>(index); const auto idx = static_cast<size_t>(index);
if (_rides.size() <= idx) if (_rides.size() <= idx)
@ -166,7 +166,7 @@ Ride* GetOrAllocateRide(ride_id_t index)
return result; return result;
} }
Ride* get_ride(ride_id_t index) Ride* get_ride(RideId index)
{ {
const auto idx = static_cast<size_t>(index); const auto idx = static_cast<size_t>(index);
if (idx < _rides.size()) if (idx < _rides.size())
@ -2553,7 +2553,7 @@ static StationIndex ride_mode_check_station_present(Ride* ride)
* *
* rct2: 0x006B5872 * rct2: 0x006B5872
*/ */
static int32_t ride_check_for_entrance_exit(ride_id_t rideIndex) static int32_t ride_check_for_entrance_exit(RideId rideIndex)
{ {
auto ride = get_ride(rideIndex); auto ride = get_ride(rideIndex);
if (ride == nullptr) if (ride == nullptr)
@ -2642,7 +2642,7 @@ void Ride::ChainQueues() const
*/ */
static int32_t ride_check_block_brakes(CoordsXYE* input, CoordsXYE* output) static int32_t ride_check_block_brakes(CoordsXYE* input, CoordsXYE* output)
{ {
ride_id_t rideIndex = input->element->AsTrack()->GetRideIndex(); RideId rideIndex = input->element->AsTrack()->GetRideIndex();
rct_window* w = window_find_by_class(WC_RIDE_CONSTRUCTION); rct_window* w = window_find_by_class(WC_RIDE_CONSTRUCTION);
if (w != nullptr && _rideConstructionState != RideConstructionState::State0 && _currentRideIndex == rideIndex) if (w != nullptr && _rideConstructionState != RideConstructionState::State0 && _currentRideIndex == rideIndex)
ride_construction_invalidate_current_track(); ride_construction_invalidate_current_track();
@ -2702,7 +2702,7 @@ static bool ride_check_track_contains_inversions(CoordsXYE* input, CoordsXYE* ou
if (trackElement == nullptr) if (trackElement == nullptr)
return false; return false;
ride_id_t rideIndex = trackElement->GetRideIndex(); RideId rideIndex = trackElement->GetRideIndex();
auto ride = get_ride(rideIndex); auto ride = get_ride(rideIndex);
if (ride != nullptr && ride->type == RIDE_TYPE_MAZE) if (ride != nullptr && ride->type == RIDE_TYPE_MAZE)
return true; return true;
@ -2864,7 +2864,7 @@ static bool ride_check_start_and_end_is_station(CoordsXYE* input)
{ {
CoordsXYE trackBack, trackFront; CoordsXYE trackBack, trackFront;
ride_id_t rideIndex = input->element->AsTrack()->GetRideIndex(); RideId rideIndex = input->element->AsTrack()->GetRideIndex();
auto ride = get_ride(rideIndex); auto ride = get_ride(rideIndex);
if (ride == nullptr) if (ride == nullptr)
return false; return false;
@ -3014,7 +3014,7 @@ static void RideOpenBlockBrakes(CoordsXYE* startElement)
* *
* rct2: 0x006B4D26 * rct2: 0x006B4D26
*/ */
static void ride_set_start_finish_points(ride_id_t rideIndex, CoordsXYE* startElement) static void ride_set_start_finish_points(RideId rideIndex, CoordsXYE* startElement)
{ {
auto ride = get_ride(rideIndex); auto ride = get_ride(rideIndex);
if (ride == nullptr) if (ride == nullptr)
@ -3073,7 +3073,7 @@ static constexpr const CoordsXY word_9A2A60[] = {
* rct2: 0x006DD90D * rct2: 0x006DD90D
*/ */
static Vehicle* vehicle_create_car( static Vehicle* vehicle_create_car(
ride_id_t rideIndex, int32_t vehicleEntryIndex, int32_t carIndex, int32_t vehicleIndex, const CoordsXYZ& carPosition, RideId rideIndex, int32_t vehicleEntryIndex, int32_t carIndex, int32_t vehicleIndex, const CoordsXYZ& carPosition,
int32_t* remainingDistance, TrackElement* trackElement) int32_t* remainingDistance, TrackElement* trackElement)
{ {
if (trackElement == nullptr) if (trackElement == nullptr)
@ -3277,7 +3277,7 @@ static Vehicle* vehicle_create_car(
* rct2: 0x006DD84C * rct2: 0x006DD84C
*/ */
static train_ref vehicle_create_train( static train_ref vehicle_create_train(
ride_id_t rideIndex, const CoordsXYZ& trainPos, int32_t vehicleIndex, int32_t* remainingDistance, RideId rideIndex, const CoordsXYZ& trainPos, int32_t vehicleIndex, int32_t* remainingDistance,
TrackElement* trackElement) TrackElement* trackElement)
{ {
train_ref train = { nullptr, nullptr }; train_ref train = { nullptr, nullptr };
@ -3309,7 +3309,7 @@ static train_ref vehicle_create_train(
return train; return train;
} }
static bool vehicle_create_trains(ride_id_t rideIndex, const CoordsXYZ& trainsPos, TrackElement* trackElement) static bool vehicle_create_trains(RideId rideIndex, const CoordsXYZ& trainsPos, TrackElement* trackElement)
{ {
auto ride = get_ride(rideIndex); auto ride = get_ride(rideIndex);
if (ride == nullptr) if (ride == nullptr)
@ -3684,7 +3684,7 @@ static bool ride_initialise_cable_lift_track(Ride* ride, bool isApplying)
* *
* rct2: 0x006DF4D4 * rct2: 0x006DF4D4
*/ */
static bool ride_create_cable_lift(ride_id_t rideIndex, bool isApplying) static bool ride_create_cable_lift(RideId rideIndex, bool isApplying)
{ {
auto ride = get_ride(rideIndex); auto ride = get_ride(rideIndex);
if (ride == nullptr) if (ride == nullptr)
@ -4200,7 +4200,7 @@ static bool ride_with_colour_config_exists(uint8_t ride_type, const TrackColour*
return false; return false;
} }
bool Ride::NameExists(std::string_view name, ride_id_t excludeRideId) bool Ride::NameExists(std::string_view name, RideId excludeRideId)
{ {
char buffer[256]{}; char buffer[256]{};
for (auto& ride : GetRideManager()) for (auto& ride : GetRideManager())
@ -4947,7 +4947,7 @@ static int32_t ride_get_track_length(Ride* ride)
if (!foundTrack) if (!foundTrack)
return 0; return 0;
ride_id_t rideIndex = tileElement->AsTrack()->GetRideIndex(); RideId rideIndex = tileElement->AsTrack()->GetRideIndex();
rct_window* w = window_find_by_class(WC_RIDE_CONSTRUCTION); rct_window* w = window_find_by_class(WC_RIDE_CONSTRUCTION);
if (w != nullptr && _rideConstructionState != RideConstructionState::State0 && _currentRideIndex == rideIndex) if (w != nullptr && _rideConstructionState != RideConstructionState::State0 && _currentRideIndex == rideIndex)
@ -5790,7 +5790,7 @@ void Ride::UpdateRideTypeForAllPieces()
} }
} }
std::vector<ride_id_t> GetTracklessRides() std::vector<RideId> GetTracklessRides()
{ {
// Iterate map and build list of seen ride IDs // Iterate map and build list of seen ride IDs
std::vector<bool> seen; std::vector<bool> seen;
@ -5813,7 +5813,7 @@ std::vector<ride_id_t> GetTracklessRides()
// Get all rides that did not get seen during map iteration // Get all rides that did not get seen during map iteration
const auto& rideManager = GetRideManager(); const auto& rideManager = GetRideManager();
std::vector<ride_id_t> result; std::vector<RideId> result;
for (const auto& ride : rideManager) for (const auto& ride : rideManager)
{ {
if (seen.size() <= static_cast<size_t>(ride.id) || !seen[static_cast<size_t>(ride.id)]) if (seen.size() <= static_cast<size_t>(ride.id) || !seen[static_cast<size_t>(ride.id)])

View File

@ -105,7 +105,7 @@ enum class RideStatus : uint8_t;
*/ */
struct Ride struct Ride
{ {
ride_id_t id = RIDE_ID_NULL; RideId id = RIDE_ID_NULL;
uint8_t type = RIDE_TYPE_NULL; uint8_t type = RIDE_TYPE_NULL;
// pointer to static info. for example, wild mouse type is 0x36, subtype is // pointer to static info. for example, wild mouse type is 0x36, subtype is
// 0x4c. // 0x4c.
@ -343,7 +343,7 @@ public:
void FormatStatusTo(Formatter&) const; void FormatStatusTo(Formatter&) const;
static void UpdateAll(); static void UpdateAll();
static bool NameExists(std::string_view name, ride_id_t excludeRideId = RIDE_ID_NULL); static bool NameExists(std::string_view name, RideId excludeRideId = RIDE_ID_NULL);
[[nodiscard]] std::unique_ptr<TrackDesign> SaveToTrackDesign(TrackDesignState& tds) const; [[nodiscard]] std::unique_ptr<TrackDesign> SaveToTrackDesign(TrackDesignState& tds) const;
@ -868,16 +868,16 @@ enum
constexpr uint32_t CONSTRUCTION_LIFT_HILL_SELECTED = 1 << 0; constexpr uint32_t CONSTRUCTION_LIFT_HILL_SELECTED = 1 << 0;
constexpr uint32_t CONSTRUCTION_INVERTED_TRACK_SELECTED = 1 << 1; constexpr uint32_t CONSTRUCTION_INVERTED_TRACK_SELECTED = 1 << 1;
Ride* get_ride(ride_id_t index); Ride* get_ride(RideId index);
struct RideManager struct RideManager
{ {
const Ride* operator[](ride_id_t id) const const Ride* operator[](RideId id) const
{ {
return get_ride(id); return get_ride(id);
} }
Ride* operator[](ride_id_t id) Ride* operator[](RideId id)
{ {
return get_ride(id); return get_ride(id);
} }
@ -904,7 +904,7 @@ struct RideManager
, _index(beginIndex) , _index(beginIndex)
, _endIndex(endIndex) , _endIndex(endIndex)
{ {
if (_index < _endIndex && (*_rideManager)[static_cast<ride_id_t>(_index)] == nullptr) if (_index < _endIndex && (*_rideManager)[static_cast<RideId>(_index)] == nullptr)
{ {
++(*this); ++(*this);
} }
@ -916,7 +916,7 @@ struct RideManager
do do
{ {
_index++; _index++;
} while (_index < _endIndex && (*_rideManager)[static_cast<ride_id_t>(_index)] == nullptr); } while (_index < _endIndex && (*_rideManager)[static_cast<RideId>(_index)] == nullptr);
return *this; return *this;
} }
Iterator operator++(int) Iterator operator++(int)
@ -935,7 +935,7 @@ struct RideManager
} }
Ride& operator*() Ride& operator*()
{ {
return *(*_rideManager)[static_cast<ride_id_t>(_index)]; return *(*_rideManager)[static_cast<RideId>(_index)];
} }
}; };
@ -953,8 +953,8 @@ struct RideManager
}; };
RideManager GetRideManager(); RideManager GetRideManager();
ride_id_t GetNextFreeRideId(); RideId GetNextFreeRideId();
Ride* GetOrAllocateRide(ride_id_t index); Ride* GetOrAllocateRide(RideId index);
rct_ride_entry* get_ride_entry(ObjectEntryIndex index); rct_ride_entry* get_ride_entry(ObjectEntryIndex index);
std::string_view get_ride_entry_name(ObjectEntryIndex index); std::string_view get_ride_entry_name(ObjectEntryIndex index);
@ -1034,8 +1034,8 @@ void ride_update_vehicle_colours(Ride* ride);
uint64_t ride_entry_get_supported_track_pieces(const rct_ride_entry* rideEntry); uint64_t ride_entry_get_supported_track_pieces(const rct_ride_entry* rideEntry);
enum class RideSetSetting : uint8_t; enum class RideSetSetting : uint8_t;
money32 set_operating_setting(ride_id_t rideId, RideSetSetting setting, uint8_t value); money32 set_operating_setting(RideId rideId, RideSetSetting setting, uint8_t value);
money32 set_operating_setting_nested(ride_id_t rideId, RideSetSetting setting, uint8_t value, uint8_t flags); money32 set_operating_setting_nested(RideId rideId, RideSetSetting setting, uint8_t value, uint8_t flags);
void UpdateGhostTrackAndArrow(); void UpdateGhostTrackAndArrow();
@ -1070,6 +1070,6 @@ void ride_action_modify(Ride* ride, int32_t modifyType, int32_t flags);
void determine_ride_entrance_and_exit_locations(); void determine_ride_entrance_and_exit_locations();
void ride_clear_leftover_entrances(Ride* ride); void ride_clear_leftover_entrances(Ride* ride);
std::vector<ride_id_t> GetTracklessRides(); std::vector<RideId> GetTracklessRides();
void ride_remove_vehicles(Ride* ride); void ride_remove_vehicles(Ride* ride);

View File

@ -35,7 +35,7 @@ namespace OpenRCT2::RideAudio
*/ */
struct ViewportRideMusicInstance struct ViewportRideMusicInstance
{ {
ride_id_t RideId; RideId RideId;
uint8_t TrackIndex{}; uint8_t TrackIndex{};
size_t Offset{}; size_t Offset{};
@ -49,7 +49,7 @@ namespace OpenRCT2::RideAudio
*/ */
struct RideMusicChannel struct RideMusicChannel
{ {
ride_id_t RideId{}; RideId RideId{};
uint8_t TrackIndex{}; uint8_t TrackIndex{};
size_t Offset{}; size_t Offset{};

View File

@ -59,7 +59,7 @@ uint16_t _numCurrentPossibleSpecialTrackPieces;
uint32_t _currentTrackCurve; uint32_t _currentTrackCurve;
RideConstructionState _rideConstructionState; RideConstructionState _rideConstructionState;
ride_id_t _currentRideIndex; RideId _currentRideIndex;
CoordsXYZ _currentTrackBegin; CoordsXYZ _currentTrackBegin;
@ -86,7 +86,7 @@ CoordsXYZD _unkF440C5;
ObjectEntryIndex gLastEntranceStyle; ObjectEntryIndex gLastEntranceStyle;
uint8_t gRideEntranceExitPlaceType; uint8_t gRideEntranceExitPlaceType;
ride_id_t gRideEntranceExitPlaceRideIndex; RideId gRideEntranceExitPlaceRideIndex;
StationIndex gRideEntranceExitPlaceStationIndex; StationIndex gRideEntranceExitPlaceStationIndex;
RideConstructionState gRideEntranceExitPlacePreviousRideConstructionState; RideConstructionState gRideEntranceExitPlacePreviousRideConstructionState;
Direction gRideEntranceExitPlaceDirection; Direction gRideEntranceExitPlaceDirection;
@ -122,7 +122,7 @@ static int32_t ride_check_if_construction_allowed(Ride* ride)
return 1; return 1;
} }
static rct_window* ride_create_or_find_construction_window(ride_id_t rideIndex) static rct_window* ride_create_or_find_construction_window(RideId rideIndex)
{ {
auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); auto windowManager = GetContext()->GetUiContext()->GetWindowManager();
auto intent = Intent(INTENT_ACTION_RIDE_CONSTRUCTION_FOCUS); auto intent = Intent(INTENT_ACTION_RIDE_CONSTRUCTION_FOCUS);
@ -463,7 +463,7 @@ void ride_restore_provisional_track_piece()
{ {
if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_TRACK) if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_TRACK)
{ {
ride_id_t rideIndex; RideId rideIndex;
int32_t direction, type, liftHillAndAlternativeState; int32_t direction, type, liftHillAndAlternativeState;
CoordsXYZ trackPos; CoordsXYZ trackPos;
if (window_ride_construction_update_state( if (window_ride_construction_update_state(
@ -1187,14 +1187,14 @@ int32_t ride_get_refund_price(const Ride* ride)
return cost; return cost;
} }
money32 set_operating_setting(ride_id_t rideId, RideSetSetting setting, uint8_t value) money32 set_operating_setting(RideId rideId, RideSetSetting setting, uint8_t value)
{ {
auto rideSetSetting = RideSetSettingAction(rideId, setting, value); auto rideSetSetting = RideSetSettingAction(rideId, setting, value);
auto res = GameActions::Execute(&rideSetSetting); auto res = GameActions::Execute(&rideSetSetting);
return res.Error == GameActions::Status::Ok ? 0 : MONEY32_UNDEFINED; return res.Error == GameActions::Status::Ok ? 0 : MONEY32_UNDEFINED;
} }
money32 set_operating_setting_nested(ride_id_t rideId, RideSetSetting setting, uint8_t value, uint8_t flags) money32 set_operating_setting_nested(RideId rideId, RideSetSetting setting, uint8_t value, uint8_t flags)
{ {
auto rideSetSetting = RideSetSettingAction(rideId, setting, value); auto rideSetSetting = RideSetSettingAction(rideId, setting, value);
rideSetSetting.SetFlags(flags); rideSetSetting.SetFlags(flags);

View File

@ -17,7 +17,7 @@
#include <optional> #include <optional>
using track_type_t = uint16_t; using track_type_t = uint16_t;
enum class ride_id_t : uint16_t; enum class RideId : uint16_t;
struct TileElement; struct TileElement;
struct CoordsXYE; struct CoordsXYE;
@ -44,7 +44,7 @@ extern uint16_t _numCurrentPossibleSpecialTrackPieces;
extern uint32_t _currentTrackCurve; extern uint32_t _currentTrackCurve;
extern RideConstructionState _rideConstructionState; extern RideConstructionState _rideConstructionState;
extern ride_id_t _currentRideIndex; extern RideId _currentRideIndex;
extern CoordsXYZ _currentTrackBegin; extern CoordsXYZ _currentTrackBegin;
@ -69,7 +69,7 @@ extern uint8_t _currentSeatRotationAngle;
extern CoordsXYZD _unkF440C5; extern CoordsXYZD _unkF440C5;
extern uint8_t gRideEntranceExitPlaceType; extern uint8_t gRideEntranceExitPlaceType;
extern ride_id_t gRideEntranceExitPlaceRideIndex; extern RideId gRideEntranceExitPlaceRideIndex;
extern StationIndex gRideEntranceExitPlaceStationIndex; extern StationIndex gRideEntranceExitPlaceStationIndex;
extern RideConstructionState gRideEntranceExitPlacePreviousRideConstructionState; extern RideConstructionState gRideEntranceExitPlacePreviousRideConstructionState;
extern uint8_t gRideEntranceExitPlaceDirection; extern uint8_t gRideEntranceExitPlaceDirection;

View File

@ -160,10 +160,10 @@ static void ride_ratings_update_state(RideRatingUpdateState& state)
*/ */
static void ride_ratings_update_state_0(RideRatingUpdateState& state) static void ride_ratings_update_state_0(RideRatingUpdateState& state)
{ {
ride_id_t currentRide = state.CurrentRide; RideId currentRide = state.CurrentRide;
currentRide = static_cast<ride_id_t>(EnumValue(currentRide) + 1); currentRide = static_cast<RideId>(EnumValue(currentRide) + 1);
if (currentRide >= static_cast<ride_id_t>(OpenRCT2::Limits::MaxRidesInPark)) if (currentRide >= static_cast<RideId>(OpenRCT2::Limits::MaxRidesInPark))
{ {
currentRide = {}; currentRide = {};
} }
@ -200,7 +200,7 @@ static void ride_ratings_update_state_1(RideRatingUpdateState& state)
*/ */
static void ride_ratings_update_state_2(RideRatingUpdateState& state) static void ride_ratings_update_state_2(RideRatingUpdateState& state)
{ {
const ride_id_t rideIndex = state.CurrentRide; const RideId rideIndex = state.CurrentRide;
auto ride = get_ride(rideIndex); auto ride = get_ride(rideIndex);
if (ride == nullptr || ride->status == RideStatus::Closed || ride->type >= RIDE_TYPE_COUNT) if (ride == nullptr || ride->status == RideStatus::Closed || ride->type >= RIDE_TYPE_COUNT)
{ {

View File

@ -43,7 +43,7 @@ struct RideRatingUpdateState
{ {
CoordsXYZ Proximity; CoordsXYZ Proximity;
CoordsXYZ ProximityStart; CoordsXYZ ProximityStart;
ride_id_t CurrentRide; RideId CurrentRide;
uint8_t State; uint8_t State;
track_type_t ProximityTrackType; track_type_t ProximityTrackType;
uint8_t ProximityBaseHeight; uint8_t ProximityBaseHeight;

View File

@ -15,10 +15,10 @@
#include <limits> #include <limits>
#include <type_traits> #include <type_traits>
enum class ride_id_t : uint16_t; enum class RideId : uint16_t;
struct Ride; struct Ride;
constexpr const ride_id_t RIDE_ID_NULL = static_cast<ride_id_t>(std::numeric_limits<std::underlying_type_t<ride_id_t>>::max()); constexpr const RideId RIDE_ID_NULL = static_cast<RideId>(std::numeric_limits<std::underlying_type_t<RideId>>::max());
using ride_type_t = uint16_t; using ride_type_t = uint16_t;

View File

@ -70,7 +70,7 @@ int32_t track_is_connected_by_shape(TileElement* a, TileElement* b)
return aBank == bBank && aAngle == bAngle; return aBank == bBank && aAngle == bAngle;
} }
static TileElement* find_station_element(const CoordsXYZD& loc, ride_id_t rideIndex) static TileElement* find_station_element(const CoordsXYZD& loc, RideId rideIndex)
{ {
TileElement* tileElement = map_get_first_element_at(loc); TileElement* tileElement = map_get_first_element_at(loc);
if (tileElement == nullptr) if (tileElement == nullptr)
@ -111,7 +111,7 @@ static void ride_remove_station(Ride* ride, const CoordsXYZ& location)
* *
* rct2: 0x006C4D89 * rct2: 0x006C4D89
*/ */
bool track_add_station_element(CoordsXYZD loc, ride_id_t rideIndex, int32_t flags, bool fromTrackDesign) bool track_add_station_element(CoordsXYZD loc, RideId rideIndex, int32_t flags, bool fromTrackDesign)
{ {
auto ride = get_ride(rideIndex); auto ride = get_ride(rideIndex);
if (ride == nullptr) if (ride == nullptr)
@ -262,7 +262,7 @@ bool track_add_station_element(CoordsXYZD loc, ride_id_t rideIndex, int32_t flag
* *
* rct2: 0x006C494B * rct2: 0x006C494B
*/ */
bool track_remove_station_element(const CoordsXYZD& loc, ride_id_t rideIndex, int32_t flags) bool track_remove_station_element(const CoordsXYZD& loc, RideId rideIndex, int32_t flags)
{ {
auto ride = get_ride(rideIndex); auto ride = get_ride(rideIndex);
if (ride == nullptr) if (ride == nullptr)
@ -783,12 +783,12 @@ void TrackElement::SetDoorBState(uint8_t newState)
ColourScheme |= ((newState << 5) & TRACK_ELEMENT_COLOUR_DOOR_B_MASK); ColourScheme |= ((newState << 5) & TRACK_ELEMENT_COLOUR_DOOR_B_MASK);
} }
ride_id_t TrackElement::GetRideIndex() const RideId TrackElement::GetRideIndex() const
{ {
return RideIndex; return RideIndex;
} }
void TrackElement::SetRideIndex(ride_id_t newRideIndex) void TrackElement::SetRideIndex(RideId newRideIndex)
{ {
RideIndex = newRideIndex; RideIndex = newRideIndex;
} }

View File

@ -574,9 +574,9 @@ roll_type_t track_get_actual_bank(TileElement* tileElement, roll_type_t bank);
roll_type_t track_get_actual_bank_2(int32_t rideType, bool isInverted, roll_type_t bank); roll_type_t track_get_actual_bank_2(int32_t rideType, bool isInverted, roll_type_t bank);
roll_type_t track_get_actual_bank_3(bool useInvertedSprites, TileElement* tileElement); roll_type_t track_get_actual_bank_3(bool useInvertedSprites, TileElement* tileElement);
bool track_add_station_element(CoordsXYZD loc, ride_id_t rideIndex, int32_t flags, bool fromTrackDesign); bool track_add_station_element(CoordsXYZD loc, RideId rideIndex, int32_t flags, bool fromTrackDesign);
bool track_remove_station_element(const CoordsXYZD& loc, ride_id_t rideIndex, int32_t flags); bool track_remove_station_element(const CoordsXYZD& loc, RideId rideIndex, int32_t flags);
money32 maze_set_track(const CoordsXYZD& coords, uint8_t flags, bool initialPlacement, ride_id_t rideIndex, uint8_t mode); money32 maze_set_track(const CoordsXYZD& coords, uint8_t flags, bool initialPlacement, RideId rideIndex, uint8_t mode);
bool TrackTypeHasSpeedSetting(track_type_t trackType); bool TrackTypeHasSpeedSetting(track_type_t trackType);

View File

@ -1917,7 +1917,7 @@ int32_t TrackDesignGetZPlacement(TrackDesign* td6, Ride* ride, const CoordsXYZ&
return TrackDesignGetZPlacement(tds, td6, ride, coords); return TrackDesignGetZPlacement(tds, td6, ride, coords);
} }
static money32 TrackDesignCreateRide(int32_t type, int32_t subType, int32_t flags, ride_id_t* outRideIndex) static money32 TrackDesignCreateRide(int32_t type, int32_t subType, int32_t flags, RideId* outRideIndex)
{ {
// Don't set colours as will be set correctly later. // Don't set colours as will be set correctly later.
auto gameAction = RideCreateAction(type, subType, 0, 0, gLastEntranceStyle); auto gameAction = RideCreateAction(type, subType, 0, 0, gLastEntranceStyle);
@ -1931,7 +1931,7 @@ static money32 TrackDesignCreateRide(int32_t type, int32_t subType, int32_t flag
return MONEY32_UNDEFINED; return MONEY32_UNDEFINED;
} }
*outRideIndex = res.GetData<ride_id_t>(); *outRideIndex = res.GetData<RideId>();
return res.Cost; return res.Cost;
} }
@ -1950,7 +1950,7 @@ static bool TrackDesignPlacePreview(TrackDesignState& tds, TrackDesign* td6, mon
auto& objManager = GetContext()->GetObjectManager(); auto& objManager = GetContext()->GetObjectManager();
auto entry_index = objManager.GetLoadedObjectEntryIndex(td6->vehicle_object); auto entry_index = objManager.GetLoadedObjectEntryIndex(td6->vehicle_object);
ride_id_t rideIndex; RideId rideIndex;
uint8_t rideCreateFlags = GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_NO_SPEND; uint8_t rideCreateFlags = GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_NO_SPEND;
if (TrackDesignCreateRide(td6->type, entry_index, rideCreateFlags, &rideIndex) == MONEY32_UNDEFINED) if (TrackDesignCreateRide(td6->type, entry_index, rideCreateFlags, &rideIndex) == MONEY32_UNDEFINED)
{ {

View File

@ -208,7 +208,7 @@ enum
MAZE_ELEMENT_TYPE_EXIT = (1 << 7) MAZE_ELEMENT_TYPE_EXIT = (1 << 7)
}; };
static constexpr ride_id_t PreviewRideId = static_cast<ride_id_t>(0); static constexpr RideId PreviewRideId = static_cast<RideId>(0);
extern bool gTrackDesignSceneryToggle; extern bool gTrackDesignSceneryToggle;
@ -216,7 +216,7 @@ extern bool _trackDesignDrawingPreview;
extern bool _trackDesignPlaceStateSceneryUnavailable; extern bool _trackDesignPlaceStateSceneryUnavailable;
extern bool gTrackDesignSaveMode; extern bool gTrackDesignSaveMode;
extern ride_id_t gTrackDesignSaveRideIndex; extern RideId gTrackDesignSaveRideIndex;
[[nodiscard]] std::unique_ptr<TrackDesign> TrackDesignImport(const utf8* path); [[nodiscard]] std::unique_ptr<TrackDesign> TrackDesignImport(const utf8* path);
@ -238,7 +238,7 @@ void TrackDesignDrawPreview(TrackDesign* td6, uint8_t* pixels);
void track_design_save_init(); void track_design_save_init();
void track_design_save_reset_scenery(); void track_design_save_reset_scenery();
bool track_design_save_contains_tile_element(const TileElement* tileElement); bool track_design_save_contains_tile_element(const TileElement* tileElement);
void track_design_save_select_nearby_scenery(ride_id_t rideIndex); void track_design_save_select_nearby_scenery(RideId rideIndex);
void track_design_save_select_tile_element( void track_design_save_select_tile_element(
ViewportInteractionItem interactionType, const CoordsXY& loc, TileElement* tileElement, bool collect); ViewportInteractionItem interactionType, const CoordsXY& loc, TileElement* tileElement, bool collect);

View File

@ -41,7 +41,7 @@ constexpr size_t TRACK_MAX_SAVED_TILE_ELEMENTS = 1500;
constexpr int32_t TRACK_NEARBY_SCENERY_DISTANCE = 1; constexpr int32_t TRACK_NEARBY_SCENERY_DISTANCE = 1;
bool gTrackDesignSaveMode = false; bool gTrackDesignSaveMode = false;
ride_id_t gTrackDesignSaveRideIndex = RIDE_ID_NULL; RideId gTrackDesignSaveRideIndex = RIDE_ID_NULL;
std::vector<const TileElement*> _trackSavedTileElements; std::vector<const TileElement*> _trackSavedTileElements;
std::vector<TrackDesignSceneryElement> _trackSavedTileElementsDesc; std::vector<TrackDesignSceneryElement> _trackSavedTileElementsDesc;
@ -62,8 +62,8 @@ struct TrackDesignAddStatus
} }
}; };
static bool track_design_save_should_select_scenery_around(ride_id_t rideIndex, TileElement* tileElement); static bool track_design_save_should_select_scenery_around(RideId rideIndex, TileElement* tileElement);
static void track_design_save_select_nearby_scenery_for_tile(ride_id_t rideIndex, int32_t cx, int32_t cy); static void track_design_save_select_nearby_scenery_for_tile(RideId rideIndex, int32_t cx, int32_t cy);
static TrackDesignAddStatus track_design_save_add_tile_element( static TrackDesignAddStatus track_design_save_add_tile_element(
ViewportInteractionItem interactionType, const CoordsXY& loc, TileElement* tileElement); ViewportInteractionItem interactionType, const CoordsXY& loc, TileElement* tileElement);
static void track_design_save_remove_tile_element( static void track_design_save_remove_tile_element(
@ -106,7 +106,7 @@ void track_design_save_select_tile_element(
* *
* rct2: 0x006D303D * rct2: 0x006D303D
*/ */
void track_design_save_select_nearby_scenery(ride_id_t rideIndex) void track_design_save_select_nearby_scenery(RideId rideIndex)
{ {
tile_element_iterator it; tile_element_iterator it;
tile_element_iterator_begin(&it); tile_element_iterator_begin(&it);
@ -583,7 +583,7 @@ static void track_design_save_remove_tile_element(
} }
} }
static bool track_design_save_should_select_scenery_around(ride_id_t rideIndex, TileElement* tileElement) static bool track_design_save_should_select_scenery_around(RideId rideIndex, TileElement* tileElement)
{ {
switch (tileElement->GetType()) switch (tileElement->GetType())
{ {
@ -610,7 +610,7 @@ static bool track_design_save_should_select_scenery_around(ride_id_t rideIndex,
return false; return false;
} }
static void track_design_save_select_nearby_scenery_for_tile(ride_id_t rideIndex, int32_t cx, int32_t cy) static void track_design_save_select_nearby_scenery_for_tile(RideId rideIndex, int32_t cx, int32_t cy)
{ {
TileElement* tileElement; TileElement* tileElement;

View File

@ -2189,7 +2189,7 @@ void track_paint_util_left_corkscrew_up_supports(paint_session& session, Directi
*/ */
void PaintTrack(paint_session& session, Direction direction, int32_t height, const TrackElement& trackElement) void PaintTrack(paint_session& session, Direction direction, int32_t height, const TrackElement& trackElement)
{ {
ride_id_t rideIndex = trackElement.GetRideIndex(); RideId rideIndex = trackElement.GetRideIndex();
auto ride = get_ride(rideIndex); auto ride = get_ride(rideIndex);
if (ride == nullptr) if (ride == nullptr)
{ {

View File

@ -2577,7 +2577,7 @@ void Vehicle::UpdateWaitingToDepart()
struct rct_synchronised_vehicle struct rct_synchronised_vehicle
{ {
ride_id_t ride_id; RideId ride_id;
StationIndex stationIndex; StationIndex stationIndex;
uint16_t vehicle_id; uint16_t vehicle_id;
}; };
@ -2765,7 +2765,7 @@ static bool ride_station_can_depart_synchronised(const Ride& ride, StationIndex
if (!(sv_ride->stations[sv->stationIndex].Depart & STATION_DEPART_FLAG)) if (!(sv_ride->stations[sv->stationIndex].Depart & STATION_DEPART_FLAG))
{ {
sv = _synchronisedVehicles; sv = _synchronisedVehicles;
ride_id_t rideId = RIDE_ID_NULL; RideId rideId = RIDE_ID_NULL;
for (; sv < _lastSynchronisedVehicle; sv++) for (; sv < _lastSynchronisedVehicle; sv++)
{ {
if (rideId == RIDE_ID_NULL) if (rideId == RIDE_ID_NULL)
@ -2811,7 +2811,7 @@ static bool ride_station_can_depart_synchronised(const Ride& ride, StationIndex
// Sync condition: there are at least 3 stations to sync // Sync condition: there are at least 3 stations to sync
return false; return false;
} }
ride_id_t someRideIndex = _synchronisedVehicles[0].ride_id; RideId someRideIndex = _synchronisedVehicles[0].ride_id;
if (someRideIndex != ride.id) if (someRideIndex != ride.id)
{ {
// Sync condition: the first station to sync is a different ride // Sync condition: the first station to sync is a different ride
@ -6397,7 +6397,7 @@ bool Vehicle::DodgemsCarWouldCollideAt(const CoordsXY& coords, uint16_t* collide
auto location = coords; auto location = coords;
ride_id_t rideIndex = ride; RideId rideIndex = ride;
for (auto xy_offset : SurroundingTiles) for (auto xy_offset : SurroundingTiles)
{ {
location += xy_offset; location += xy_offset;

View File

@ -106,7 +106,7 @@ struct Vehicle : EntityBase
int32_t remaining_distance; int32_t remaining_distance;
int32_t velocity; int32_t velocity;
int32_t acceleration; int32_t acceleration;
ride_id_t ride; RideId ride;
uint8_t vehicle_type; uint8_t vehicle_type;
rct_vehicle_colour colours; rct_vehicle_colour colours;
union union

View File

@ -891,7 +891,7 @@ DukValue ScriptEngine::GameActionResultToDuk(const GameAction& action, const Gam
{ {
if (result.Error == GameActions::Status::Ok) if (result.Error == GameActions::Status::Ok)
{ {
const auto rideIndex = result.GetData<ride_id_t>(); const auto rideIndex = result.GetData<RideId>();
obj.Set("ride", EnumValue(rideIndex)); obj.Set("ride", EnumValue(rideIndex));
} }
} }

View File

@ -146,7 +146,7 @@ namespace OpenRCT2::Scripting
auto vehicle = GetVehicle(); auto vehicle = GetVehicle();
if (vehicle != nullptr) if (vehicle != nullptr)
{ {
vehicle->ride = static_cast<ride_id_t>(value); vehicle->ride = static_cast<RideId>(value);
} }
} }

View File

@ -20,7 +20,7 @@
namespace OpenRCT2::Scripting namespace OpenRCT2::Scripting
{ {
ScRide::ScRide(ride_id_t rideId) ScRide::ScRide(RideId rideId)
: _rideId(rideId) : _rideId(rideId)
{ {
} }

View File

@ -60,10 +60,10 @@ namespace OpenRCT2::Scripting
class ScRide class ScRide
{ {
private: private:
ride_id_t _rideId = RIDE_ID_NULL; RideId _rideId = RIDE_ID_NULL;
public: public:
ScRide(ride_id_t rideId); ScRide(RideId rideId);
private: private:
int32_t id_get() const; int32_t id_get() const;

View File

@ -20,7 +20,7 @@
namespace OpenRCT2::Scripting namespace OpenRCT2::Scripting
{ {
ScRideStation::ScRideStation(ride_id_t rideId, StationIndex stationIndex) ScRideStation::ScRideStation(RideId rideId, StationIndex stationIndex)
: _rideId(rideId) : _rideId(rideId)
, _stationIndex(stationIndex) , _stationIndex(stationIndex)
{ {

View File

@ -21,11 +21,11 @@ namespace OpenRCT2::Scripting
class ScRideStation class ScRideStation
{ {
private: private:
ride_id_t _rideId = RIDE_ID_NULL; RideId _rideId = RIDE_ID_NULL;
StationIndex _stationIndex{}; StationIndex _stationIndex{};
public: public:
ScRideStation(ride_id_t rideId, StationIndex stationIndex); ScRideStation(RideId rideId, StationIndex stationIndex);
static void Register(duk_context* ctx); static void Register(duk_context* ctx);

View File

@ -69,7 +69,7 @@ namespace OpenRCT2::Scripting
std::shared_ptr<ScRide> ScMap::getRide(int32_t id) const std::shared_ptr<ScRide> ScMap::getRide(int32_t id) const
{ {
auto rideManager = GetRideManager(); auto rideManager = GetRideManager();
auto ride = rideManager[static_cast<ride_id_t>(id)]; auto ride = rideManager[static_cast<RideId>(id)];
if (ride != nullptr) if (ride != nullptr)
{ {
return std::make_shared<ScRide>(ride->id); return std::make_shared<ScRide>(ride->id);

View File

@ -488,7 +488,7 @@ namespace OpenRCT2::Scripting
if (el->IsQueue()) if (el->IsQueue())
{ {
if (value.type() == DukValue::Type::NUMBER) if (value.type() == DukValue::Type::NUMBER)
el->SetRideIndex(static_cast<ride_id_t>(value.as_uint())); el->SetRideIndex(static_cast<RideId>(value.as_uint()));
else else
el->SetRideIndex(RIDE_ID_NULL); el->SetRideIndex(RIDE_ID_NULL);
Invalidate(); Invalidate();
@ -500,7 +500,7 @@ namespace OpenRCT2::Scripting
if (value.type() == DukValue::Type::NUMBER) if (value.type() == DukValue::Type::NUMBER)
{ {
auto el = _element->AsTrack(); auto el = _element->AsTrack();
el->SetRideIndex(static_cast<ride_id_t>(value.as_uint())); el->SetRideIndex(static_cast<RideId>(value.as_uint()));
Invalidate(); Invalidate();
} }
break; break;
@ -510,7 +510,7 @@ namespace OpenRCT2::Scripting
if (value.type() == DukValue::Type::NUMBER) if (value.type() == DukValue::Type::NUMBER)
{ {
auto el = _element->AsEntrance(); auto el = _element->AsEntrance();
el->SetRideIndex(static_cast<ride_id_t>(value.as_uint())); el->SetRideIndex(static_cast<RideId>(value.as_uint()));
Invalidate(); Invalidate();
} }
break; break;

View File

@ -44,7 +44,7 @@ bool _deferClose;
* rct2: 0x006CA162 * rct2: 0x006CA162
*/ */
money32 place_provisional_track_piece( money32 place_provisional_track_piece(
ride_id_t rideIndex, int32_t trackType, int32_t trackDirection, int32_t liftHillAndAlternativeState, RideId rideIndex, int32_t trackType, int32_t trackDirection, int32_t liftHillAndAlternativeState,
const CoordsXYZ& trackPos) const CoordsXYZ& trackPos)
{ {
auto ride = get_ride(rideIndex); auto ride = get_ride(rideIndex);
@ -238,10 +238,10 @@ static std::tuple<bool, track_type_t> window_ride_construction_update_state_get_
* @return (CF) * @return (CF)
*/ */
bool window_ride_construction_update_state( bool window_ride_construction_update_state(
int32_t* _trackType, int32_t* _trackDirection, ride_id_t* _rideIndex, int32_t* _liftHillAndInvertedState, int32_t* _trackType, int32_t* _trackDirection, RideId* _rideIndex, int32_t* _liftHillAndInvertedState,
CoordsXYZ* _trackPos, int32_t* _properties) CoordsXYZ* _trackPos, int32_t* _properties)
{ {
ride_id_t rideIndex; RideId rideIndex;
uint8_t trackDirection; uint8_t trackDirection;
uint16_t x, y, liftHillAndInvertedState, properties; uint16_t x, y, liftHillAndInvertedState, properties;

View File

@ -87,10 +87,10 @@ void Banner::FormatTextTo(Formatter& ft) const
* *
* rct2: 0x006B7EAB * rct2: 0x006B7EAB
*/ */
static ride_id_t banner_get_ride_index_at(const CoordsXYZ& bannerCoords) static RideId banner_get_ride_index_at(const CoordsXYZ& bannerCoords)
{ {
TileElement* tileElement = map_get_first_element_at(bannerCoords); TileElement* tileElement = map_get_first_element_at(bannerCoords);
ride_id_t resultRideIndex = RIDE_ID_NULL; RideId resultRideIndex = RIDE_ID_NULL;
if (tileElement == nullptr) if (tileElement == nullptr)
return resultRideIndex; return resultRideIndex;
do do
@ -98,7 +98,7 @@ static ride_id_t banner_get_ride_index_at(const CoordsXYZ& bannerCoords)
if (tileElement->GetType() != TileElementType::Track) if (tileElement->GetType() != TileElementType::Track)
continue; continue;
ride_id_t rideIndex = tileElement->AsTrack()->GetRideIndex(); RideId rideIndex = tileElement->AsTrack()->GetRideIndex();
auto ride = get_ride(rideIndex); auto ride = get_ride(rideIndex);
if (ride == nullptr || ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP)) if (ride == nullptr || ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP))
continue; continue;
@ -193,7 +193,7 @@ WallElement* banner_get_scrolling_wall_tile_element(BannerIndex bannerIndex)
* *
* rct2: 0x006B7D86 * rct2: 0x006B7D86
*/ */
ride_id_t banner_get_closest_ride_index(const CoordsXYZ& mapPos) RideId banner_get_closest_ride_index(const CoordsXYZ& mapPos)
{ {
static constexpr const std::array NeighbourCheckOrder = { static constexpr const std::array NeighbourCheckOrder = {
CoordsXY{ COORDS_XY_STEP, 0 }, CoordsXY{ COORDS_XY_STEP, 0 },
@ -209,7 +209,7 @@ ride_id_t banner_get_closest_ride_index(const CoordsXYZ& mapPos)
for (const auto& neighhbourCoords : NeighbourCheckOrder) for (const auto& neighhbourCoords : NeighbourCheckOrder)
{ {
ride_id_t rideIndex = banner_get_ride_index_at({ CoordsXY{ mapPos } + neighhbourCoords, mapPos.z }); RideId rideIndex = banner_get_ride_index_at({ CoordsXY{ mapPos } + neighhbourCoords, mapPos.z });
if (rideIndex != RIDE_ID_NULL) if (rideIndex != RIDE_ID_NULL)
{ {
return rideIndex; return rideIndex;
@ -371,7 +371,7 @@ void UnlinkAllRideBanners()
} }
} }
void UnlinkAllBannersForRide(ride_id_t rideId) void UnlinkAllBannersForRide(RideId rideId)
{ {
for (auto& banner : _banners) for (auto& banner : _banners)
{ {

View File

@ -32,7 +32,7 @@ struct Banner
uint8_t flags{}; uint8_t flags{};
std::string text; std::string text;
uint8_t colour{}; uint8_t colour{};
ride_id_t ride_index{}; RideId ride_index{};
uint8_t text_colour{}; uint8_t text_colour{};
TileCoordsXY position; TileCoordsXY position;
@ -57,11 +57,11 @@ enum BANNER_FLAGS
void banner_init(); void banner_init();
TileElement* banner_get_tile_element(BannerIndex bannerIndex); TileElement* banner_get_tile_element(BannerIndex bannerIndex);
WallElement* banner_get_scrolling_wall_tile_element(BannerIndex bannerIndex); WallElement* banner_get_scrolling_wall_tile_element(BannerIndex bannerIndex);
ride_id_t banner_get_closest_ride_index(const CoordsXYZ& mapPos); RideId banner_get_closest_ride_index(const CoordsXYZ& mapPos);
void banner_reset_broken_index(); void banner_reset_broken_index();
void fix_duplicated_banners(); void fix_duplicated_banners();
void UnlinkAllRideBanners(); void UnlinkAllRideBanners();
void UnlinkAllBannersForRide(ride_id_t rideId); void UnlinkAllBannersForRide(RideId rideId);
Banner* GetBanner(BannerIndex id); Banner* GetBanner(BannerIndex id);
Banner* GetOrCreateBanner(BannerIndex id); Banner* GetOrCreateBanner(BannerIndex id);
Banner* CreateBanner(); Banner* CreateBanner();

View File

@ -40,7 +40,7 @@ CoordsXYZD gRideEntranceExitGhostPosition;
StationIndex gRideEntranceExitGhostStationIndex; StationIndex gRideEntranceExitGhostStationIndex;
static money32 RideEntranceExitPlaceGhost( static money32 RideEntranceExitPlaceGhost(
ride_id_t rideIndex, const CoordsXY& entranceExitCoords, Direction direction, uint8_t placeType, StationIndex stationNum) RideId rideIndex, const CoordsXY& entranceExitCoords, Direction direction, uint8_t placeType, StationIndex stationNum)
{ {
auto rideEntranceExitPlaceAction = RideEntranceExitPlaceAction( auto rideEntranceExitPlaceAction = RideEntranceExitPlaceAction(
entranceExitCoords, direction, rideIndex, stationNum, placeType == ENTRANCE_TYPE_RIDE_EXIT); entranceExitCoords, direction, rideIndex, stationNum, placeType == ENTRANCE_TYPE_RIDE_EXIT);
@ -137,7 +137,7 @@ void maze_entrance_hedge_replacement(const CoordsXYE& entrance)
int32_t direction = entrance.element->GetDirection(); int32_t direction = entrance.element->GetDirection();
auto hedgePos = entrance + CoordsDirectionDelta[direction]; auto hedgePos = entrance + CoordsDirectionDelta[direction];
int32_t z = entrance.element->GetBaseZ(); int32_t z = entrance.element->GetBaseZ();
ride_id_t rideIndex = entrance.element->AsEntrance()->GetRideIndex(); RideId rideIndex = entrance.element->AsEntrance()->GetRideIndex();
auto tileElement = map_get_first_element_at(hedgePos); auto tileElement = map_get_first_element_at(hedgePos);
if (tileElement == nullptr) if (tileElement == nullptr)
@ -174,7 +174,7 @@ void maze_entrance_hedge_removal(const CoordsXYE& entrance)
int32_t direction = entrance.element->GetDirection(); int32_t direction = entrance.element->GetDirection();
auto hedgePos = entrance + CoordsDirectionDelta[direction]; auto hedgePos = entrance + CoordsDirectionDelta[direction];
int32_t z = entrance.element->GetBaseZ(); int32_t z = entrance.element->GetBaseZ();
ride_id_t rideIndex = entrance.element->AsEntrance()->GetRideIndex(); RideId rideIndex = entrance.element->AsEntrance()->GetRideIndex();
auto tileElement = map_get_first_element_at(hedgePos); auto tileElement = map_get_first_element_at(hedgePos);
if (tileElement == nullptr) if (tileElement == nullptr)
@ -255,12 +255,12 @@ void EntranceElement::SetEntranceType(uint8_t newType)
entranceType = newType; entranceType = newType;
} }
ride_id_t EntranceElement::GetRideIndex() const RideId EntranceElement::GetRideIndex() const
{ {
return rideIndex; return rideIndex;
} }
void EntranceElement::SetRideIndex(ride_id_t newRideIndex) void EntranceElement::SetRideIndex(RideId newRideIndex)
{ {
rideIndex = newRideIndex; rideIndex = newRideIndex;
} }

View File

@ -51,8 +51,8 @@ CoordsXYZ gFootpathConstructFromPosition;
uint8_t gFootpathConstructSlope; uint8_t gFootpathConstructSlope;
uint8_t gFootpathGroundFlags; uint8_t gFootpathGroundFlags;
static ride_id_t* _footpathQueueChainNext; static RideId* _footpathQueueChainNext;
static ride_id_t _footpathQueueChain[64]; static RideId _footpathQueueChain[64];
// This is the coordinates that a user of the bin should move to // This is the coordinates that a user of the bin should move to
// rct2: 0x00992A4C // rct2: 0x00992A4C
@ -583,7 +583,7 @@ struct rct_neighbour
{ {
uint8_t order; uint8_t order;
uint8_t direction; uint8_t direction;
ride_id_t ride_index; RideId ride_index;
uint8_t entrance_index; uint8_t entrance_index;
}; };
@ -617,7 +617,7 @@ static void neighbour_list_init(rct_neighbour_list* neighbourList)
} }
static void neighbour_list_push( static void neighbour_list_push(
rct_neighbour_list* neighbourList, int32_t order, int32_t direction, ride_id_t rideIndex, uint8_t entrance_index) rct_neighbour_list* neighbourList, int32_t order, int32_t direction, RideId rideIndex, uint8_t entrance_index)
{ {
Guard::Assert(neighbourList->count < std::size(neighbourList->items)); Guard::Assert(neighbourList->count < std::size(neighbourList->items));
neighbourList->items[neighbourList->count].order = order; neighbourList->items[neighbourList->count].order = order;
@ -1038,7 +1038,7 @@ void footpath_connect_edges(const CoordsXY& footpathPos, TileElement* tileElemen
if (tileElement->GetType() == TileElementType::Path && tileElement->AsPath()->IsQueue()) if (tileElement->GetType() == TileElementType::Path && tileElement->AsPath()->IsQueue())
{ {
ride_id_t rideIndex = RIDE_ID_NULL; RideId rideIndex = RIDE_ID_NULL;
uint8_t entranceIndex = 255; uint8_t entranceIndex = 255;
for (size_t i = 0; i < neighbourList.count; i++) for (size_t i = 0; i < neighbourList.count; i++)
{ {
@ -1081,7 +1081,7 @@ void footpath_connect_edges(const CoordsXY& footpathPos, TileElement* tileElemen
* rct2: 0x006A742F * rct2: 0x006A742F
*/ */
void footpath_chain_ride_queue( void footpath_chain_ride_queue(
ride_id_t rideIndex, int32_t entranceIndex, const CoordsXY& initialFootpathPos, TileElement* const initialTileElement, RideId rideIndex, int32_t entranceIndex, const CoordsXY& initialFootpathPos, TileElement* const initialTileElement,
int32_t direction) int32_t direction)
{ {
TileElement *lastPathElement, *lastQueuePathElement; TileElement *lastPathElement, *lastQueuePathElement;
@ -1210,7 +1210,7 @@ void footpath_queue_chain_reset()
* *
* rct2: 0x006A76E9 * rct2: 0x006A76E9
*/ */
void footpath_queue_chain_push(ride_id_t rideIndex) void footpath_queue_chain_push(RideId rideIndex)
{ {
if (rideIndex != RIDE_ID_NULL) if (rideIndex != RIDE_ID_NULL)
{ {
@ -1230,7 +1230,7 @@ void footpath_update_queue_chains()
{ {
for (auto* queueChainPtr = _footpathQueueChain; queueChainPtr < _footpathQueueChainNext; queueChainPtr++) for (auto* queueChainPtr = _footpathQueueChain; queueChainPtr < _footpathQueueChainNext; queueChainPtr++)
{ {
ride_id_t rideIndex = *queueChainPtr; RideId rideIndex = *queueChainPtr;
auto ride = get_ride(rideIndex); auto ride = get_ride(rideIndex);
if (ride == nullptr) if (ride == nullptr)
continue; continue;
@ -2379,12 +2379,12 @@ const FootpathRailingsObject* GetPathRailingsEntry(ObjectEntryIndex entryIndex)
return static_cast<FootpathRailingsObject*>(obj); return static_cast<FootpathRailingsObject*>(obj);
} }
ride_id_t PathElement::GetRideIndex() const RideId PathElement::GetRideIndex() const
{ {
return rideIndex; return rideIndex;
} }
void PathElement::SetRideIndex(ride_id_t newRideIndex) void PathElement::SetRideIndex(RideId newRideIndex)
{ {
rideIndex = newRideIndex; rideIndex = newRideIndex;
} }

View File

@ -245,7 +245,7 @@ void footpath_connect_edges(const CoordsXY& footpathPos, TileElement* tileElemen
void footpath_update_queue_chains(); void footpath_update_queue_chains();
bool fence_in_the_way(const CoordsXYRangedZ& fencePos, int32_t direction); bool fence_in_the_way(const CoordsXYRangedZ& fencePos, int32_t direction);
void footpath_chain_ride_queue( void footpath_chain_ride_queue(
ride_id_t rideIndex, int32_t entranceIndex, const CoordsXY& footpathPos, TileElement* tileElement, int32_t direction); RideId rideIndex, int32_t entranceIndex, const CoordsXY& footpathPos, TileElement* tileElement, int32_t direction);
void footpath_update_path_wide_flags(const CoordsXY& footpathPos); void footpath_update_path_wide_flags(const CoordsXY& footpathPos);
bool footpath_is_blocked_by_vehicle(const TileCoordsXYZ& position); bool footpath_is_blocked_by_vehicle(const TileCoordsXYZ& position);
@ -257,4 +257,4 @@ const FootpathSurfaceObject* GetPathSurfaceEntry(ObjectEntryIndex entryIndex);
const FootpathRailingsObject* GetPathRailingsEntry(ObjectEntryIndex entryIndex); const FootpathRailingsObject* GetPathRailingsEntry(ObjectEntryIndex entryIndex);
void footpath_queue_chain_reset(); void footpath_queue_chain_reset();
void footpath_queue_chain_push(ride_id_t rideIndex); void footpath_queue_chain_push(RideId rideIndex);

View File

@ -2133,7 +2133,7 @@ TrackElement* map_get_track_element_at_of_type_seq(const CoordsXYZD& location, t
* @param y y units, not tiles. * @param y y units, not tiles.
* @param z Base height. * @param z Base height.
*/ */
TileElement* map_get_track_element_at_of_type_from_ride(const CoordsXYZ& trackPos, track_type_t trackType, ride_id_t rideIndex) TileElement* map_get_track_element_at_of_type_from_ride(const CoordsXYZ& trackPos, track_type_t trackType, RideId rideIndex)
{ {
TileElement* tileElement = map_get_first_element_at(trackPos); TileElement* tileElement = map_get_first_element_at(trackPos);
if (tileElement == nullptr) if (tileElement == nullptr)
@ -2162,7 +2162,7 @@ TileElement* map_get_track_element_at_of_type_from_ride(const CoordsXYZ& trackPo
* @param y y units, not tiles. * @param y y units, not tiles.
* @param z Base height. * @param z Base height.
*/ */
TileElement* map_get_track_element_at_from_ride(const CoordsXYZ& trackPos, ride_id_t rideIndex) TileElement* map_get_track_element_at_from_ride(const CoordsXYZ& trackPos, RideId rideIndex)
{ {
TileElement* tileElement = map_get_first_element_at(trackPos); TileElement* tileElement = map_get_first_element_at(trackPos);
if (tileElement == nullptr) if (tileElement == nullptr)
@ -2190,7 +2190,7 @@ TileElement* map_get_track_element_at_from_ride(const CoordsXYZ& trackPos, ride_
* @param z Base height. * @param z Base height.
* @param direction The direction (0 - 3). * @param direction The direction (0 - 3).
*/ */
TileElement* map_get_track_element_at_with_direction_from_ride(const CoordsXYZD& trackPos, ride_id_t rideIndex) TileElement* map_get_track_element_at_with_direction_from_ride(const CoordsXYZD& trackPos, RideId rideIndex)
{ {
TileElement* tileElement = map_get_first_element_at(trackPos); TileElement* tileElement = map_get_first_element_at(trackPos);
if (tileElement == nullptr) if (tileElement == nullptr)

View File

@ -248,9 +248,9 @@ TileElement* map_get_track_element_at_of_type(const CoordsXYZ& trackPos, track_t
TileElement* map_get_track_element_at_of_type_seq(const CoordsXYZ& trackPos, track_type_t trackType, int32_t sequence); TileElement* map_get_track_element_at_of_type_seq(const CoordsXYZ& trackPos, track_type_t trackType, int32_t sequence);
TrackElement* map_get_track_element_at_of_type(const CoordsXYZD& location, track_type_t trackType); TrackElement* map_get_track_element_at_of_type(const CoordsXYZD& location, track_type_t trackType);
TrackElement* map_get_track_element_at_of_type_seq(const CoordsXYZD& location, track_type_t trackType, int32_t sequence); TrackElement* map_get_track_element_at_of_type_seq(const CoordsXYZD& location, track_type_t trackType, int32_t sequence);
TileElement* map_get_track_element_at_of_type_from_ride(const CoordsXYZ& trackPos, track_type_t trackType, ride_id_t rideIndex); TileElement* map_get_track_element_at_of_type_from_ride(const CoordsXYZ& trackPos, track_type_t trackType, RideId rideIndex);
TileElement* map_get_track_element_at_from_ride(const CoordsXYZ& trackPos, ride_id_t rideIndex); TileElement* map_get_track_element_at_from_ride(const CoordsXYZ& trackPos, RideId rideIndex);
TileElement* map_get_track_element_at_with_direction_from_ride(const CoordsXYZD& trackPos, ride_id_t rideIndex); TileElement* map_get_track_element_at_with_direction_from_ride(const CoordsXYZD& trackPos, RideId rideIndex);
bool map_is_location_at_edge(const CoordsXY& loc); bool map_is_location_at_edge(const CoordsXY& loc);

View File

@ -86,7 +86,7 @@ void TileElement::RemoveBannerEntry()
} }
} }
ride_id_t TileElement::GetRideIndex() const RideId TileElement::GetRideIndex() const
{ {
switch (GetType()) switch (GetType())
{ {

View File

@ -176,7 +176,7 @@ struct TileElement : public TileElementBase
void ClearAs(TileElementType newType); void ClearAs(TileElementType newType);
ride_id_t GetRideIndex() const; RideId GetRideIndex() const;
void SetBannerIndex(BannerIndex newIndex); void SetBannerIndex(BannerIndex newIndex);
void RemoveBannerEntry(); void RemoveBannerEntry();
@ -245,7 +245,7 @@ private:
union union
{ {
uint8_t AdditionStatus; // 13, only used for litter bins uint8_t AdditionStatus; // 13, only used for litter bins
ride_id_t rideIndex; // 13 RideId rideIndex; // 13
}; };
::StationIndex StationIndex; // 15 ::StationIndex StationIndex; // 15
@ -275,8 +275,8 @@ public:
Direction GetSlopeDirection() const; Direction GetSlopeDirection() const;
void SetSlopeDirection(Direction newSlope); void SetSlopeDirection(Direction newSlope);
ride_id_t GetRideIndex() const; RideId GetRideIndex() const;
void SetRideIndex(ride_id_t newRideIndex); void SetRideIndex(RideId newRideIndex);
::StationIndex GetStationIndex() const; ::StationIndex GetStationIndex() const;
void SetStationIndex(::StationIndex newStationIndex); void SetStationIndex(::StationIndex newStationIndex);
@ -350,7 +350,7 @@ private:
}; };
}; };
uint8_t Flags2; uint8_t Flags2;
ride_id_t RideIndex; RideId RideIndex;
ride_type_t RideType; ride_type_t RideType;
public: public:
@ -363,8 +363,8 @@ public:
uint8_t GetSequenceIndex() const; uint8_t GetSequenceIndex() const;
void SetSequenceIndex(uint8_t newSequenceIndex); void SetSequenceIndex(uint8_t newSequenceIndex);
ride_id_t GetRideIndex() const; RideId GetRideIndex() const;
void SetRideIndex(ride_id_t newRideIndex); void SetRideIndex(RideId newRideIndex);
uint8_t GetColourScheme() const; uint8_t GetColourScheme() const;
void SetColourScheme(uint8_t newColourScheme); void SetColourScheme(uint8_t newColourScheme);
@ -547,7 +547,7 @@ private:
uint8_t SequenceIndex; // 6. Only uses the lower nibble. uint8_t SequenceIndex; // 6. Only uses the lower nibble.
uint8_t StationIndex; // 7 uint8_t StationIndex; // 7
ObjectEntryIndex PathType; // 8 ObjectEntryIndex PathType; // 8
ride_id_t rideIndex; // A RideId rideIndex; // A
uint8_t flags2; // C uint8_t flags2; // C
#pragma clang diagnostic push #pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field" #pragma clang diagnostic ignored "-Wunused-private-field"
@ -558,8 +558,8 @@ public:
uint8_t GetEntranceType() const; uint8_t GetEntranceType() const;
void SetEntranceType(uint8_t newType); void SetEntranceType(uint8_t newType);
ride_id_t GetRideIndex() const; RideId GetRideIndex() const;
void SetRideIndex(ride_id_t newRideIndex); void SetRideIndex(RideId newRideIndex);
uint8_t GetStationIndex() const; uint8_t GetStationIndex() const;
void SetStationIndex(uint8_t newStationIndex); void SetStationIndex(uint8_t newStationIndex);

View File

@ -64,7 +64,7 @@ protected:
return nullptr; return nullptr;
} }
static bool FindPath(TileCoordsXYZ* pos, const TileCoordsXYZ& goal, int expectedSteps, ride_id_t targetRideID) static bool FindPath(TileCoordsXYZ* pos, const TileCoordsXYZ& goal, int expectedSteps, RideId targetRideID)
{ {
// Our start position is in tile coordinates, but we need to give the peep spawn // Our start position is in tile coordinates, but we need to give the peep spawn
// position in actual world coords (32 units per tile X/Y, 8 per Z level). // position in actual world coords (32 units per tile X/Y, 8 per Z level).