mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-21 14:53:02 +01:00
Adopt existing namespaces into OpenRCT2 namespace (#22368)
* Put all of TitleSequenceManager into the same namespace * Move RideConstructionState into the OpenRCT2 namespace * Adopt existing namespaces into OpenRCT2 namespace This adds `using namespace OpenRCT2` to compilation units where appropriate, as a means to get the codebase to compile until these units have been placed in a namespace of their own.
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
namespace Dropdown
|
||||
namespace OpenRCT2::Dropdown
|
||||
{
|
||||
struct Item;
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Dropdown
|
||||
void SetChecked(int32_t index, bool value);
|
||||
void SetDisabled(int32_t index, bool value);
|
||||
void SetImage(int32_t index, ImageId image);
|
||||
} // namespace Dropdown
|
||||
} // namespace OpenRCT2::Dropdown
|
||||
|
||||
namespace OpenRCT2::Ui::Windows
|
||||
{
|
||||
@@ -67,7 +67,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
colour_t ColourDropDownIndexToColour(uint8_t ddidx);
|
||||
} // namespace OpenRCT2::Ui::Windows
|
||||
|
||||
namespace Dropdown
|
||||
namespace OpenRCT2::Dropdown
|
||||
{
|
||||
enum class ItemFlag : uint8_t
|
||||
{
|
||||
@@ -142,4 +142,4 @@ namespace Dropdown
|
||||
|
||||
return true;
|
||||
}
|
||||
} // namespace Dropdown
|
||||
} // namespace OpenRCT2::Dropdown
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
namespace Graph
|
||||
namespace OpenRCT2::Graph
|
||||
{
|
||||
static void DrawMonths(DrawPixelInfo& dpi, const uint8_t* history, int32_t count, const ScreenCoordsXY& origCoords)
|
||||
{
|
||||
@@ -105,7 +105,7 @@ namespace Graph
|
||||
DrawLineA(dpi, history, count, screenPos);
|
||||
DrawLineB(dpi, history, count, screenPos);
|
||||
}
|
||||
} // namespace Graph
|
||||
} // namespace OpenRCT2::Graph
|
||||
|
||||
struct FinancialTooltipInfo
|
||||
{
|
||||
@@ -153,7 +153,7 @@ static const FinancialTooltipInfo FinanceTooltipInfoFromMoney(
|
||||
return { coords, history[historyIndex] };
|
||||
}
|
||||
|
||||
namespace Graph
|
||||
namespace OpenRCT2::Graph
|
||||
{
|
||||
static void DrawMonths(DrawPixelInfo& dpi, const money64* history, int32_t count, const ScreenCoordsXY& origCoords)
|
||||
{
|
||||
@@ -288,4 +288,4 @@ namespace Graph
|
||||
DrawLineB(dpi, history, count, screenCoords, modifier, offset);
|
||||
DrawHoveredValue(dpi, history, count, screenCoords, modifier, offset);
|
||||
}
|
||||
} // namespace Graph
|
||||
} // namespace OpenRCT2::Graph
|
||||
|
||||
@@ -13,10 +13,10 @@
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/world/Location.hpp>
|
||||
|
||||
namespace Graph
|
||||
namespace OpenRCT2::Graph
|
||||
{
|
||||
void Draw(DrawPixelInfo& dpi, uint8_t* history, int32_t count, const ScreenCoordsXY& screenPos);
|
||||
void Draw(
|
||||
DrawPixelInfo& dpi, const money64* history, const int32_t count, const ScreenCoordsXY& coords, const int32_t modifier,
|
||||
const int32_t offset);
|
||||
} // namespace Graph
|
||||
} // namespace OpenRCT2::Graph
|
||||
|
||||
@@ -25,11 +25,11 @@ extern ObjectEntryIndex gLandToolTerrainEdge;
|
||||
extern money64 gWaterToolRaiseCost;
|
||||
extern money64 gWaterToolLowerCost;
|
||||
|
||||
namespace LandTool
|
||||
namespace OpenRCT2::LandTool
|
||||
{
|
||||
uint32_t SizeToSpriteIndex(uint16_t size);
|
||||
void ShowSurfaceStyleDropdown(WindowBase* w, Widget* widget, ObjectEntryIndex currentSurfaceType);
|
||||
ObjectEntryIndex GetSurfaceStyleFromDropdownIndex(size_t index);
|
||||
void ShowEdgeStyleDropdown(WindowBase* w, Widget* widget, ObjectEntryIndex currentEdgeType);
|
||||
ObjectEntryIndex GetEdgeStyleFromDropdownIndex(size_t index);
|
||||
} // namespace LandTool
|
||||
} // namespace OpenRCT2::LandTool
|
||||
|
||||
@@ -528,7 +528,7 @@ UITheme UITheme::CreatePredefined(const std::string& name, const UIThemeWindowEn
|
||||
|
||||
#pragma endregion
|
||||
|
||||
namespace ThemeManager
|
||||
namespace OpenRCT2::ThemeManager
|
||||
{
|
||||
struct AvailableTheme
|
||||
{
|
||||
@@ -688,7 +688,7 @@ namespace ThemeManager
|
||||
auto env = context->GetPlatformEnvironment();
|
||||
return env->GetDirectoryPath(DIRBASE::USER, DIRID::THEME);
|
||||
}
|
||||
} // namespace ThemeManager
|
||||
} // namespace OpenRCT2::ThemeManager
|
||||
|
||||
void ThemeManagerLoadAvailableThemes()
|
||||
{
|
||||
|
||||
@@ -19,83 +19,89 @@
|
||||
|
||||
using namespace OpenRCT2::TrackMetaData;
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006B4800
|
||||
*/
|
||||
void RideConstructNew(RideSelection listItem)
|
||||
namespace OpenRCT2
|
||||
{
|
||||
int32_t rideEntryIndex = RideGetEntryIndex(listItem.Type, listItem.EntryIndex);
|
||||
int32_t colour1 = RideGetRandomColourPresetIndex(listItem.Type);
|
||||
int32_t colour2 = RideGetUnusedPresetVehicleColour(rideEntryIndex);
|
||||
|
||||
auto gameAction = RideCreateAction(
|
||||
listItem.Type, listItem.EntryIndex, colour1, colour2, OpenRCT2::GetGameState().LastEntranceStyle);
|
||||
|
||||
gameAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) {
|
||||
if (result->Error != GameActions::Status::Ok)
|
||||
return;
|
||||
const auto rideIndex = result->GetData<RideId>();
|
||||
auto ride = GetRide(rideIndex);
|
||||
RideConstructionStart(*ride);
|
||||
});
|
||||
|
||||
GameActions::Execute(&gameAction);
|
||||
}
|
||||
|
||||
SpecialElementsDropdownState BuildSpecialElementsList(
|
||||
const Ride& currentRide, uint8_t buildDirection, TrackPitch buildSlope, TrackRoll buildBank, RideConstructionState state)
|
||||
{
|
||||
auto buildDirectionIsDiagonal = TrackPieceDirectionIsDiagonal(buildDirection);
|
||||
SpecialElementsDropdownState list;
|
||||
|
||||
// if it's building neither forwards nor backwards, no list is available
|
||||
if (state != RideConstructionState::Front && state != RideConstructionState::Place && state != RideConstructionState::Back)
|
||||
return list;
|
||||
|
||||
for (track_type_t trackType : DropdownOrder)
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006B4800
|
||||
*/
|
||||
void RideConstructNew(RideSelection listItem)
|
||||
{
|
||||
const auto& ted = GetTrackElementDescriptor(trackType);
|
||||
if (!IsTrackEnabled(ted.Definition.Type))
|
||||
continue;
|
||||
bool entryIsDisabled;
|
||||
int32_t rideEntryIndex = RideGetEntryIndex(listItem.Type, listItem.EntryIndex);
|
||||
int32_t colour1 = RideGetRandomColourPresetIndex(listItem.Type);
|
||||
int32_t colour2 = RideGetUnusedPresetVehicleColour(rideEntryIndex);
|
||||
|
||||
// If the current build orientation (slope, bank, diagonal) matches the track element's, show the piece as enabled
|
||||
if (state == RideConstructionState::Back)
|
||||
{
|
||||
entryIsDisabled = ted.Definition.PitchEnd != buildSlope || ted.Definition.RollEnd != buildBank
|
||||
|| TrackPieceDirectionIsDiagonal(ted.Coordinates.rotation_end) != buildDirectionIsDiagonal;
|
||||
}
|
||||
else
|
||||
{
|
||||
entryIsDisabled = ted.Definition.PitchStart != buildSlope || ted.Definition.RollStart != buildBank
|
||||
|| TrackPieceDirectionIsDiagonal(ted.Coordinates.rotation_begin) != buildDirectionIsDiagonal;
|
||||
}
|
||||
auto gameAction = RideCreateAction(
|
||||
listItem.Type, listItem.EntryIndex, colour1, colour2, OpenRCT2::GetGameState().LastEntranceStyle);
|
||||
|
||||
// Additional tower bases can only be built if the ride allows for it (elevator)
|
||||
if (trackType == TrackElemType::TowerBase
|
||||
&& !currentRide.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_ALLOW_EXTRA_TOWER_BASES))
|
||||
entryIsDisabled = true;
|
||||
gameAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) {
|
||||
if (result->Error != GameActions::Status::Ok)
|
||||
return;
|
||||
const auto rideIndex = result->GetData<RideId>();
|
||||
auto ride = GetRide(rideIndex);
|
||||
RideConstructionStart(*ride);
|
||||
});
|
||||
|
||||
// Check if a previous element exists, to collate entries if possible
|
||||
if (!list.Elements.empty() && GetTrackElementDescriptor(list.Elements.back().TrackType).Description == ted.Description)
|
||||
{
|
||||
// If the current element is disabled, do not add current element.
|
||||
if (entryIsDisabled)
|
||||
continue;
|
||||
auto& lastElement = list.Elements.back();
|
||||
// If the previous element is disabled and current element is enabled, replace the previous element
|
||||
if (lastElement.Disabled && !entryIsDisabled)
|
||||
{
|
||||
lastElement.TrackType = trackType;
|
||||
lastElement.Disabled = false;
|
||||
list.HasActiveElements = true;
|
||||
continue;
|
||||
}
|
||||
// If the previous element and current element are enabled, add both to the list
|
||||
}
|
||||
list.Elements.push_back({ trackType, entryIsDisabled });
|
||||
list.HasActiveElements |= !entryIsDisabled;
|
||||
GameActions::Execute(&gameAction);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
SpecialElementsDropdownState BuildSpecialElementsList(
|
||||
const Ride& currentRide, uint8_t buildDirection, TrackPitch buildSlope, TrackRoll buildBank,
|
||||
RideConstructionState state)
|
||||
{
|
||||
auto buildDirectionIsDiagonal = TrackPieceDirectionIsDiagonal(buildDirection);
|
||||
SpecialElementsDropdownState list;
|
||||
|
||||
// if it's building neither forwards nor backwards, no list is available
|
||||
if (state != RideConstructionState::Front && state != RideConstructionState::Place
|
||||
&& state != RideConstructionState::Back)
|
||||
return list;
|
||||
|
||||
for (track_type_t trackType : DropdownOrder)
|
||||
{
|
||||
const auto& ted = GetTrackElementDescriptor(trackType);
|
||||
if (!IsTrackEnabled(ted.Definition.Type))
|
||||
continue;
|
||||
bool entryIsDisabled;
|
||||
|
||||
// If the current build orientation (slope, bank, diagonal) matches the track element's, show the piece as enabled
|
||||
if (state == RideConstructionState::Back)
|
||||
{
|
||||
entryIsDisabled = ted.Definition.PitchEnd != buildSlope || ted.Definition.RollEnd != buildBank
|
||||
|| TrackPieceDirectionIsDiagonal(ted.Coordinates.rotation_end) != buildDirectionIsDiagonal;
|
||||
}
|
||||
else
|
||||
{
|
||||
entryIsDisabled = ted.Definition.PitchStart != buildSlope || ted.Definition.RollStart != buildBank
|
||||
|| TrackPieceDirectionIsDiagonal(ted.Coordinates.rotation_begin) != buildDirectionIsDiagonal;
|
||||
}
|
||||
|
||||
// Additional tower bases can only be built if the ride allows for it (elevator)
|
||||
if (trackType == TrackElemType::TowerBase
|
||||
&& !currentRide.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_ALLOW_EXTRA_TOWER_BASES))
|
||||
entryIsDisabled = true;
|
||||
|
||||
// Check if a previous element exists, to collate entries if possible
|
||||
if (!list.Elements.empty()
|
||||
&& GetTrackElementDescriptor(list.Elements.back().TrackType).Description == ted.Description)
|
||||
{
|
||||
// If the current element is disabled, do not add current element.
|
||||
if (entryIsDisabled)
|
||||
continue;
|
||||
auto& lastElement = list.Elements.back();
|
||||
// If the previous element is disabled and current element is enabled, replace the previous element
|
||||
if (lastElement.Disabled && !entryIsDisabled)
|
||||
{
|
||||
lastElement.TrackType = trackType;
|
||||
lastElement.Disabled = false;
|
||||
list.HasActiveElements = true;
|
||||
continue;
|
||||
}
|
||||
// If the previous element and current element are enabled, add both to the list
|
||||
}
|
||||
list.Elements.push_back({ trackType, entryIsDisabled });
|
||||
list.HasActiveElements |= !entryIsDisabled;
|
||||
}
|
||||
return list;
|
||||
}
|
||||
} // namespace OpenRCT2
|
||||
|
||||
@@ -12,153 +12,157 @@
|
||||
#include <openrct2/ride/RideTypes.h>
|
||||
#include <openrct2/ride/Track.h>
|
||||
|
||||
enum class RideConstructionState : uint8_t;
|
||||
|
||||
/**
|
||||
* Order of special track elements dropdown. Elements with the same name string must be sequential or they show up twice.
|
||||
*/
|
||||
constexpr std::array DropdownOrder = {
|
||||
TrackElemType::EndStation,
|
||||
TrackElemType::SBendLeft,
|
||||
TrackElemType::SBendRight,
|
||||
TrackElemType::LeftVerticalLoop,
|
||||
TrackElemType::RightVerticalLoop,
|
||||
TrackElemType::LeftTwistDownToUp,
|
||||
TrackElemType::LeftTwistUpToDown,
|
||||
TrackElemType::RightTwistDownToUp,
|
||||
TrackElemType::RightTwistUpToDown,
|
||||
TrackElemType::HalfLoopUp,
|
||||
TrackElemType::HalfLoopDown,
|
||||
TrackElemType::LeftCorkscrewUp,
|
||||
TrackElemType::LeftCorkscrewDown,
|
||||
TrackElemType::RightCorkscrewUp,
|
||||
TrackElemType::RightCorkscrewDown,
|
||||
TrackElemType::TowerBase,
|
||||
TrackElemType::TowerSection,
|
||||
TrackElemType::LeftHalfBankedHelixUpSmall,
|
||||
TrackElemType::RightHalfBankedHelixUpSmall,
|
||||
TrackElemType::LeftHalfBankedHelixDownSmall,
|
||||
TrackElemType::RightHalfBankedHelixDownSmall,
|
||||
TrackElemType::LeftHalfBankedHelixUpLarge,
|
||||
TrackElemType::RightHalfBankedHelixUpLarge,
|
||||
TrackElemType::LeftHalfBankedHelixDownLarge,
|
||||
TrackElemType::RightHalfBankedHelixDownLarge,
|
||||
TrackElemType::Booster,
|
||||
TrackElemType::Brakes,
|
||||
TrackElemType::DiagBrakes,
|
||||
TrackElemType::OnRidePhoto,
|
||||
TrackElemType::LeftQuarterBankedHelixLargeUp,
|
||||
TrackElemType::RightQuarterBankedHelixLargeUp,
|
||||
TrackElemType::LeftQuarterBankedHelixLargeDown,
|
||||
TrackElemType::RightQuarterBankedHelixLargeDown,
|
||||
TrackElemType::LeftQuarterHelixLargeUp,
|
||||
TrackElemType::RightQuarterHelixLargeUp,
|
||||
TrackElemType::LeftQuarterHelixLargeDown,
|
||||
TrackElemType::RightQuarterHelixLargeDown,
|
||||
TrackElemType::Waterfall,
|
||||
TrackElemType::Rapids,
|
||||
TrackElemType::Watersplash,
|
||||
TrackElemType::Whirlpool,
|
||||
TrackElemType::CableLiftHill,
|
||||
TrackElemType::ReverseFreefallSlope,
|
||||
TrackElemType::ReverseFreefallVertical,
|
||||
TrackElemType::BrakeForDrop,
|
||||
TrackElemType::LogFlumeReverser,
|
||||
TrackElemType::SpinningTunnel,
|
||||
TrackElemType::LeftBarrelRollUpToDown,
|
||||
TrackElemType::LeftBarrelRollDownToUp,
|
||||
TrackElemType::RightBarrelRollUpToDown,
|
||||
TrackElemType::RightBarrelRollDownToUp,
|
||||
TrackElemType::PoweredLift,
|
||||
TrackElemType::LeftLargeHalfLoopUp,
|
||||
TrackElemType::LeftLargeHalfLoopDown,
|
||||
TrackElemType::RightLargeHalfLoopUp,
|
||||
TrackElemType::RightLargeHalfLoopDown,
|
||||
TrackElemType::LeftFlyerTwistUp,
|
||||
TrackElemType::LeftFlyerTwistDown,
|
||||
TrackElemType::RightFlyerTwistUp,
|
||||
TrackElemType::RightFlyerTwistDown,
|
||||
TrackElemType::FlyerHalfLoopUninvertedUp,
|
||||
TrackElemType::FlyerHalfLoopInvertedDown,
|
||||
TrackElemType::FlyerHalfLoopInvertedUp,
|
||||
TrackElemType::FlyerHalfLoopUninvertedDown,
|
||||
TrackElemType::LeftFlyerCorkscrewUp,
|
||||
TrackElemType::LeftFlyerCorkscrewDown,
|
||||
TrackElemType::RightFlyerCorkscrewUp,
|
||||
TrackElemType::RightFlyerCorkscrewDown,
|
||||
TrackElemType::HeartLineTransferUp,
|
||||
TrackElemType::HeartLineTransferDown,
|
||||
TrackElemType::LeftHeartLineRoll,
|
||||
TrackElemType::RightHeartLineRoll,
|
||||
TrackElemType::MinigolfHoleA,
|
||||
TrackElemType::MinigolfHoleB,
|
||||
TrackElemType::MinigolfHoleC,
|
||||
TrackElemType::MinigolfHoleD,
|
||||
TrackElemType::MinigolfHoleE,
|
||||
TrackElemType::MultiDimInvertedFlatToDown90QuarterLoop,
|
||||
TrackElemType::Up90ToInvertedFlatQuarterLoop,
|
||||
TrackElemType::InvertedFlatToDown90QuarterLoop,
|
||||
TrackElemType::MultiDimUp90ToInvertedFlatQuarterLoop,
|
||||
TrackElemType::MultiDimFlatToDown90QuarterLoop,
|
||||
TrackElemType::MultiDimInvertedUp90ToFlatQuarterLoop,
|
||||
TrackElemType::LeftCurvedLiftHill,
|
||||
TrackElemType::RightCurvedLiftHill,
|
||||
TrackElemType::LeftReverser,
|
||||
TrackElemType::RightReverser,
|
||||
TrackElemType::AirThrustTopCap,
|
||||
TrackElemType::AirThrustVerticalDown,
|
||||
TrackElemType::AirThrustVerticalDownToLevel,
|
||||
TrackElemType::BlockBrakes,
|
||||
TrackElemType::DiagBlockBrakes,
|
||||
TrackElemType::RotationControlToggle,
|
||||
TrackElemType::LeftLargeCorkscrewUp,
|
||||
TrackElemType::LeftLargeCorkscrewDown,
|
||||
TrackElemType::RightLargeCorkscrewUp,
|
||||
TrackElemType::RightLargeCorkscrewDown,
|
||||
TrackElemType::LeftMediumHalfLoopUp,
|
||||
TrackElemType::LeftMediumHalfLoopDown,
|
||||
TrackElemType::RightMediumHalfLoopUp,
|
||||
TrackElemType::RightMediumHalfLoopDown,
|
||||
TrackElemType::LeftZeroGRollUp,
|
||||
TrackElemType::LeftZeroGRollDown,
|
||||
TrackElemType::RightZeroGRollUp,
|
||||
TrackElemType::RightZeroGRollDown,
|
||||
TrackElemType::LeftLargeZeroGRollUp,
|
||||
TrackElemType::LeftLargeZeroGRollDown,
|
||||
TrackElemType::RightLargeZeroGRollUp,
|
||||
TrackElemType::RightLargeZeroGRollDown,
|
||||
TrackElemType::LeftFlyerLargeHalfLoopUninvertedUp,
|
||||
TrackElemType::LeftFlyerLargeHalfLoopInvertedDown,
|
||||
TrackElemType::LeftFlyerLargeHalfLoopInvertedUp,
|
||||
TrackElemType::LeftFlyerLargeHalfLoopUninvertedDown,
|
||||
TrackElemType::RightFlyerLargeHalfLoopUninvertedUp,
|
||||
TrackElemType::RightFlyerLargeHalfLoopInvertedDown,
|
||||
TrackElemType::RightFlyerLargeHalfLoopInvertedUp,
|
||||
TrackElemType::RightFlyerLargeHalfLoopUninvertedDown,
|
||||
};
|
||||
constexpr size_t DropdownLength = DropdownOrder.size();
|
||||
|
||||
// Update the magic number with the current number of track elements to silence
|
||||
static_assert(TrackElemType::Count == 339, "Reminder to add new track element to special dropdown list");
|
||||
|
||||
constexpr bool TrackPieceDirectionIsDiagonal(const uint8_t direction)
|
||||
namespace OpenRCT2
|
||||
{
|
||||
return direction >= kNumOrthogonalDirections;
|
||||
}
|
||||
enum class RideConstructionState : uint8_t;
|
||||
|
||||
struct SpecialElement
|
||||
{
|
||||
track_type_t TrackType;
|
||||
bool Disabled;
|
||||
};
|
||||
/**
|
||||
* Order of special track elements dropdown. Elements with the same name string must be sequential or they show up twice.
|
||||
*/
|
||||
constexpr std::array DropdownOrder = {
|
||||
TrackElemType::EndStation,
|
||||
TrackElemType::SBendLeft,
|
||||
TrackElemType::SBendRight,
|
||||
TrackElemType::LeftVerticalLoop,
|
||||
TrackElemType::RightVerticalLoop,
|
||||
TrackElemType::LeftTwistDownToUp,
|
||||
TrackElemType::LeftTwistUpToDown,
|
||||
TrackElemType::RightTwistDownToUp,
|
||||
TrackElemType::RightTwistUpToDown,
|
||||
TrackElemType::HalfLoopUp,
|
||||
TrackElemType::HalfLoopDown,
|
||||
TrackElemType::LeftCorkscrewUp,
|
||||
TrackElemType::LeftCorkscrewDown,
|
||||
TrackElemType::RightCorkscrewUp,
|
||||
TrackElemType::RightCorkscrewDown,
|
||||
TrackElemType::TowerBase,
|
||||
TrackElemType::TowerSection,
|
||||
TrackElemType::LeftHalfBankedHelixUpSmall,
|
||||
TrackElemType::RightHalfBankedHelixUpSmall,
|
||||
TrackElemType::LeftHalfBankedHelixDownSmall,
|
||||
TrackElemType::RightHalfBankedHelixDownSmall,
|
||||
TrackElemType::LeftHalfBankedHelixUpLarge,
|
||||
TrackElemType::RightHalfBankedHelixUpLarge,
|
||||
TrackElemType::LeftHalfBankedHelixDownLarge,
|
||||
TrackElemType::RightHalfBankedHelixDownLarge,
|
||||
TrackElemType::Booster,
|
||||
TrackElemType::Brakes,
|
||||
TrackElemType::DiagBrakes,
|
||||
TrackElemType::OnRidePhoto,
|
||||
TrackElemType::LeftQuarterBankedHelixLargeUp,
|
||||
TrackElemType::RightQuarterBankedHelixLargeUp,
|
||||
TrackElemType::LeftQuarterBankedHelixLargeDown,
|
||||
TrackElemType::RightQuarterBankedHelixLargeDown,
|
||||
TrackElemType::LeftQuarterHelixLargeUp,
|
||||
TrackElemType::RightQuarterHelixLargeUp,
|
||||
TrackElemType::LeftQuarterHelixLargeDown,
|
||||
TrackElemType::RightQuarterHelixLargeDown,
|
||||
TrackElemType::Waterfall,
|
||||
TrackElemType::Rapids,
|
||||
TrackElemType::Watersplash,
|
||||
TrackElemType::Whirlpool,
|
||||
TrackElemType::CableLiftHill,
|
||||
TrackElemType::ReverseFreefallSlope,
|
||||
TrackElemType::ReverseFreefallVertical,
|
||||
TrackElemType::BrakeForDrop,
|
||||
TrackElemType::LogFlumeReverser,
|
||||
TrackElemType::SpinningTunnel,
|
||||
TrackElemType::LeftBarrelRollUpToDown,
|
||||
TrackElemType::LeftBarrelRollDownToUp,
|
||||
TrackElemType::RightBarrelRollUpToDown,
|
||||
TrackElemType::RightBarrelRollDownToUp,
|
||||
TrackElemType::PoweredLift,
|
||||
TrackElemType::LeftLargeHalfLoopUp,
|
||||
TrackElemType::LeftLargeHalfLoopDown,
|
||||
TrackElemType::RightLargeHalfLoopUp,
|
||||
TrackElemType::RightLargeHalfLoopDown,
|
||||
TrackElemType::LeftFlyerTwistUp,
|
||||
TrackElemType::LeftFlyerTwistDown,
|
||||
TrackElemType::RightFlyerTwistUp,
|
||||
TrackElemType::RightFlyerTwistDown,
|
||||
TrackElemType::FlyerHalfLoopUninvertedUp,
|
||||
TrackElemType::FlyerHalfLoopInvertedDown,
|
||||
TrackElemType::FlyerHalfLoopInvertedUp,
|
||||
TrackElemType::FlyerHalfLoopUninvertedDown,
|
||||
TrackElemType::LeftFlyerCorkscrewUp,
|
||||
TrackElemType::LeftFlyerCorkscrewDown,
|
||||
TrackElemType::RightFlyerCorkscrewUp,
|
||||
TrackElemType::RightFlyerCorkscrewDown,
|
||||
TrackElemType::HeartLineTransferUp,
|
||||
TrackElemType::HeartLineTransferDown,
|
||||
TrackElemType::LeftHeartLineRoll,
|
||||
TrackElemType::RightHeartLineRoll,
|
||||
TrackElemType::MinigolfHoleA,
|
||||
TrackElemType::MinigolfHoleB,
|
||||
TrackElemType::MinigolfHoleC,
|
||||
TrackElemType::MinigolfHoleD,
|
||||
TrackElemType::MinigolfHoleE,
|
||||
TrackElemType::MultiDimInvertedFlatToDown90QuarterLoop,
|
||||
TrackElemType::Up90ToInvertedFlatQuarterLoop,
|
||||
TrackElemType::InvertedFlatToDown90QuarterLoop,
|
||||
TrackElemType::MultiDimUp90ToInvertedFlatQuarterLoop,
|
||||
TrackElemType::MultiDimFlatToDown90QuarterLoop,
|
||||
TrackElemType::MultiDimInvertedUp90ToFlatQuarterLoop,
|
||||
TrackElemType::LeftCurvedLiftHill,
|
||||
TrackElemType::RightCurvedLiftHill,
|
||||
TrackElemType::LeftReverser,
|
||||
TrackElemType::RightReverser,
|
||||
TrackElemType::AirThrustTopCap,
|
||||
TrackElemType::AirThrustVerticalDown,
|
||||
TrackElemType::AirThrustVerticalDownToLevel,
|
||||
TrackElemType::BlockBrakes,
|
||||
TrackElemType::DiagBlockBrakes,
|
||||
TrackElemType::RotationControlToggle,
|
||||
TrackElemType::LeftLargeCorkscrewUp,
|
||||
TrackElemType::LeftLargeCorkscrewDown,
|
||||
TrackElemType::RightLargeCorkscrewUp,
|
||||
TrackElemType::RightLargeCorkscrewDown,
|
||||
TrackElemType::LeftMediumHalfLoopUp,
|
||||
TrackElemType::LeftMediumHalfLoopDown,
|
||||
TrackElemType::RightMediumHalfLoopUp,
|
||||
TrackElemType::RightMediumHalfLoopDown,
|
||||
TrackElemType::LeftZeroGRollUp,
|
||||
TrackElemType::LeftZeroGRollDown,
|
||||
TrackElemType::RightZeroGRollUp,
|
||||
TrackElemType::RightZeroGRollDown,
|
||||
TrackElemType::LeftLargeZeroGRollUp,
|
||||
TrackElemType::LeftLargeZeroGRollDown,
|
||||
TrackElemType::RightLargeZeroGRollUp,
|
||||
TrackElemType::RightLargeZeroGRollDown,
|
||||
TrackElemType::LeftFlyerLargeHalfLoopUninvertedUp,
|
||||
TrackElemType::LeftFlyerLargeHalfLoopInvertedDown,
|
||||
TrackElemType::LeftFlyerLargeHalfLoopInvertedUp,
|
||||
TrackElemType::LeftFlyerLargeHalfLoopUninvertedDown,
|
||||
TrackElemType::RightFlyerLargeHalfLoopUninvertedUp,
|
||||
TrackElemType::RightFlyerLargeHalfLoopInvertedDown,
|
||||
TrackElemType::RightFlyerLargeHalfLoopInvertedUp,
|
||||
TrackElemType::RightFlyerLargeHalfLoopUninvertedDown,
|
||||
};
|
||||
constexpr size_t DropdownLength = DropdownOrder.size();
|
||||
|
||||
struct SpecialElementsDropdownState
|
||||
{
|
||||
bool HasActiveElements = false;
|
||||
std::vector<SpecialElement> Elements{};
|
||||
};
|
||||
// Update the magic number with the current number of track elements to silence
|
||||
static_assert(TrackElemType::Count == 339, "Reminder to add new track element to special dropdown list");
|
||||
|
||||
SpecialElementsDropdownState BuildSpecialElementsList(
|
||||
const Ride& currentRide, uint8_t buildDirection, TrackPitch buildSlope, TrackRoll buildBank, RideConstructionState state);
|
||||
constexpr bool TrackPieceDirectionIsDiagonal(const uint8_t direction)
|
||||
{
|
||||
return direction >= kNumOrthogonalDirections;
|
||||
}
|
||||
|
||||
void RideConstructNew(RideSelection listItem);
|
||||
struct SpecialElement
|
||||
{
|
||||
track_type_t TrackType;
|
||||
bool Disabled;
|
||||
};
|
||||
|
||||
struct SpecialElementsDropdownState
|
||||
{
|
||||
bool HasActiveElements = false;
|
||||
std::vector<SpecialElement> Elements{};
|
||||
};
|
||||
|
||||
SpecialElementsDropdownState BuildSpecialElementsList(
|
||||
const Ride& currentRide, uint8_t buildDirection, TrackPitch buildSlope, TrackRoll buildBank,
|
||||
RideConstructionState state);
|
||||
|
||||
void RideConstructNew(RideSelection listItem);
|
||||
} // namespace OpenRCT2
|
||||
|
||||
@@ -365,7 +365,7 @@ namespace OpenRCT2::Scripting
|
||||
const auto* item = GetItem();
|
||||
if (item != nullptr)
|
||||
{
|
||||
return item->PredefinedIndex != PREDEFINED_INDEX_CUSTOM;
|
||||
return item->PredefinedIndex != TitleSequenceManager::kPredefinedIndexCustom;
|
||||
}
|
||||
return {};
|
||||
}
|
||||
@@ -545,7 +545,7 @@ namespace OpenRCT2::Scripting
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
const TitleSequenceManagerItem* GetItem() const
|
||||
const TitleSequenceManager::Item* GetItem() const
|
||||
{
|
||||
auto index = GetManagerIndex();
|
||||
if (index)
|
||||
|
||||
@@ -1739,11 +1739,11 @@ static Widget *window_options_page_widgets[] = {
|
||||
{
|
||||
case WIDX_TITLE_SEQUENCE_DROPDOWN:
|
||||
{
|
||||
uint32_t numItems = static_cast<int32_t>(TitleSequenceManagerGetCount());
|
||||
uint32_t numItems = static_cast<int32_t>(TitleSequenceManager::GetCount());
|
||||
for (size_t i = 0; i < numItems; i++)
|
||||
{
|
||||
gDropdownItems[i].Format = STR_OPTIONS_DROPDOWN_ITEM;
|
||||
gDropdownItems[i].Args = reinterpret_cast<uintptr_t>(TitleSequenceManagerGetName(i));
|
||||
gDropdownItems[i].Args = reinterpret_cast<uintptr_t>(TitleSequenceManager::GetName(i));
|
||||
}
|
||||
|
||||
gDropdownItems[numItems].Format = 0;
|
||||
@@ -1797,7 +1797,7 @@ static Widget *window_options_page_widgets[] = {
|
||||
{
|
||||
case WIDX_TITLE_SEQUENCE_DROPDOWN:
|
||||
{
|
||||
auto numItems = static_cast<int32_t>(TitleSequenceManagerGetCount());
|
||||
auto numItems = static_cast<int32_t>(TitleSequenceManager::GetCount());
|
||||
if (dropdownIndex < numItems && dropdownIndex != static_cast<int32_t>(TitleGetCurrentSequence()))
|
||||
{
|
||||
Config::Get().interface.RandomTitleSequence = false;
|
||||
@@ -1843,7 +1843,7 @@ static Widget *window_options_page_widgets[] = {
|
||||
}
|
||||
else
|
||||
{
|
||||
auto name = TitleSequenceManagerGetName(TitleGetConfigSequence());
|
||||
auto name = TitleSequenceManager::GetName(TitleGetConfigSequence());
|
||||
ft.Add<StringId>(STR_STRING);
|
||||
ft.Add<utf8*>(name);
|
||||
}
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
static std::vector<std::string> GetCommandLineArgs(int argc, wchar_t** argvW);
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
|
||||
using namespace OpenRCT2;
|
||||
using namespace OpenRCT2::Drawing;
|
||||
|
||||
static int32_t CommandLineForSpriteCombine(const char** argv, int32_t argc);
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
# include <android/log.h>
|
||||
#endif
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
[[maybe_unused]] static bool _log_location_enabled = true;
|
||||
bool _log_levels[EnumValue(DiagnosticLevel::Count)] = {
|
||||
true, true, true, false, true,
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
namespace Editor
|
||||
namespace OpenRCT2::Editor
|
||||
{
|
||||
static std::array<std::vector<uint8_t>, EnumValue(ObjectType::Count)> _editorSelectedObjectFlags;
|
||||
|
||||
@@ -530,7 +530,7 @@ namespace Editor
|
||||
list[index] |= flags;
|
||||
}
|
||||
}
|
||||
} // namespace Editor
|
||||
} // namespace OpenRCT2::Editor
|
||||
|
||||
void EditorOpenWindowsForCurrentStep()
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
struct ResultWithMessage;
|
||||
|
||||
namespace Editor
|
||||
namespace OpenRCT2::Editor
|
||||
{
|
||||
void Load();
|
||||
void ConvertSaveToScenario();
|
||||
@@ -29,7 +29,7 @@ namespace Editor
|
||||
uint8_t GetSelectedObjectFlags(ObjectType objectType, size_t index);
|
||||
void ClearSelectedObject(ObjectType objectType, size_t index, uint32_t flags);
|
||||
void SetSelectedObject(ObjectType objectType, size_t index, uint32_t flags);
|
||||
} // namespace Editor
|
||||
} // namespace OpenRCT2::Editor
|
||||
|
||||
enum class EditorStep : uint8_t
|
||||
{
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
#include <iterator>
|
||||
#include <vector>
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
std::optional<StringId> _gSceneryGroupPartialSelectError;
|
||||
std::vector<uint8_t> _objectSelectionFlags;
|
||||
uint32_t _numSelectedObjectsForType[EnumValue(ObjectType::Count)];
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#include "scenario/Scenario.h"
|
||||
#include "util/SawyerCoding.h"
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
static bool TryClassifyAsPark(OpenRCT2::IStream* stream, ClassifiedFileInfo* result);
|
||||
static bool TryClassifyAsS6(OpenRCT2::IStream* stream, ClassifiedFileInfo* result);
|
||||
static bool TryClassifyAsS4(OpenRCT2::IStream* stream, ClassifiedFileInfo* result);
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace ParkImporter
|
||||
namespace OpenRCT2::ParkImporter
|
||||
{
|
||||
std::unique_ptr<IParkImporter> Create(const std::string& hintPath)
|
||||
{
|
||||
@@ -53,4 +53,4 @@ namespace ParkImporter
|
||||
{
|
||||
return String::IEquals(extension, ".sc4") || String::IEquals(extension, ".sc6") || String::IEquals(extension, ".sea");
|
||||
}
|
||||
} // namespace ParkImporter
|
||||
} // namespace OpenRCT2::ParkImporter
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
virtual bool GetDetails(ScenarioIndexEntry* dst) = 0;
|
||||
};
|
||||
|
||||
namespace ParkImporter
|
||||
namespace OpenRCT2::ParkImporter
|
||||
{
|
||||
[[nodiscard]] std::unique_ptr<IParkImporter> Create(const std::string& hintPath);
|
||||
[[nodiscard]] std::unique_ptr<IParkImporter> CreateS4();
|
||||
@@ -71,7 +71,7 @@ namespace ParkImporter
|
||||
bool ExtensionIsOpenRCT2ParkFile(std::string_view extension);
|
||||
bool ExtensionIsRCT1(std::string_view extension);
|
||||
bool ExtensionIsScenario(std::string_view extension);
|
||||
} // namespace ParkImporter
|
||||
} // namespace OpenRCT2::ParkImporter
|
||||
|
||||
class ObjectLoadException : public std::exception
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace TrackImporter
|
||||
namespace OpenRCT2::TrackImporter
|
||||
{
|
||||
std::unique_ptr<ITrackImporter> Create(const std::string& hintPath)
|
||||
{
|
||||
@@ -35,4 +35,4 @@ namespace TrackImporter
|
||||
{
|
||||
return String::IEquals(extension, ".td4");
|
||||
}
|
||||
} // namespace TrackImporter
|
||||
} // namespace OpenRCT2::TrackImporter
|
||||
|
||||
@@ -30,11 +30,11 @@ public:
|
||||
[[nodiscard]] virtual std::unique_ptr<TrackDesign> Import() = 0;
|
||||
};
|
||||
|
||||
namespace TrackImporter
|
||||
namespace OpenRCT2::TrackImporter
|
||||
{
|
||||
[[nodiscard]] std::unique_ptr<ITrackImporter> Create(const std::string& hintPath);
|
||||
[[nodiscard]] std::unique_ptr<ITrackImporter> CreateTD4();
|
||||
[[nodiscard]] std::unique_ptr<ITrackImporter> CreateTD6();
|
||||
|
||||
bool ExtensionIsRCT1(const std::string& extension);
|
||||
} // namespace TrackImporter
|
||||
} // namespace OpenRCT2::TrackImporter
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#include "../entity/EntityRegistry.h"
|
||||
#include "GameAction.h"
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
BalloonPressAction::BalloonPressAction(EntityId spriteIndex)
|
||||
: _spriteIndex(spriteIndex)
|
||||
{
|
||||
|
||||
@@ -25,6 +25,6 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
};
|
||||
|
||||
@@ -32,8 +32,8 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
|
||||
private:
|
||||
PathElement* GetValidPathElement() const;
|
||||
|
||||
@@ -25,8 +25,8 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
|
||||
private:
|
||||
BannerElement* GetBannerElementAt() const;
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
#include "../world/Banner.h"
|
||||
#include "GameAction.h"
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
BannerSetColourAction::BannerSetColourAction(const CoordsXYZD& loc, uint8_t primaryColour)
|
||||
: _loc(loc)
|
||||
, _primaryColour(primaryColour)
|
||||
|
||||
@@ -26,9 +26,9 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
|
||||
private:
|
||||
GameActions::Result QueryExecute(bool isExecuting) const;
|
||||
OpenRCT2::GameActions::Result QueryExecute(bool isExecuting) const;
|
||||
};
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
#include "../world/Banner.h"
|
||||
#include "GameAction.h"
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
BannerSetNameAction::BannerSetNameAction(BannerIndex bannerIndex, const std::string& name)
|
||||
: _bannerIndex(bannerIndex)
|
||||
, _name(name)
|
||||
|
||||
@@ -26,6 +26,6 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
};
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
#include "../world/Banner.h"
|
||||
#include "GameAction.h"
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
BannerSetStyleAction::BannerSetStyleAction(BannerSetStyleType type, BannerIndex bannerIndex, uint8_t parameter)
|
||||
: _type(type)
|
||||
, _bannerIndex(bannerIndex)
|
||||
|
||||
@@ -37,6 +37,6 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
};
|
||||
|
||||
@@ -29,8 +29,8 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
|
||||
private:
|
||||
ParametersRange GetParameterRange(CheatType cheatType) const;
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
#include "SmallSceneryRemoveAction.h"
|
||||
#include "WallRemoveAction.h"
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
ClearAction::ClearAction(MapRange range, ClearableItems itemsToClear)
|
||||
: _range(range)
|
||||
, _itemsToClear(itemsToClear)
|
||||
|
||||
@@ -13,16 +13,14 @@
|
||||
#include "../management/Finance.h"
|
||||
#include "GameAction.h"
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
using ClearableItems = uint8_t;
|
||||
|
||||
namespace CLEARABLE_ITEMS
|
||||
namespace OpenRCT2::CLEARABLE_ITEMS
|
||||
{
|
||||
constexpr ClearableItems SCENERY_SMALL = 1 << 0;
|
||||
constexpr ClearableItems SCENERY_LARGE = 1 << 1;
|
||||
constexpr ClearableItems SCENERY_FOOTPATH = 1 << 2;
|
||||
} // namespace CLEARABLE_ITEMS
|
||||
} // namespace OpenRCT2::CLEARABLE_ITEMS
|
||||
|
||||
class ClearAction final : public GameActionBase<GameCommand::ClearScenery>
|
||||
{
|
||||
@@ -39,12 +37,12 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
|
||||
private:
|
||||
GameActions::Result CreateResult() const;
|
||||
GameActions::Result QueryExecute(bool executing) const;
|
||||
OpenRCT2::GameActions::Result CreateResult() const;
|
||||
OpenRCT2::GameActions::Result QueryExecute(bool executing) const;
|
||||
money64 ClearSceneryFromTile(const CoordsXY& tilePos, bool executing) const;
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#include "../Diagnostic.h"
|
||||
#include "../GameState.h"
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
ClimateSetAction::ClimateSetAction(ClimateType climate)
|
||||
: _climate(climate)
|
||||
{
|
||||
|
||||
@@ -26,6 +26,6 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
};
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
# include "../Context.h"
|
||||
# include "../scripting/ScriptEngine.h"
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
CustomAction::CustomAction(const std::string& id, const std::string& json, const std::string& pluginName)
|
||||
: _id(id)
|
||||
, _json(json)
|
||||
|
||||
@@ -31,8 +31,8 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
#include "../world/Scenery.h"
|
||||
#include "../world/Wall.h"
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
FootpathAdditionPlaceAction::FootpathAdditionPlaceAction(const CoordsXYZ& loc, ObjectEntryIndex pathItemType)
|
||||
: _loc(loc)
|
||||
, _entryIndex(pathItemType)
|
||||
|
||||
@@ -26,6 +26,6 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
};
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
#include "../world/Park.h"
|
||||
#include "../world/Wall.h"
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
FootpathAdditionRemoveAction::FootpathAdditionRemoveAction(const CoordsXYZ& loc)
|
||||
: _loc(loc)
|
||||
{
|
||||
|
||||
@@ -25,6 +25,6 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
};
|
||||
|
||||
@@ -32,11 +32,11 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
|
||||
private:
|
||||
GameActions::Result ElementInsertQuery(GameActions::Result res) const;
|
||||
GameActions::Result ElementInsertExecute(GameActions::Result res) const;
|
||||
OpenRCT2::GameActions::Result ElementInsertQuery(OpenRCT2::GameActions::Result res) const;
|
||||
OpenRCT2::GameActions::Result ElementInsertExecute(OpenRCT2::GameActions::Result res) const;
|
||||
bool IsSameAsEntranceElement(const EntranceElement& entranceElement) const;
|
||||
};
|
||||
|
||||
@@ -32,14 +32,14 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
|
||||
private:
|
||||
GameActions::Result ElementUpdateQuery(PathElement* pathElement, GameActions::Result res) const;
|
||||
GameActions::Result ElementUpdateExecute(PathElement* pathElement, GameActions::Result res) const;
|
||||
GameActions::Result ElementInsertQuery(GameActions::Result res) const;
|
||||
GameActions::Result ElementInsertExecute(GameActions::Result res) const;
|
||||
OpenRCT2::GameActions::Result ElementUpdateQuery(PathElement* pathElement, OpenRCT2::GameActions::Result res) const;
|
||||
OpenRCT2::GameActions::Result ElementUpdateExecute(PathElement* pathElement, OpenRCT2::GameActions::Result res) const;
|
||||
OpenRCT2::GameActions::Result ElementInsertQuery(OpenRCT2::GameActions::Result res) const;
|
||||
OpenRCT2::GameActions::Result ElementInsertExecute(OpenRCT2::GameActions::Result res) const;
|
||||
void AutomaticallySetPeepSpawn() const;
|
||||
void RemoveIntersectingWalls(PathElement* pathElement) const;
|
||||
PathElement* MapGetFootpathElementSlope(const CoordsXYZ& footpathPos, int32_t slope) const;
|
||||
|
||||
@@ -26,11 +26,11 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
|
||||
private:
|
||||
TileElement* GetFootpathElement() const;
|
||||
money64 GetRefundPrice(TileElement* footpathElement) const;
|
||||
GameActions::Result RemoveBannersAtElement(const CoordsXY& loc, TileElement* tileElement) const;
|
||||
OpenRCT2::GameActions::Result RemoveBannersAtElement(const CoordsXY& loc, TileElement* tileElement) const;
|
||||
};
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
namespace GameActions
|
||||
namespace OpenRCT2::GameActions
|
||||
{
|
||||
struct QueuedGameAction
|
||||
{
|
||||
@@ -467,7 +467,7 @@ namespace GameActions
|
||||
{
|
||||
return ExecuteInternal(action, false);
|
||||
}
|
||||
} // namespace GameActions
|
||||
} // namespace OpenRCT2::GameActions
|
||||
|
||||
const char* GameAction::GetName() const
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
namespace GameActions
|
||||
namespace OpenRCT2::GameActions
|
||||
{
|
||||
namespace Flags
|
||||
{
|
||||
@@ -30,7 +30,7 @@ namespace GameActions
|
||||
constexpr uint16_t IgnoreForReplays = 1 << 3;
|
||||
} // namespace Flags
|
||||
|
||||
} // namespace GameActions
|
||||
} // namespace OpenRCT2::GameActions
|
||||
|
||||
#ifdef __WARN_SUGGEST_FINAL_METHODS__
|
||||
# pragma GCC diagnostic push
|
||||
@@ -112,7 +112,7 @@ class GameAction
|
||||
{
|
||||
public:
|
||||
using Ptr = std::unique_ptr<GameAction>;
|
||||
using Callback_t = std::function<void(const class GameAction*, const GameActions::Result*)>;
|
||||
using Callback_t = std::function<void(const class GameAction*, const OpenRCT2::GameActions::Result*)>;
|
||||
|
||||
private:
|
||||
GameCommand const _type;
|
||||
@@ -152,7 +152,7 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the GameActions::Flags flags that are enabled for this game action.
|
||||
* Gets the OpenRCT2::GameActions::Flags flags that are enabled for this game action.
|
||||
*/
|
||||
virtual uint16_t GetActionFlags() const
|
||||
{
|
||||
@@ -161,12 +161,12 @@ public:
|
||||
|
||||
if ((GetFlags() & GAME_COMMAND_FLAG_GHOST) != 0 || (GetFlags() & GAME_COMMAND_FLAG_NO_SPEND) != 0)
|
||||
{
|
||||
flags |= GameActions::Flags::ClientOnly;
|
||||
flags |= OpenRCT2::GameActions::Flags::ClientOnly;
|
||||
}
|
||||
|
||||
if (GetFlags() & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED)
|
||||
{
|
||||
flags |= GameActions::Flags::AllowWhilePaused;
|
||||
flags |= OpenRCT2::GameActions::Flags::AllowWhilePaused;
|
||||
}
|
||||
|
||||
return flags;
|
||||
@@ -233,12 +233,12 @@ public:
|
||||
/**
|
||||
* Query the result of the game action without changing the game state.
|
||||
*/
|
||||
virtual GameActions::Result Query() const = 0;
|
||||
virtual OpenRCT2::GameActions::Result Query() const = 0;
|
||||
|
||||
/**
|
||||
* Apply the game action and change the game state.
|
||||
*/
|
||||
virtual GameActions::Result Execute() const = 0;
|
||||
virtual OpenRCT2::GameActions::Result Execute() const = 0;
|
||||
|
||||
bool LocationValid(const CoordsXY& coords) const;
|
||||
};
|
||||
@@ -262,7 +262,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
namespace GameActions
|
||||
namespace OpenRCT2::GameActions
|
||||
{
|
||||
using GameActionFactory = GameAction* (*)();
|
||||
|
||||
@@ -286,11 +286,11 @@ namespace GameActions
|
||||
GameAction::Ptr Clone(const GameAction* action);
|
||||
|
||||
// This should be used if a round trip is to be expected.
|
||||
GameActions::Result Query(const GameAction* action);
|
||||
GameActions::Result Execute(const GameAction* action);
|
||||
OpenRCT2::GameActions::Result Query(const GameAction* action);
|
||||
OpenRCT2::GameActions::Result Execute(const GameAction* action);
|
||||
|
||||
// This should be used from within game actions.
|
||||
GameActions::Result QueryNested(const GameAction* action);
|
||||
GameActions::Result ExecuteNested(const GameAction* action);
|
||||
OpenRCT2::GameActions::Result QueryNested(const GameAction* action);
|
||||
OpenRCT2::GameActions::Result ExecuteNested(const GameAction* action);
|
||||
|
||||
} // namespace GameActions
|
||||
} // namespace OpenRCT2::GameActions
|
||||
|
||||
@@ -95,7 +95,9 @@
|
||||
|
||||
#include <array>
|
||||
|
||||
namespace GameActions
|
||||
using namespace OpenRCT2;
|
||||
|
||||
namespace OpenRCT2::GameActions
|
||||
{
|
||||
struct GameActionEntry
|
||||
{
|
||||
@@ -255,4 +257,4 @@ namespace GameActions
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace GameActions
|
||||
} // namespace OpenRCT2::GameActions
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
namespace GameActions
|
||||
namespace OpenRCT2::GameActions
|
||||
{
|
||||
Result::Result(GameActions::Status error, StringId title, StringId message, uint8_t* args /*= nullptr*/)
|
||||
: Error(error)
|
||||
@@ -43,4 +43,4 @@ namespace GameActions
|
||||
return std::visit(StringVariantVisitor{ ErrorMessageArgs.data() }, ErrorMessage);
|
||||
}
|
||||
|
||||
} // namespace GameActions
|
||||
} // namespace OpenRCT2::GameActions
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include <type_traits>
|
||||
#include <variant>
|
||||
|
||||
namespace GameActions
|
||||
namespace OpenRCT2::GameActions
|
||||
{
|
||||
/**
|
||||
* Common error codes for game actions.
|
||||
@@ -56,7 +56,7 @@ namespace GameActions
|
||||
public:
|
||||
using StringVariant = std::variant<std::string, StringId>;
|
||||
|
||||
GameActions::Status Error = GameActions::Status::Ok;
|
||||
OpenRCT2::GameActions::Status Error = OpenRCT2::GameActions::Status::Ok;
|
||||
StringVariant ErrorTitle = STR_NONE;
|
||||
StringVariant ErrorMessage = STR_NONE;
|
||||
std::array<uint8_t, 32> ErrorMessageArgs{};
|
||||
@@ -74,7 +74,7 @@ namespace GameActions
|
||||
#endif
|
||||
|
||||
Result() = default;
|
||||
Result(GameActions::Status error, StringId title, StringId message, uint8_t* args = nullptr);
|
||||
Result(OpenRCT2::GameActions::Status error, StringId title, StringId message, uint8_t* args = nullptr);
|
||||
|
||||
std::string GetErrorTitle() const;
|
||||
std::string GetErrorMessage() const;
|
||||
@@ -102,4 +102,4 @@ namespace GameActions
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace GameActions
|
||||
} // namespace OpenRCT2::GameActions
|
||||
|
||||
@@ -25,8 +25,8 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
|
||||
private:
|
||||
bool IsValidSpeed(int32_t speed) const;
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../entity/EntityRegistry.h"
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
GuestSetFlagsAction::GuestSetFlagsAction(EntityId peepId, uint32_t flags)
|
||||
: _peepId(peepId)
|
||||
, _newFlags(flags)
|
||||
|
||||
@@ -26,6 +26,6 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
};
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#include "../windows/Intent.h"
|
||||
#include "../world/Park.h"
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
GuestSetNameAction::GuestSetNameAction(EntityId spriteIndex, const std::string& name)
|
||||
: _spriteIndex(spriteIndex)
|
||||
, _name(name)
|
||||
|
||||
@@ -29,6 +29,6 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
};
|
||||
|
||||
@@ -39,10 +39,10 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
|
||||
private:
|
||||
GameActions::Result QueryExecute(bool isExecuting) const;
|
||||
GameActions::Result MapBuyLandRightsForTile(const CoordsXY& loc, bool isExecuting) const;
|
||||
OpenRCT2::GameActions::Result QueryExecute(bool isExecuting) const;
|
||||
OpenRCT2::GameActions::Result MapBuyLandRightsForTile(const CoordsXY& loc, bool isExecuting) const;
|
||||
};
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
#include "../world/SurfaceData.h"
|
||||
#include "../world/tile_element/Slope.h"
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
LandLowerAction::LandLowerAction(const CoordsXY& coords, MapRange range, uint8_t selectionType)
|
||||
: _coords(coords)
|
||||
, _range(range)
|
||||
|
||||
@@ -27,9 +27,9 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
|
||||
private:
|
||||
GameActions::Result QueryExecute(bool isExecuting) const;
|
||||
OpenRCT2::GameActions::Result QueryExecute(bool isExecuting) const;
|
||||
};
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
#include "../world/SurfaceData.h"
|
||||
#include "../world/tile_element/Slope.h"
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
LandRaiseAction::LandRaiseAction(const CoordsXY& coords, MapRange range, uint8_t selectionType)
|
||||
: _coords(coords)
|
||||
, _range(range)
|
||||
|
||||
@@ -27,9 +27,9 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
|
||||
private:
|
||||
GameActions::Result QueryExecute(bool isExecuting) const;
|
||||
OpenRCT2::GameActions::Result QueryExecute(bool isExecuting) const;
|
||||
};
|
||||
|
||||
@@ -27,8 +27,8 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
|
||||
private:
|
||||
StringId CheckParameters() const;
|
||||
|
||||
@@ -38,10 +38,10 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
|
||||
private:
|
||||
GameActions::Result QueryExecute(bool isExecuting) const;
|
||||
GameActions::Result MapBuyLandRightsForTile(const CoordsXY& loc, bool isExecuting) const;
|
||||
OpenRCT2::GameActions::Result QueryExecute(bool isExecuting) const;
|
||||
OpenRCT2::GameActions::Result MapBuyLandRightsForTile(const CoordsXY& loc, bool isExecuting) const;
|
||||
};
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
LandSmoothAction::LandSmoothAction(const CoordsXY& coords, MapRange range, uint8_t selectionType, bool isLowering)
|
||||
: _coords(coords)
|
||||
, _range(range)
|
||||
|
||||
@@ -33,11 +33,11 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
|
||||
private:
|
||||
GameActions::Result SmoothLandTile(
|
||||
OpenRCT2::GameActions::Result SmoothLandTile(
|
||||
int32_t direction, bool isExecuting, const CoordsXY& loc, SurfaceElement* surfaceElement) const;
|
||||
money64 SmoothLandRowByEdge(
|
||||
bool isExecuting, const CoordsXY& loc, int32_t expectedLandHeight1, int32_t expectedLandHeight2, int32_t stepX,
|
||||
@@ -45,5 +45,5 @@ private:
|
||||
money64 SmoothLandRowByCorner(
|
||||
bool isExecuting, const CoordsXY& loc, int32_t expectedLandHeight, int32_t stepX, int32_t stepY, int32_t direction,
|
||||
int32_t checkDirection) const;
|
||||
GameActions::Result SmoothLand(bool isExecuting) const;
|
||||
OpenRCT2::GameActions::Result SmoothLand(bool isExecuting) const;
|
||||
};
|
||||
|
||||
@@ -42,8 +42,8 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
|
||||
private:
|
||||
int16_t GetTotalNumTiles(LargeSceneryTile* tiles) const;
|
||||
|
||||
@@ -26,8 +26,8 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
|
||||
private:
|
||||
TileElement* FindLargeSceneryElement(const CoordsXYZ& pos, int32_t sequenceIndex) const;
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
#include "../object/LargeSceneryEntry.h"
|
||||
#include "../world/Scenery.h"
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
LargeScenerySetColourAction::LargeScenerySetColourAction(
|
||||
const CoordsXYZD& loc, uint8_t tileIndex, uint8_t primaryColour, uint8_t secondaryColour, uint8_t tertiaryColour)
|
||||
: _loc(loc)
|
||||
|
||||
@@ -30,9 +30,9 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
|
||||
private:
|
||||
GameActions::Result QueryExecute(bool isExecuting) const;
|
||||
OpenRCT2::GameActions::Result QueryExecute(bool isExecuting) const;
|
||||
};
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#include "../Context.h"
|
||||
#include "../OpenRCT2.h"
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
LoadOrQuitAction::LoadOrQuitAction(LoadOrQuitModes mode, PromptMode savePromptMode)
|
||||
: _mode(mode)
|
||||
, _savePromptMode(savePromptMode)
|
||||
|
||||
@@ -32,6 +32,6 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
};
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
#include "../windows/Intent.h"
|
||||
#include "../world/Park.h"
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
MapChangeSizeAction::MapChangeSizeAction(const TileCoordsXY& targetSize)
|
||||
: MapChangeSizeAction(targetSize, TileCoordsXY())
|
||||
{
|
||||
|
||||
@@ -23,8 +23,8 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
|
||||
private:
|
||||
TileCoordsXY _targetSize;
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
#include "../ride/gentle/Maze.h"
|
||||
#include "../world/ConstructionClearance.h"
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
using namespace OpenRCT2::TrackMetaData;
|
||||
|
||||
MazePlaceTrackAction::MazePlaceTrackAction(const CoordsXYZ& location, RideId rideIndex, uint16_t mazeEntry)
|
||||
|
||||
@@ -23,6 +23,6 @@ public:
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
};
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
#include "../world/Footpath.h"
|
||||
#include "../world/Park.h"
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
using namespace OpenRCT2::TrackMetaData;
|
||||
|
||||
// clang-format off
|
||||
|
||||
@@ -25,8 +25,8 @@ public:
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
|
||||
private:
|
||||
uint8_t MazeGetSegmentBit(const CoordsXY&) const;
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#include "../network/network.h"
|
||||
#include "../util/Util.h"
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
NetworkModifyGroupAction::NetworkModifyGroupAction(
|
||||
ModifyGroupType type, uint8_t groupId, const std::string name, uint32_t permissionIndex, PermissionState permissionState)
|
||||
: _type(type)
|
||||
|
||||
@@ -49,6 +49,6 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
};
|
||||
|
||||
@@ -26,8 +26,8 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
|
||||
private:
|
||||
bool CheckMapCapacity(int16_t numTiles) const;
|
||||
|
||||
@@ -25,8 +25,8 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
|
||||
private:
|
||||
void ParkEntranceRemoveSegment(const CoordsXYZ& loc) const;
|
||||
|
||||
@@ -27,10 +27,10 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
|
||||
private:
|
||||
GameActions::Result CreateResult() const;
|
||||
OpenRCT2::GameActions::Result CreateResult() const;
|
||||
money64 CalculatePrice() const;
|
||||
};
|
||||
|
||||
@@ -27,6 +27,6 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
};
|
||||
|
||||
@@ -25,6 +25,6 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
};
|
||||
|
||||
@@ -25,6 +25,6 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
};
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
#include "../windows/Intent.h"
|
||||
#include "../world/Park.h"
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
ParkSetNameAction::ParkSetNameAction(const std::string& name)
|
||||
: _name(name)
|
||||
{
|
||||
|
||||
@@ -25,6 +25,6 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
};
|
||||
|
||||
@@ -41,6 +41,6 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
};
|
||||
|
||||
@@ -27,6 +27,6 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
};
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
#include "PauseToggleAction.h"
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
uint16_t PauseToggleAction::GetActionFlags() const
|
||||
{
|
||||
return GameAction::GetActionFlags() | GameActions::Flags::AllowWhilePaused | GameActions::Flags::IgnoreForReplays;
|
||||
|
||||
@@ -20,7 +20,7 @@ public:
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
#include "../network/network.h"
|
||||
#include "../util/Util.h"
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
PeepPickupAction::PeepPickupAction(PeepPickupType type, EntityId entityId, const CoordsXYZ& loc, NetworkPlayerId_t owner)
|
||||
: _type(type)
|
||||
, _entityId(entityId)
|
||||
|
||||
@@ -37,8 +37,8 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
|
||||
private:
|
||||
void CancelConcurrentPickups(Peep* pickedPeep) const;
|
||||
|
||||
@@ -25,6 +25,6 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
};
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
|
||||
#include "../network/network.h"
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
PlayerKickAction::PlayerKickAction(NetworkPlayerId_t playerId)
|
||||
: _playerId(playerId)
|
||||
{
|
||||
|
||||
@@ -26,6 +26,6 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
};
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
|
||||
#include "../network/network.h"
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
PlayerSetGroupAction::PlayerSetGroupAction(NetworkPlayerId_t playerId, uint8_t groupId)
|
||||
: _playerId(playerId)
|
||||
, _groupId(groupId)
|
||||
|
||||
@@ -26,6 +26,6 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
};
|
||||
|
||||
@@ -32,6 +32,6 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
};
|
||||
|
||||
@@ -26,14 +26,14 @@ public:
|
||||
uint32_t GetCooldownTime() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
|
||||
private:
|
||||
GameActions::Result DemolishRide(Ride& ride) const;
|
||||
OpenRCT2::GameActions::Result DemolishRide(Ride& ride) const;
|
||||
money64 MazeRemoveTrack(const CoordsXYZD& coords) const;
|
||||
money64 DemolishTracks() const;
|
||||
GameActions::Result RefurbishRide(Ride& ride) const;
|
||||
OpenRCT2::GameActions::Result RefurbishRide(Ride& ride) const;
|
||||
money64 GetRefurbishPrice(const Ride& ride) const;
|
||||
money64 GetRefundPrice(const Ride& ride) const;
|
||||
};
|
||||
|
||||
@@ -31,8 +31,8 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
|
||||
static GameActions::Result TrackPlaceQuery(const CoordsXYZ& loc, const bool isExit);
|
||||
static OpenRCT2::GameActions::Result TrackPlaceQuery(const CoordsXYZ& loc, const bool isExit);
|
||||
};
|
||||
|
||||
@@ -28,6 +28,6 @@ public:
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result Query() const override;
|
||||
GameActions::Result Execute() const override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
};
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user