mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-18 21:43:48 +01:00
Remove macro for registration and cleanup
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
#include <set>
|
||||
#include <string>
|
||||
|
||||
struct GameAction;
|
||||
class GameAction;
|
||||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(BalloonPressAction, GameCommand::BalloonPress, GameActions::Result)
|
||||
class BalloonPressAction final : public GameActionBase<GameCommand::BalloonPress>
|
||||
{
|
||||
uint16_t _spriteIndex{ SPRITE_INDEX_NULL };
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ struct BannerPlaceActionResult
|
||||
BannerIndex bannerId = BANNER_INDEX_NULL;
|
||||
};
|
||||
|
||||
DEFINE_GAME_ACTION(BannerPlaceAction, GameCommand::PlaceBanner, GameActions::Result)
|
||||
class BannerPlaceAction final : public GameActionBase<GameCommand::PlaceBanner>
|
||||
{
|
||||
private:
|
||||
CoordsXYZD _loc;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(BannerRemoveAction, GameCommand::RemoveBanner, GameActions::Result)
|
||||
class BannerRemoveAction final : public GameActionBase<GameCommand::RemoveBanner>
|
||||
{
|
||||
private:
|
||||
CoordsXYZD _loc;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(BannerSetColourAction, GameCommand::SetBannerColour, GameActions::Result)
|
||||
class BannerSetColourAction final : public GameActionBase<GameCommand::SetBannerColour>
|
||||
{
|
||||
private:
|
||||
CoordsXYZD _loc;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(BannerSetNameAction, GameCommand::SetBannerName, GameActions::Result)
|
||||
class BannerSetNameAction final : public GameActionBase<GameCommand::SetBannerName>
|
||||
{
|
||||
private:
|
||||
BannerIndex _bannerIndex{ BANNER_INDEX_NULL };
|
||||
|
||||
@@ -21,7 +21,7 @@ enum class BannerSetStyleType : uint8_t
|
||||
Count
|
||||
};
|
||||
|
||||
DEFINE_GAME_ACTION(BannerSetStyleAction, GameCommand::SetBannerStyle, GameActions::Result)
|
||||
class BannerSetStyleAction final : public GameActionBase<GameCommand::SetBannerStyle>
|
||||
{
|
||||
private:
|
||||
BannerSetStyleType _type{ BannerSetStyleType::Count };
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "../world/Map.h"
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(ChangeMapSizeAction, GameCommand::ChangeMapSize, GameActions::Result)
|
||||
class ChangeMapSizeAction final : public GameActionBase<GameCommand::ChangeMapSize>
|
||||
{
|
||||
public:
|
||||
ChangeMapSizeAction() = default;
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace CLEARABLE_ITEMS
|
||||
constexpr ClearableItems SCENERY_FOOTPATH = 1 << 2;
|
||||
} // namespace CLEARABLE_ITEMS
|
||||
|
||||
DEFINE_GAME_ACTION(ClearAction, GameCommand::ClearScenery, GameActions::Result)
|
||||
class ClearAction final : public GameActionBase<GameCommand::ClearScenery>
|
||||
{
|
||||
private:
|
||||
MapRange _range;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "../world/Climate.h"
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(ClimateSetAction, GameCommand::SetClimate, GameActions::Result)
|
||||
class ClimateSetAction final : public GameActionBase<GameCommand::SetClimate>
|
||||
{
|
||||
private:
|
||||
ClimateType _climate{};
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
# include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(CustomAction, GameCommand::Custom, GameActions::Result)
|
||||
class CustomAction final : public GameActionBase<GameCommand::Custom>
|
||||
{
|
||||
private:
|
||||
std::string _id;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(FootpathAdditionPlaceAction, GameCommand::PlaceFootpathAddition, GameActions::Result)
|
||||
class FootpathAdditionPlaceAction final : public GameActionBase<GameCommand::PlaceFootpathAddition>
|
||||
{
|
||||
private:
|
||||
CoordsXYZ _loc;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(FootpathAdditionRemoveAction, GameCommand::RemoveFootpathAddition, GameActions::Result)
|
||||
class FootpathAdditionRemoveAction final : public GameActionBase<GameCommand::RemoveFootpathAddition>
|
||||
{
|
||||
private:
|
||||
CoordsXYZ _loc;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "../world/Footpath.h"
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(FootpathPlaceAction, GameCommand::PlacePath, GameActions::Result)
|
||||
class FootpathPlaceAction final : public GameActionBase<GameCommand::PlacePath>
|
||||
{
|
||||
private:
|
||||
CoordsXYZ _loc;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(FootpathPlaceFromTrackAction, GameCommand::PlacePathFromTrack, GameActions::Result)
|
||||
class FootpathPlaceFromTrackAction final : public GameActionBase<GameCommand::PlacePathFromTrack>
|
||||
{
|
||||
private:
|
||||
CoordsXYZ _loc;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "../management/Finance.h"
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(FootpathRemoveAction, GameCommand::RemovePath, GameActions::Result)
|
||||
class FootpathRemoveAction final : public GameActionBase<GameCommand::RemovePath>
|
||||
{
|
||||
private:
|
||||
CoordsXYZ _loc;
|
||||
|
||||
@@ -60,31 +60,10 @@ namespace GameActions
|
||||
}
|
||||
};
|
||||
|
||||
static GameActionFactory _actions[EnumValue(GameCommand::Count)];
|
||||
static std::multiset<QueuedGameAction> _actionQueue;
|
||||
static uint32_t _nextUniqueId = 0;
|
||||
static bool _suspended = false;
|
||||
|
||||
GameActionFactory Register(GameCommand id, GameActionFactory factory)
|
||||
{
|
||||
const auto idx = static_cast<size_t>(id);
|
||||
|
||||
Guard::Assert(idx < std::size(_actions));
|
||||
Guard::ArgumentNotNull(factory);
|
||||
|
||||
_actions[idx] = factory;
|
||||
return factory;
|
||||
}
|
||||
|
||||
bool IsValidId(uint32_t id)
|
||||
{
|
||||
if (id < std::size(_actions))
|
||||
{
|
||||
return _actions[id] != nullptr;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void SuspendQueue()
|
||||
{
|
||||
_suspended = true;
|
||||
@@ -186,31 +165,9 @@ namespace GameActions
|
||||
return;
|
||||
|
||||
Register();
|
||||
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
std::unique_ptr<GameAction> Create(GameCommand id)
|
||||
{
|
||||
Initialize();
|
||||
|
||||
const auto idx = static_cast<size_t>(id);
|
||||
|
||||
GameAction* result = nullptr;
|
||||
if (idx < std::size(_actions))
|
||||
{
|
||||
GameActionFactory factory = _actions[idx];
|
||||
if (factory != nullptr)
|
||||
{
|
||||
result = factory();
|
||||
}
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
Guard::ArgumentNotNull(result, "Attempting to create unregistered gameaction: %u", id);
|
||||
#endif
|
||||
return std::unique_ptr<GameAction>(result);
|
||||
}
|
||||
|
||||
GameAction::Ptr Clone(const GameAction* action)
|
||||
{
|
||||
std::unique_ptr<GameAction> ga = GameActions::Create(action->GetType());
|
||||
@@ -516,6 +473,11 @@ namespace GameActions
|
||||
}
|
||||
} // namespace GameActions
|
||||
|
||||
const char* GameAction::GetName() const
|
||||
{
|
||||
return GameActions::GetName(_type);
|
||||
}
|
||||
|
||||
bool GameAction::LocationValid(const CoordsXY& coords) const
|
||||
{
|
||||
auto result = map_is_location_valid(coords);
|
||||
|
||||
@@ -92,11 +92,11 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
struct GameAction
|
||||
class GameAction
|
||||
{
|
||||
public:
|
||||
using Ptr = std::unique_ptr<GameAction>;
|
||||
using Callback_t = std::function<void(const struct GameAction*, const GameActions::Result*)>;
|
||||
using Callback_t = std::function<void(const class GameAction*, const GameActions::Result*)>;
|
||||
|
||||
private:
|
||||
GameCommand const _type;
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
|
||||
virtual ~GameAction() = default;
|
||||
|
||||
virtual const char* GetName() const = 0;
|
||||
const char* GetName() const;
|
||||
|
||||
virtual void AcceptParameters(GameActionParameterVisitor&)
|
||||
{
|
||||
@@ -235,11 +235,9 @@ template<GameCommand TId> struct GameActionNameQuery
|
||||
{
|
||||
};
|
||||
|
||||
template<GameCommand TType, typename TResultType> struct GameActionBase : GameAction
|
||||
template<GameCommand TType> struct GameActionBase : GameAction
|
||||
{
|
||||
public:
|
||||
using Result = TResultType;
|
||||
|
||||
static constexpr GameCommand TYPE = TType;
|
||||
|
||||
GameActionBase()
|
||||
@@ -247,15 +245,10 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual const char* GetName() const override
|
||||
{
|
||||
return GameActionNameQuery<TType>::Name();
|
||||
}
|
||||
|
||||
protected:
|
||||
template<class... TTypes> static constexpr std::unique_ptr<TResultType> MakeResult(TTypes&&... args)
|
||||
template<class... TTypes> static std::unique_ptr<GameActions::Result> MakeResult(TTypes&&... args)
|
||||
{
|
||||
return std::make_unique<TResultType>(std::forward<TTypes>(args)...);
|
||||
return std::make_unique<GameActions::Result>(std::forward<TTypes>(args)...);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -266,6 +259,7 @@ namespace GameActions
|
||||
void Initialize();
|
||||
void Register();
|
||||
bool IsValidId(uint32_t id);
|
||||
const char* GetName(GameCommand id);
|
||||
|
||||
// Halts the queue processing until ResumeQueue is called, any calls to ProcessQueue
|
||||
// will have no effect during suspension. It has no effect of actions that will not
|
||||
@@ -300,16 +294,4 @@ namespace GameActions
|
||||
return factory;
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
#define DEFINE_GAME_ACTION(cls, id, res) \
|
||||
template<> struct GameActionNameQuery<id> \
|
||||
{ \
|
||||
static const char* Name() \
|
||||
{ \
|
||||
return #cls; \
|
||||
} \
|
||||
}; \
|
||||
struct cls final : public GameActionBase<id, res>
|
||||
// clang-format on
|
||||
|
||||
} // namespace GameActions
|
||||
|
||||
@@ -1,181 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* Copyright (c) 2014-2020 OpenRCT2 developers
|
||||
*
|
||||
* For a complete list of all authors, please refer to contributors.md
|
||||
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
||||
*
|
||||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "BalloonPressAction.h"
|
||||
#include "BannerPlaceAction.h"
|
||||
#include "BannerRemoveAction.h"
|
||||
#include "BannerSetColourAction.h"
|
||||
#include "BannerSetNameAction.h"
|
||||
#include "BannerSetStyleAction.h"
|
||||
#include "ChangeMapSizeAction.h"
|
||||
#include "ClearAction.h"
|
||||
#include "ClimateSetAction.h"
|
||||
#include "CustomAction.h"
|
||||
#include "FootpathAdditionPlaceAction.h"
|
||||
#include "FootpathAdditionRemoveAction.h"
|
||||
#include "FootpathPlaceAction.h"
|
||||
#include "FootpathPlaceFromTrackAction.h"
|
||||
#include "FootpathRemoveAction.h"
|
||||
#include "GameAction.h"
|
||||
#include "GuestSetFlagsAction.h"
|
||||
#include "GuestSetNameAction.h"
|
||||
#include "LandBuyRightsAction.h"
|
||||
#include "LandLowerAction.h"
|
||||
#include "LandRaiseAction.h"
|
||||
#include "LandSetHeightAction.h"
|
||||
#include "LandSetRightsAction.h"
|
||||
#include "LandSmoothAction.h"
|
||||
#include "LargeSceneryPlaceAction.h"
|
||||
#include "LargeSceneryRemoveAction.h"
|
||||
#include "LargeScenerySetColourAction.h"
|
||||
#include "LoadOrQuitAction.h"
|
||||
#include "MazePlaceTrackAction.h"
|
||||
#include "MazeSetTrackAction.h"
|
||||
#include "NetworkModifyGroupAction.h"
|
||||
#include "ParkEntranceRemoveAction.h"
|
||||
#include "ParkMarketingAction.h"
|
||||
#include "ParkSetDateAction.h"
|
||||
#include "ParkSetLoanAction.h"
|
||||
#include "ParkSetNameAction.h"
|
||||
#include "ParkSetParameterAction.h"
|
||||
#include "ParkSetResearchFundingAction.h"
|
||||
#include "PauseToggleAction.h"
|
||||
#include "PeepPickupAction.h"
|
||||
#include "PlaceParkEntranceAction.h"
|
||||
#include "PlacePeepSpawnAction.h"
|
||||
#include "PlayerKickAction.h"
|
||||
#include "PlayerSetGroupAction.h"
|
||||
#include "RideCreateAction.h"
|
||||
#include "RideDemolishAction.h"
|
||||
#include "RideEntranceExitPlaceAction.h"
|
||||
#include "RideEntranceExitRemoveAction.h"
|
||||
#include "RideSetAppearanceAction.h"
|
||||
#include "RideSetColourSchemeAction.h"
|
||||
#include "RideSetNameAction.h"
|
||||
#include "RideSetPriceAction.h"
|
||||
#include "RideSetSettingAction.h"
|
||||
#include "RideSetStatusAction.h"
|
||||
#include "RideSetVehicleAction.h"
|
||||
#include "ScenarioSetSettingAction.h"
|
||||
#include "SetCheatAction.h"
|
||||
#include "SetParkEntranceFeeAction.h"
|
||||
#include "SignSetNameAction.h"
|
||||
#include "SignSetStyleAction.h"
|
||||
#include "SmallSceneryPlaceAction.h"
|
||||
#include "SmallSceneryRemoveAction.h"
|
||||
#include "SmallScenerySetColourAction.h"
|
||||
#include "StaffFireAction.h"
|
||||
#include "StaffHireNewAction.h"
|
||||
#include "StaffSetColourAction.h"
|
||||
#include "StaffSetCostumeAction.h"
|
||||
#include "StaffSetNameAction.h"
|
||||
#include "StaffSetOrdersAction.h"
|
||||
#include "StaffSetPatrolAreaAction.h"
|
||||
#include "SurfaceSetStyleAction.h"
|
||||
#include "TileModifyAction.h"
|
||||
#include "TrackDesignAction.h"
|
||||
#include "TrackPlaceAction.h"
|
||||
#include "TrackRemoveAction.h"
|
||||
#include "TrackSetBrakeSpeedAction.h"
|
||||
#include "WallPlaceAction.h"
|
||||
#include "WallRemoveAction.h"
|
||||
#include "WallSetColourAction.h"
|
||||
#include "WaterLowerAction.h"
|
||||
#include "WaterRaiseAction.h"
|
||||
#include "WaterSetHeightAction.h"
|
||||
|
||||
namespace GameActions
|
||||
{
|
||||
void Register()
|
||||
{
|
||||
Register<BalloonPressAction>();
|
||||
Register<BannerPlaceAction>();
|
||||
Register<BannerRemoveAction>();
|
||||
Register<BannerSetColourAction>();
|
||||
Register<BannerSetNameAction>();
|
||||
Register<BannerSetStyleAction>();
|
||||
Register<ClimateSetAction>();
|
||||
Register<FootpathPlaceAction>();
|
||||
Register<FootpathPlaceFromTrackAction>();
|
||||
Register<FootpathRemoveAction>();
|
||||
Register<FootpathAdditionPlaceAction>();
|
||||
Register<FootpathAdditionRemoveAction>();
|
||||
Register<GuestSetNameAction>();
|
||||
Register<MazePlaceTrackAction>();
|
||||
Register<MazeSetTrackAction>();
|
||||
Register<NetworkModifyGroupAction>();
|
||||
Register<ParkMarketingAction>();
|
||||
Register<ParkEntranceRemoveAction>();
|
||||
Register<ParkSetLoanAction>();
|
||||
Register<ParkSetNameAction>();
|
||||
Register<ParkSetParameterAction>();
|
||||
Register<ParkSetResearchFundingAction>();
|
||||
Register<PeepPickupAction>();
|
||||
Register<PlaceParkEntranceAction>();
|
||||
Register<PlacePeepSpawnAction>();
|
||||
Register<PlayerKickAction>();
|
||||
Register<PlayerSetGroupAction>();
|
||||
Register<RideCreateAction>();
|
||||
Register<RideDemolishAction>();
|
||||
Register<RideEntranceExitPlaceAction>();
|
||||
Register<RideEntranceExitRemoveAction>();
|
||||
Register<RideSetColourSchemeAction>();
|
||||
Register<RideSetNameAction>();
|
||||
Register<RideSetPriceAction>();
|
||||
Register<RideSetStatusAction>();
|
||||
Register<RideSetAppearanceAction>();
|
||||
Register<RideSetVehicleAction>();
|
||||
Register<RideSetSettingAction>();
|
||||
Register<ScenarioSetSettingAction>();
|
||||
Register<SetParkEntranceFeeAction>();
|
||||
Register<SignSetNameAction>();
|
||||
Register<SignSetStyleAction>();
|
||||
Register<StaffFireAction>();
|
||||
Register<StaffHireNewAction>();
|
||||
Register<StaffSetColourAction>();
|
||||
Register<StaffSetNameAction>();
|
||||
Register<StaffSetOrdersAction>();
|
||||
Register<StaffSetCostumeAction>();
|
||||
Register<StaffSetPatrolAreaAction>();
|
||||
Register<SurfaceSetStyleAction>();
|
||||
Register<WallPlaceAction>();
|
||||
Register<WallRemoveAction>();
|
||||
Register<WallSetColourAction>();
|
||||
Register<SmallSceneryPlaceAction>();
|
||||
Register<SmallSceneryRemoveAction>();
|
||||
Register<SmallScenerySetColourAction>();
|
||||
Register<LargeSceneryPlaceAction>();
|
||||
Register<LargeSceneryRemoveAction>();
|
||||
Register<LargeScenerySetColourAction>();
|
||||
Register<LandBuyRightsAction>();
|
||||
Register<LandLowerAction>();
|
||||
Register<LandRaiseAction>();
|
||||
Register<LandSetHeightAction>();
|
||||
Register<LandSetRightsAction>();
|
||||
Register<LandSmoothAction>();
|
||||
Register<TileModifyAction>();
|
||||
Register<TrackDesignAction>();
|
||||
Register<TrackPlaceAction>();
|
||||
Register<TrackRemoveAction>();
|
||||
Register<TrackSetBrakeSpeedAction>();
|
||||
Register<ClearAction>();
|
||||
Register<PauseToggleAction>();
|
||||
Register<LoadOrQuitAction>();
|
||||
Register<WaterSetHeightAction>();
|
||||
Register<WaterLowerAction>();
|
||||
Register<WaterRaiseAction>();
|
||||
Register<GuestSetFlagsAction>();
|
||||
Register<ParkSetDateAction>();
|
||||
Register<SetCheatAction>();
|
||||
Register<ChangeMapSizeAction>();
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
Register<CustomAction>();
|
||||
#endif
|
||||
}
|
||||
} // namespace GameActions
|
||||
399
src/openrct2/actions/GameActionRegistry.cpp
Normal file
399
src/openrct2/actions/GameActionRegistry.cpp
Normal file
@@ -0,0 +1,399 @@
|
||||
/*****************************************************************************
|
||||
* Copyright (c) 2014-2020 OpenRCT2 developers
|
||||
*
|
||||
* For a complete list of all authors, please refer to contributors.md
|
||||
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
||||
*
|
||||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "BalloonPressAction.h"
|
||||
#include "BannerPlaceAction.h"
|
||||
#include "BannerRemoveAction.h"
|
||||
#include "BannerSetColourAction.h"
|
||||
#include "BannerSetNameAction.h"
|
||||
#include "BannerSetStyleAction.h"
|
||||
#include "ChangeMapSizeAction.h"
|
||||
#include "ClearAction.h"
|
||||
#include "ClimateSetAction.h"
|
||||
#include "CustomAction.h"
|
||||
#include "FootpathAdditionPlaceAction.h"
|
||||
#include "FootpathAdditionRemoveAction.h"
|
||||
#include "FootpathPlaceAction.h"
|
||||
#include "FootpathPlaceFromTrackAction.h"
|
||||
#include "FootpathRemoveAction.h"
|
||||
#include "GameAction.h"
|
||||
#include "GuestSetFlagsAction.h"
|
||||
#include "GuestSetNameAction.h"
|
||||
#include "LandBuyRightsAction.h"
|
||||
#include "LandLowerAction.h"
|
||||
#include "LandRaiseAction.h"
|
||||
#include "LandSetHeightAction.h"
|
||||
#include "LandSetRightsAction.h"
|
||||
#include "LandSmoothAction.h"
|
||||
#include "LargeSceneryPlaceAction.h"
|
||||
#include "LargeSceneryRemoveAction.h"
|
||||
#include "LargeScenerySetColourAction.h"
|
||||
#include "LoadOrQuitAction.h"
|
||||
#include "MazePlaceTrackAction.h"
|
||||
#include "MazeSetTrackAction.h"
|
||||
#include "NetworkModifyGroupAction.h"
|
||||
#include "ParkEntranceRemoveAction.h"
|
||||
#include "ParkMarketingAction.h"
|
||||
#include "ParkSetDateAction.h"
|
||||
#include "ParkSetLoanAction.h"
|
||||
#include "ParkSetNameAction.h"
|
||||
#include "ParkSetParameterAction.h"
|
||||
#include "ParkSetResearchFundingAction.h"
|
||||
#include "PauseToggleAction.h"
|
||||
#include "PeepPickupAction.h"
|
||||
#include "PlaceParkEntranceAction.h"
|
||||
#include "PlacePeepSpawnAction.h"
|
||||
#include "PlayerKickAction.h"
|
||||
#include "PlayerSetGroupAction.h"
|
||||
#include "RideCreateAction.h"
|
||||
#include "RideDemolishAction.h"
|
||||
#include "RideEntranceExitPlaceAction.h"
|
||||
#include "RideEntranceExitRemoveAction.h"
|
||||
#include "RideSetAppearanceAction.h"
|
||||
#include "RideSetColourSchemeAction.h"
|
||||
#include "RideSetNameAction.h"
|
||||
#include "RideSetPriceAction.h"
|
||||
#include "RideSetSettingAction.h"
|
||||
#include "RideSetStatusAction.h"
|
||||
#include "RideSetVehicleAction.h"
|
||||
#include "ScenarioSetSettingAction.h"
|
||||
#include "SetCheatAction.h"
|
||||
#include "SetParkEntranceFeeAction.h"
|
||||
#include "SignSetNameAction.h"
|
||||
#include "SignSetStyleAction.h"
|
||||
#include "SmallSceneryPlaceAction.h"
|
||||
#include "SmallSceneryRemoveAction.h"
|
||||
#include "SmallScenerySetColourAction.h"
|
||||
#include "StaffFireAction.h"
|
||||
#include "StaffHireNewAction.h"
|
||||
#include "StaffSetColourAction.h"
|
||||
#include "StaffSetCostumeAction.h"
|
||||
#include "StaffSetNameAction.h"
|
||||
#include "StaffSetOrdersAction.h"
|
||||
#include "StaffSetPatrolAreaAction.h"
|
||||
#include "SurfaceSetStyleAction.h"
|
||||
#include "TileModifyAction.h"
|
||||
#include "TrackDesignAction.h"
|
||||
#include "TrackPlaceAction.h"
|
||||
#include "TrackRemoveAction.h"
|
||||
#include "TrackSetBrakeSpeedAction.h"
|
||||
#include "WallPlaceAction.h"
|
||||
#include "WallRemoveAction.h"
|
||||
#include "WallSetColourAction.h"
|
||||
#include "WaterLowerAction.h"
|
||||
#include "WaterRaiseAction.h"
|
||||
#include "WaterSetHeightAction.h"
|
||||
|
||||
namespace GameActions
|
||||
{
|
||||
static GameActionFactory _actions[EnumValue(GameCommand::Count)];
|
||||
|
||||
GameActionFactory Register(GameCommand id, GameActionFactory factory)
|
||||
{
|
||||
const auto idx = static_cast<size_t>(id);
|
||||
|
||||
Guard::Assert(idx < std::size(_actions));
|
||||
Guard::ArgumentNotNull(factory);
|
||||
|
||||
_actions[idx] = factory;
|
||||
return factory;
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
Register<BalloonPressAction>();
|
||||
Register<BannerPlaceAction>();
|
||||
Register<BannerRemoveAction>();
|
||||
Register<BannerSetColourAction>();
|
||||
Register<BannerSetNameAction>();
|
||||
Register<BannerSetStyleAction>();
|
||||
Register<ClimateSetAction>();
|
||||
Register<FootpathPlaceAction>();
|
||||
Register<FootpathPlaceFromTrackAction>();
|
||||
Register<FootpathRemoveAction>();
|
||||
Register<FootpathAdditionPlaceAction>();
|
||||
Register<FootpathAdditionRemoveAction>();
|
||||
Register<GuestSetNameAction>();
|
||||
Register<MazePlaceTrackAction>();
|
||||
Register<MazeSetTrackAction>();
|
||||
Register<NetworkModifyGroupAction>();
|
||||
Register<ParkMarketingAction>();
|
||||
Register<ParkEntranceRemoveAction>();
|
||||
Register<ParkSetLoanAction>();
|
||||
Register<ParkSetNameAction>();
|
||||
Register<ParkSetParameterAction>();
|
||||
Register<ParkSetResearchFundingAction>();
|
||||
Register<PeepPickupAction>();
|
||||
Register<PlaceParkEntranceAction>();
|
||||
Register<PlacePeepSpawnAction>();
|
||||
Register<PlayerKickAction>();
|
||||
Register<PlayerSetGroupAction>();
|
||||
Register<RideCreateAction>();
|
||||
Register<RideDemolishAction>();
|
||||
Register<RideEntranceExitPlaceAction>();
|
||||
Register<RideEntranceExitRemoveAction>();
|
||||
Register<RideSetColourSchemeAction>();
|
||||
Register<RideSetNameAction>();
|
||||
Register<RideSetPriceAction>();
|
||||
Register<RideSetStatusAction>();
|
||||
Register<RideSetAppearanceAction>();
|
||||
Register<RideSetVehicleAction>();
|
||||
Register<RideSetSettingAction>();
|
||||
Register<ScenarioSetSettingAction>();
|
||||
Register<SetParkEntranceFeeAction>();
|
||||
Register<SignSetNameAction>();
|
||||
Register<SignSetStyleAction>();
|
||||
Register<StaffFireAction>();
|
||||
Register<StaffHireNewAction>();
|
||||
Register<StaffSetColourAction>();
|
||||
Register<StaffSetNameAction>();
|
||||
Register<StaffSetOrdersAction>();
|
||||
Register<StaffSetCostumeAction>();
|
||||
Register<StaffSetPatrolAreaAction>();
|
||||
Register<SurfaceSetStyleAction>();
|
||||
Register<WallPlaceAction>();
|
||||
Register<WallRemoveAction>();
|
||||
Register<WallSetColourAction>();
|
||||
Register<SmallSceneryPlaceAction>();
|
||||
Register<SmallSceneryRemoveAction>();
|
||||
Register<SmallScenerySetColourAction>();
|
||||
Register<LargeSceneryPlaceAction>();
|
||||
Register<LargeSceneryRemoveAction>();
|
||||
Register<LargeScenerySetColourAction>();
|
||||
Register<LandBuyRightsAction>();
|
||||
Register<LandLowerAction>();
|
||||
Register<LandRaiseAction>();
|
||||
Register<LandSetHeightAction>();
|
||||
Register<LandSetRightsAction>();
|
||||
Register<LandSmoothAction>();
|
||||
Register<TileModifyAction>();
|
||||
Register<TrackDesignAction>();
|
||||
Register<TrackPlaceAction>();
|
||||
Register<TrackRemoveAction>();
|
||||
Register<TrackSetBrakeSpeedAction>();
|
||||
Register<ClearAction>();
|
||||
Register<PauseToggleAction>();
|
||||
Register<LoadOrQuitAction>();
|
||||
Register<WaterSetHeightAction>();
|
||||
Register<WaterLowerAction>();
|
||||
Register<WaterRaiseAction>();
|
||||
Register<GuestSetFlagsAction>();
|
||||
Register<ParkSetDateAction>();
|
||||
Register<SetCheatAction>();
|
||||
Register<ChangeMapSizeAction>();
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
Register<CustomAction>();
|
||||
#endif
|
||||
}
|
||||
|
||||
const char* GetName(GameCommand id)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case GameCommand::SetRideAppearance:
|
||||
return "SetRideAppearance";
|
||||
case GameCommand::SetLandHeight:
|
||||
return "SetLandHeight";
|
||||
case GameCommand::TogglePause:
|
||||
return "TogglePause";
|
||||
case GameCommand::PlaceTrack:
|
||||
return "PlaceTrack";
|
||||
case GameCommand::RemoveTrack:
|
||||
return "RemoveTrack";
|
||||
case GameCommand::LoadOrQuit:
|
||||
return "LoadOrQuit";
|
||||
case GameCommand::CreateRide:
|
||||
return "CreateRide";
|
||||
case GameCommand::DemolishRide:
|
||||
return "DemolishRide";
|
||||
case GameCommand::SetRideStatus:
|
||||
return "SetRideStatus";
|
||||
case GameCommand::SetRideVehicles:
|
||||
return "SetRideVehicles";
|
||||
case GameCommand::SetRideName:
|
||||
return "SetRideName";
|
||||
case GameCommand::SetRideSetting:
|
||||
return "SetRideSetting";
|
||||
case GameCommand::PlaceRideEntranceOrExit:
|
||||
return "PlaceRideEntranceOrExit";
|
||||
case GameCommand::RemoveRideEntranceOrExit:
|
||||
return "RemoveRideEntranceOrExit";
|
||||
case GameCommand::RemoveScenery:
|
||||
return "RemoveScenery";
|
||||
case GameCommand::PlaceScenery:
|
||||
return "PlaceScenery";
|
||||
case GameCommand::SetWaterHeight:
|
||||
return "SetWaterHeight";
|
||||
case GameCommand::PlacePath:
|
||||
return "PlacePath";
|
||||
case GameCommand::PlacePathFromTrack:
|
||||
return "PlacePathFromTrack";
|
||||
case GameCommand::RemovePath:
|
||||
return "RemovePath";
|
||||
case GameCommand::ChangeSurfaceStyle:
|
||||
return "ChangeSurfaceStyle";
|
||||
case GameCommand::SetRidePrice:
|
||||
return "SetRidePrice";
|
||||
case GameCommand::SetGuestName:
|
||||
return "SetGuestName";
|
||||
case GameCommand::SetStaffName:
|
||||
return "SetStaffName";
|
||||
case GameCommand::RaiseLand:
|
||||
return "RaiseLand";
|
||||
case GameCommand::LowerLand:
|
||||
return "LowerLand";
|
||||
case GameCommand::EditLandSmooth:
|
||||
return "EditLandSmooth";
|
||||
case GameCommand::RaiseWater:
|
||||
return "RaiseWater";
|
||||
case GameCommand::LowerWater:
|
||||
return "LowerWater";
|
||||
case GameCommand::SetBrakesSpeed:
|
||||
return "SetBrakesSpeed";
|
||||
case GameCommand::HireNewStaffMember:
|
||||
return "HireNewStaffMember";
|
||||
case GameCommand::SetStaffPatrol:
|
||||
return "SetStaffPatrol";
|
||||
case GameCommand::FireStaffMember:
|
||||
return "FireStaffMember";
|
||||
case GameCommand::SetStaffOrders:
|
||||
return "SetStaffOrders";
|
||||
case GameCommand::SetParkName:
|
||||
return "SetParkName";
|
||||
case GameCommand::SetParkOpen:
|
||||
return "SetParkOpen";
|
||||
case GameCommand::BuyLandRights:
|
||||
return "BuyLandRights";
|
||||
case GameCommand::PlaceParkEntrance:
|
||||
return "PlaceParkEntrance";
|
||||
case GameCommand::RemoveParkEntrance:
|
||||
return "RemoveParkEntrance";
|
||||
case GameCommand::SetMazeTrack:
|
||||
return "SetMazeTrack";
|
||||
case GameCommand::SetParkEntranceFee:
|
||||
return "SetParkEntranceFee";
|
||||
case GameCommand::SetStaffColour:
|
||||
return "SetStaffColour";
|
||||
case GameCommand::PlaceWall:
|
||||
return "PlaceWall";
|
||||
case GameCommand::RemoveWall:
|
||||
return "RemoveWall";
|
||||
case GameCommand::PlaceLargeScenery:
|
||||
return "PlaceLargeScenery";
|
||||
case GameCommand::RemoveLargeScenery:
|
||||
return "RemoveLargeScenery";
|
||||
case GameCommand::SetCurrentLoan:
|
||||
return "SetCurrentLoan";
|
||||
case GameCommand::SetResearchFunding:
|
||||
return "SetResearchFunding";
|
||||
case GameCommand::PlaceTrackDesign:
|
||||
return "PlaceTrackDesign";
|
||||
case GameCommand::StartMarketingCampaign:
|
||||
return "StartMarketingCampaign";
|
||||
case GameCommand::PlaceMazeDesign:
|
||||
return "PlaceMazeDesign";
|
||||
case GameCommand::PlaceBanner:
|
||||
return "PlaceBanner";
|
||||
case GameCommand::RemoveBanner:
|
||||
return "RemoveBanner";
|
||||
case GameCommand::SetSceneryColour:
|
||||
return "SetSceneryColour";
|
||||
case GameCommand::SetWallColour:
|
||||
return "SetWallColour";
|
||||
case GameCommand::SetLargeSceneryColour:
|
||||
return "SetLargeSceneryColour";
|
||||
case GameCommand::SetBannerColour:
|
||||
return "SetBannerColour";
|
||||
case GameCommand::SetLandOwnership:
|
||||
return "SetLandOwnership";
|
||||
case GameCommand::ClearScenery:
|
||||
return "ClearScenery";
|
||||
case GameCommand::SetBannerName:
|
||||
return "SetBannerName";
|
||||
case GameCommand::SetSignName:
|
||||
return "SetSignName";
|
||||
case GameCommand::SetBannerStyle:
|
||||
return "SetBannerStyle";
|
||||
case GameCommand::SetSignStyle:
|
||||
return "SetSignStyle";
|
||||
case GameCommand::SetPlayerGroup:
|
||||
return "SetPlayerGroup";
|
||||
case GameCommand::ModifyGroups:
|
||||
return "ModifyGroups";
|
||||
case GameCommand::KickPlayer:
|
||||
return "KickPlayer";
|
||||
case GameCommand::Cheat:
|
||||
return "Cheat";
|
||||
case GameCommand::PickupGuest:
|
||||
return "PickupGuest";
|
||||
case GameCommand::PickupStaff:
|
||||
return "PickupStaff";
|
||||
case GameCommand::BalloonPress:
|
||||
return "BalloonPress";
|
||||
case GameCommand::ModifyTile:
|
||||
return "ModifyTile";
|
||||
case GameCommand::EditScenarioOptions:
|
||||
return "EditScenarioOptions";
|
||||
case GameCommand::PlacePeepSpawn:
|
||||
return "PlacePeepSpawn";
|
||||
case GameCommand::SetClimate:
|
||||
return "SetClimate";
|
||||
case GameCommand::SetColourScheme:
|
||||
return "SetColourScheme";
|
||||
case GameCommand::SetStaffCostume:
|
||||
return "SetStaffCostume";
|
||||
case GameCommand::PlaceFootpathAddition:
|
||||
return "PlaceFootpathAddition";
|
||||
case GameCommand::RemoveFootpathAddition:
|
||||
return "RemoveFootpathAddition";
|
||||
case GameCommand::GuestSetFlags:
|
||||
return "GuestSetFlags";
|
||||
case GameCommand::SetDate:
|
||||
return "SetDate";
|
||||
case GameCommand::Custom:
|
||||
return "Custom";
|
||||
case GameCommand::ChangeMapSize:
|
||||
return "ChangeMapSize";
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return "<error>";
|
||||
}
|
||||
|
||||
std::unique_ptr<GameAction> Create(GameCommand id)
|
||||
{
|
||||
Initialize();
|
||||
|
||||
const auto idx = static_cast<size_t>(id);
|
||||
|
||||
GameAction* result = nullptr;
|
||||
if (idx < std::size(_actions))
|
||||
{
|
||||
GameActionFactory factory = _actions[idx];
|
||||
if (factory != nullptr)
|
||||
{
|
||||
result = factory();
|
||||
}
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
Guard::ArgumentNotNull(result, "Attempting to create unregistered gameaction: %u", id);
|
||||
#endif
|
||||
return std::unique_ptr<GameAction>(result);
|
||||
}
|
||||
|
||||
bool IsValidId(uint32_t id)
|
||||
{
|
||||
if (id < std::size(_actions))
|
||||
{
|
||||
return _actions[id] != nullptr;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace GameActions
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(GuestSetFlagsAction, GameCommand::GuestSetFlags, GameActions::Result)
|
||||
class GuestSetFlagsAction final : public GameActionBase<GameCommand::GuestSetFlags>
|
||||
{
|
||||
private:
|
||||
uint16_t _peepId{ SPRITE_INDEX_NULL };
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(GuestSetNameAction, GameCommand::SetGuestName, GameActions::Result)
|
||||
class GuestSetNameAction final : public GameActionBase<GameCommand::SetGuestName>
|
||||
{
|
||||
private:
|
||||
uint16_t _spriteIndex{ SPRITE_INDEX_NULL };
|
||||
|
||||
@@ -18,7 +18,7 @@ enum class LandBuyRightSetting : uint8_t
|
||||
Count
|
||||
};
|
||||
|
||||
DEFINE_GAME_ACTION(LandBuyRightsAction, GameCommand::BuyLandRights, GameActions::Result)
|
||||
class LandBuyRightsAction final : public GameActionBase<GameCommand::BuyLandRights>
|
||||
{
|
||||
private:
|
||||
MapRange _range;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(LandLowerAction, GameCommand::LowerLand, GameActions::Result)
|
||||
class LandLowerAction final : public GameActionBase<GameCommand::LowerLand>
|
||||
{
|
||||
private:
|
||||
CoordsXY _coords;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(LandRaiseAction, GameCommand::RaiseLand, GameActions::Result)
|
||||
class LandRaiseAction final : public GameActionBase<GameCommand::RaiseLand>
|
||||
{
|
||||
private:
|
||||
CoordsXY _coords;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(LandSetHeightAction, GameCommand::SetLandHeight, GameActions::Result)
|
||||
class LandSetHeightAction final : public GameActionBase<GameCommand::SetLandHeight>
|
||||
{
|
||||
private:
|
||||
CoordsXY _coords;
|
||||
|
||||
@@ -21,7 +21,7 @@ enum class LandSetRightSetting : uint8_t
|
||||
Count
|
||||
};
|
||||
|
||||
DEFINE_GAME_ACTION(LandSetRightsAction, GameCommand::SetLandOwnership, GameActions::Result)
|
||||
class LandSetRightsAction final : public GameActionBase<GameCommand::SetLandOwnership>
|
||||
{
|
||||
private:
|
||||
MapRange _range;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(LandSmoothAction, GameCommand::EditLandSmooth, GameActions::Result)
|
||||
class LandSmoothAction final : public GameActionBase<GameCommand::EditLandSmooth>
|
||||
{
|
||||
private:
|
||||
CoordsXY _coords;
|
||||
|
||||
@@ -20,7 +20,7 @@ struct LargeSceneryPlaceActionResult
|
||||
BannerIndex bannerId = BANNER_INDEX_NULL;
|
||||
};
|
||||
|
||||
DEFINE_GAME_ACTION(LargeSceneryPlaceAction, GameCommand::PlaceLargeScenery, GameActions::Result)
|
||||
class LargeSceneryPlaceAction final : public GameActionBase<GameCommand::PlaceLargeScenery>
|
||||
{
|
||||
private:
|
||||
CoordsXYZD _loc;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(LargeSceneryRemoveAction, GameCommand::RemoveLargeScenery, GameActions::Result)
|
||||
class LargeSceneryRemoveAction final : public GameActionBase<GameCommand::RemoveLargeScenery>
|
||||
{
|
||||
private:
|
||||
CoordsXYZD _loc;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(LargeScenerySetColourAction, GameCommand::SetLargeSceneryColour, GameActions::Result)
|
||||
class LargeScenerySetColourAction final : public GameActionBase<GameCommand::SetLargeSceneryColour>
|
||||
{
|
||||
private:
|
||||
CoordsXYZD _loc;
|
||||
|
||||
@@ -17,7 +17,7 @@ enum class LoadOrQuitModes : uint8_t
|
||||
CloseSavePrompt
|
||||
};
|
||||
|
||||
DEFINE_GAME_ACTION(LoadOrQuitAction, GameCommand::LoadOrQuit, GameActions::Result)
|
||||
class LoadOrQuitAction final : public GameActionBase<GameCommand::LoadOrQuit>
|
||||
{
|
||||
private:
|
||||
LoadOrQuitModes _mode{};
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(MazePlaceTrackAction, GameCommand::PlaceMazeDesign, GameActions::Result)
|
||||
class MazePlaceTrackAction final : public GameActionBase<GameCommand::PlaceMazeDesign>
|
||||
{
|
||||
private:
|
||||
CoordsXYZ _loc;
|
||||
|
||||
@@ -37,7 +37,7 @@ static constexpr const uint8_t byte_993D0C[] = {
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
DEFINE_GAME_ACTION(MazeSetTrackAction, GameCommand::SetMazeTrack, GameActions::Result)
|
||||
class MazeSetTrackAction final : public GameActionBase<GameCommand::SetMazeTrack>
|
||||
{
|
||||
private:
|
||||
CoordsXYZD _loc;
|
||||
|
||||
@@ -29,7 +29,7 @@ enum class PermissionState : uint8_t
|
||||
Count
|
||||
};
|
||||
|
||||
DEFINE_GAME_ACTION(NetworkModifyGroupAction, GameCommand::ModifyGroups, GameActions::Result)
|
||||
class NetworkModifyGroupAction final : public GameActionBase<GameCommand::ModifyGroups>
|
||||
{
|
||||
private:
|
||||
ModifyGroupType _type{ ModifyGroupType::Count };
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(ParkEntranceRemoveAction, GameCommand::RemoveParkEntrance, GameActions::Result)
|
||||
class ParkEntranceRemoveAction final : public GameActionBase<GameCommand::RemoveParkEntrance>
|
||||
{
|
||||
private:
|
||||
CoordsXYZ _loc;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(ParkMarketingAction, GameCommand::StartMarketingCampaign, GameActions::Result)
|
||||
class ParkMarketingAction final : public GameActionBase<GameCommand::StartMarketingCampaign>
|
||||
{
|
||||
private:
|
||||
int32_t _type{};
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(ParkSetDateAction, GameCommand::SetDate, GameActions::Result)
|
||||
class ParkSetDateAction final : public GameActionBase<GameCommand::SetDate>
|
||||
{
|
||||
private:
|
||||
int32_t _year{};
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(ParkSetLoanAction, GameCommand::SetCurrentLoan, GameActions::Result)
|
||||
class ParkSetLoanAction final : public GameActionBase<GameCommand::SetCurrentLoan>
|
||||
{
|
||||
private:
|
||||
money32 _value{ MONEY32_UNDEFINED };
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(ParkSetNameAction, GameCommand::SetParkName, GameActions::Result)
|
||||
class ParkSetNameAction final : public GameActionBase<GameCommand::SetParkName>
|
||||
{
|
||||
private:
|
||||
std::string _name;
|
||||
|
||||
@@ -19,7 +19,7 @@ enum class ParkParameter : uint8_t
|
||||
Count
|
||||
};
|
||||
|
||||
DEFINE_GAME_ACTION(ParkSetParameterAction, GameCommand::SetParkOpen, GameActions::Result)
|
||||
class ParkSetParameterAction final : public GameActionBase<GameCommand::SetParkOpen>
|
||||
{
|
||||
private:
|
||||
ParkParameter _parameter{ ParkParameter::Count };
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(ParkSetResearchFundingAction, GameCommand::SetResearchFunding, GameActions::Result)
|
||||
class ParkSetResearchFundingAction final : public GameActionBase<GameCommand::SetResearchFunding>
|
||||
{
|
||||
private:
|
||||
// TODO change to std::optional when C++17
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
// Clang format is broken for small game actions
|
||||
// clang-format off
|
||||
DEFINE_GAME_ACTION(PauseToggleAction, GameCommand::TogglePause, GameActions::Result)
|
||||
class PauseToggleAction final : public GameActionBase<GameCommand::TogglePause>
|
||||
{
|
||||
public:
|
||||
PauseToggleAction() = default;
|
||||
|
||||
@@ -19,7 +19,7 @@ enum class PeepPickupType : uint8_t
|
||||
Count
|
||||
};
|
||||
|
||||
DEFINE_GAME_ACTION(PeepPickupAction, GameCommand::PickupGuest, GameActions::Result)
|
||||
class PeepPickupAction final : public GameActionBase<GameCommand::PickupGuest>
|
||||
{
|
||||
private:
|
||||
PeepPickupType _type{ PeepPickupType::Count };
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(PlaceParkEntranceAction, GameCommand::PlaceParkEntrance, GameActions::Result)
|
||||
class PlaceParkEntranceAction final : public GameActionBase<GameCommand::PlaceParkEntrance>
|
||||
{
|
||||
private:
|
||||
CoordsXYZD _loc;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(PlacePeepSpawnAction, GameCommand::PlacePeepSpawn, GameActions::Result)
|
||||
class PlacePeepSpawnAction final : public GameActionBase<GameCommand::PlacePeepSpawn>
|
||||
{
|
||||
private:
|
||||
CoordsXYZD _location;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(PlayerKickAction, GameCommand::KickPlayer, GameActions::Result)
|
||||
class PlayerKickAction final : public GameActionBase<GameCommand::KickPlayer>
|
||||
{
|
||||
private:
|
||||
NetworkPlayerId_t _playerId{ -1 };
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(PlayerSetGroupAction, GameCommand::SetPlayerGroup, GameActions::Result)
|
||||
class PlayerSetGroupAction final : public GameActionBase<GameCommand::SetPlayerGroup>
|
||||
{
|
||||
private:
|
||||
NetworkPlayerId_t _playerId{ -1 };
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(RideCreateAction, GameCommand::CreateRide, GameActions::Result)
|
||||
class RideCreateAction final : public GameActionBase<GameCommand::CreateRide>
|
||||
{
|
||||
private:
|
||||
ObjectEntryIndex _rideType{ OBJECT_ENTRY_INDEX_NULL };
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(RideDemolishAction, GameCommand::DemolishRide, GameActions::Result)
|
||||
class RideDemolishAction final : public GameActionBase<GameCommand::DemolishRide>
|
||||
{
|
||||
private:
|
||||
NetworkRideId_t _rideIndex{ RIDE_ID_NULL };
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "../world/Entrance.h"
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(RideEntranceExitPlaceAction, GameCommand::PlaceRideEntranceOrExit, GameActions::Result)
|
||||
class RideEntranceExitPlaceAction final : public GameActionBase<GameCommand::PlaceRideEntranceOrExit>
|
||||
{
|
||||
private:
|
||||
CoordsXY _loc;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(RideEntranceExitRemoveAction, GameCommand::RemoveRideEntranceOrExit, GameActions::Result)
|
||||
class RideEntranceExitRemoveAction final : public GameActionBase<GameCommand::RemoveRideEntranceOrExit>
|
||||
{
|
||||
private:
|
||||
CoordsXY _loc;
|
||||
|
||||
@@ -24,7 +24,7 @@ enum class RideSetAppearanceType : uint8_t
|
||||
EntranceStyle
|
||||
};
|
||||
|
||||
DEFINE_GAME_ACTION(RideSetAppearanceAction, GameCommand::SetRideAppearance, GameActions::Result)
|
||||
class RideSetAppearanceAction final : public GameActionBase<GameCommand::SetRideAppearance>
|
||||
{
|
||||
private:
|
||||
NetworkRideId_t _rideIndex{ RIDE_ID_NULL };
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(RideSetColourSchemeAction, GameCommand::SetColourScheme, GameActions::Result)
|
||||
class RideSetColourSchemeAction final : public GameActionBase<GameCommand::SetColourScheme>
|
||||
{
|
||||
private:
|
||||
CoordsXYZD _loc;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(RideSetNameAction, GameCommand::SetRideName, GameActions::Result)
|
||||
class RideSetNameAction final : public GameActionBase<GameCommand::SetRideName>
|
||||
{
|
||||
private:
|
||||
NetworkRideId_t _rideIndex{ RIDE_ID_NULL };
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(RideSetPriceAction, GameCommand::SetRidePrice, GameActions::Result)
|
||||
class RideSetPriceAction final : public GameActionBase<GameCommand::SetRidePrice>
|
||||
{
|
||||
private:
|
||||
NetworkRideId_t _rideIndex{ RIDE_ID_NULL };
|
||||
|
||||
@@ -26,7 +26,7 @@ enum class RideSetSetting : uint8_t
|
||||
RideType,
|
||||
};
|
||||
|
||||
DEFINE_GAME_ACTION(RideSetSettingAction, GameCommand::SetRideSetting, GameActions::Result)
|
||||
class RideSetSettingAction final : public GameActionBase<GameCommand::SetRideSetting>
|
||||
{
|
||||
private:
|
||||
NetworkRideId_t _rideIndex{ RIDE_ID_NULL };
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(RideSetStatusAction, GameCommand::SetRideStatus, GameActions::Result)
|
||||
class RideSetStatusAction final : public GameActionBase<GameCommand::SetRideStatus>
|
||||
{
|
||||
private:
|
||||
NetworkRideId_t _rideIndex{ RIDE_ID_NULL };
|
||||
|
||||
@@ -19,7 +19,7 @@ enum class RideSetVehicleType : uint8_t
|
||||
Count,
|
||||
};
|
||||
|
||||
DEFINE_GAME_ACTION(RideSetVehicleAction, GameCommand::SetRideVehicles, GameActions::Result)
|
||||
class RideSetVehicleAction final : public GameActionBase<GameCommand::SetRideVehicles>
|
||||
{
|
||||
private:
|
||||
NetworkRideId_t _rideIndex{ RIDE_ID_NULL };
|
||||
|
||||
@@ -38,7 +38,7 @@ enum class ScenarioSetSetting : uint8_t
|
||||
Count
|
||||
};
|
||||
|
||||
DEFINE_GAME_ACTION(ScenarioSetSettingAction, GameCommand::EditScenarioOptions, GameActions::Result)
|
||||
class ScenarioSetSettingAction final : public GameActionBase<GameCommand::EditScenarioOptions>
|
||||
{
|
||||
private:
|
||||
ScenarioSetSetting _setting{ ScenarioSetSetting::Count };
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(SetCheatAction, GameCommand::Cheat, GameActions::Result)
|
||||
class SetCheatAction final : public GameActionBase<GameCommand::Cheat>
|
||||
{
|
||||
using ParametersRange = std::pair<std::pair<int32_t, int32_t>, std::pair<int32_t, int32_t>>;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(SetParkEntranceFeeAction, GameCommand::SetParkEntranceFee, GameActions::Result)
|
||||
class SetParkEntranceFeeAction final : public GameActionBase<GameCommand::SetParkEntranceFee>
|
||||
{
|
||||
private:
|
||||
money16 _fee{ MONEY16_UNDEFINED };
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(SignSetNameAction, GameCommand::SetSignName, GameActions::Result)
|
||||
class SignSetNameAction final : public GameActionBase<GameCommand::SetSignName>
|
||||
{
|
||||
private:
|
||||
BannerIndex _bannerIndex{ BANNER_INDEX_NULL };
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(SignSetStyleAction, GameCommand::SetSignStyle, GameActions::Result)
|
||||
class SignSetStyleAction final : public GameActionBase<GameCommand::SetSignStyle>
|
||||
{
|
||||
private:
|
||||
BannerIndex _bannerIndex{ BANNER_INDEX_NULL };
|
||||
|
||||
@@ -19,7 +19,7 @@ struct SmallSceneryPlaceActionResult
|
||||
uint8_t SceneryQuadrant{};
|
||||
};
|
||||
|
||||
DEFINE_GAME_ACTION(SmallSceneryPlaceAction, GameCommand::PlaceScenery, GameActions::Result)
|
||||
class SmallSceneryPlaceAction final : public GameActionBase<GameCommand::PlaceScenery>
|
||||
{
|
||||
private:
|
||||
CoordsXYZD _loc;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "../world/TileElement.h"
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(SmallSceneryRemoveAction, GameCommand::RemoveScenery, GameActions::Result)
|
||||
class SmallSceneryRemoveAction final : public GameActionBase<GameCommand::RemoveScenery>
|
||||
{
|
||||
private:
|
||||
CoordsXYZ _loc;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(SmallScenerySetColourAction, GameCommand::SetSceneryColour, GameActions::Result)
|
||||
class SmallScenerySetColourAction final : public GameActionBase<GameCommand::SetSceneryColour>
|
||||
{
|
||||
private:
|
||||
CoordsXYZ _loc;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(StaffFireAction, GameCommand::FireStaffMember, GameActions::Result)
|
||||
class StaffFireAction final : public GameActionBase<GameCommand::FireStaffMember>
|
||||
{
|
||||
private:
|
||||
uint16_t _spriteId{ SPRITE_INDEX_NULL };
|
||||
|
||||
@@ -17,7 +17,7 @@ struct StaffHireNewActionResult
|
||||
uint16_t StaffEntityId = SPRITE_INDEX_NULL;
|
||||
};
|
||||
|
||||
DEFINE_GAME_ACTION(StaffHireNewAction, GameCommand::HireNewStaffMember, GameActions::Result)
|
||||
class StaffHireNewAction final : public GameActionBase<GameCommand::HireNewStaffMember>
|
||||
{
|
||||
private:
|
||||
bool _autoPosition{};
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(StaffSetColourAction, GameCommand::SetStaffColour, GameActions::Result)
|
||||
class StaffSetColourAction final : public GameActionBase<GameCommand::SetStaffColour>
|
||||
{
|
||||
private:
|
||||
uint8_t _staffType{};
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "../peep/Staff.h"
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(StaffSetCostumeAction, GameCommand::SetStaffCostume, GameActions::Result)
|
||||
class StaffSetCostumeAction final : public GameActionBase<GameCommand::SetStaffCostume>
|
||||
{
|
||||
private:
|
||||
uint16_t _spriteIndex{ SPRITE_INDEX_NULL };
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(StaffSetNameAction, GameCommand::SetStaffName, GameActions::Result)
|
||||
class StaffSetNameAction final : public GameActionBase<GameCommand::SetStaffName>
|
||||
{
|
||||
private:
|
||||
uint16_t _spriteIndex{ SPRITE_INDEX_NULL };
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(StaffSetOrdersAction, GameCommand::SetStaffOrders, GameActions::Result)
|
||||
class StaffSetOrdersAction final : public GameActionBase<GameCommand::SetStaffOrders>
|
||||
{
|
||||
private:
|
||||
uint16_t _spriteIndex{ SPRITE_INDEX_NULL };
|
||||
|
||||
@@ -18,7 +18,7 @@ enum class StaffSetPatrolAreaMode : uint8_t
|
||||
ClearAll
|
||||
};
|
||||
|
||||
DEFINE_GAME_ACTION(StaffSetPatrolAreaAction, GameCommand::SetStaffPatrol, GameActions::Result)
|
||||
class StaffSetPatrolAreaAction final : public GameActionBase<GameCommand::SetStaffPatrol>
|
||||
{
|
||||
private:
|
||||
uint16_t _spriteId{ SPRITE_INDEX_NULL };
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(SurfaceSetStyleAction, GameCommand::ChangeSurfaceStyle, GameActions::Result)
|
||||
class SurfaceSetStyleAction final : public GameActionBase<GameCommand::ChangeSurfaceStyle>
|
||||
{
|
||||
private:
|
||||
MapRange _range;
|
||||
|
||||
@@ -41,7 +41,7 @@ enum class TileModifyType : uint8_t
|
||||
Count,
|
||||
};
|
||||
|
||||
DEFINE_GAME_ACTION(TileModifyAction, GameCommand::ModifyTile, GameActions::Result)
|
||||
class TileModifyAction final : public GameActionBase<GameCommand::ModifyTile>
|
||||
{
|
||||
private:
|
||||
CoordsXY _loc;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "../ride/TrackDesign.h"
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(TrackDesignAction, GameCommand::PlaceTrackDesign, GameActions::Result)
|
||||
class TrackDesignAction final : public GameActionBase<GameCommand::PlaceTrackDesign>
|
||||
{
|
||||
private:
|
||||
CoordsXYZD _loc;
|
||||
|
||||
@@ -16,7 +16,7 @@ struct TrackPlaceActionResult
|
||||
uint8_t GroundFlags{ 0 };
|
||||
};
|
||||
|
||||
DEFINE_GAME_ACTION(TrackPlaceAction, GameCommand::PlaceTrack, GameActions::Result)
|
||||
class TrackPlaceAction final : public GameActionBase<GameCommand::PlaceTrack>
|
||||
{
|
||||
private:
|
||||
NetworkRideId_t _rideIndex{ RIDE_ID_NULL };
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(TrackRemoveAction, GameCommand::RemoveTrack, GameActions::Result)
|
||||
class TrackRemoveAction final : public GameActionBase<GameCommand::RemoveTrack>
|
||||
{
|
||||
private:
|
||||
track_type_t _trackType{};
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(TrackSetBrakeSpeedAction, GameCommand::SetBrakesSpeed, GameActions::Result)
|
||||
class TrackSetBrakeSpeedAction final : public GameActionBase<GameCommand::SetBrakesSpeed>
|
||||
{
|
||||
private:
|
||||
CoordsXYZ _loc;
|
||||
|
||||
@@ -21,7 +21,7 @@ struct WallPlaceActionResult
|
||||
BannerIndex BannerId = BANNER_INDEX_NULL;
|
||||
};
|
||||
|
||||
DEFINE_GAME_ACTION(WallPlaceAction, GameCommand::PlaceWall, GameActions::Result)
|
||||
class WallPlaceAction final : public GameActionBase<GameCommand::PlaceWall>
|
||||
{
|
||||
private:
|
||||
ObjectEntryIndex _wallType{ OBJECT_ENTRY_INDEX_NULL };
|
||||
@@ -50,8 +50,8 @@ private:
|
||||
*
|
||||
* rct2: 0x006E5CBA
|
||||
*/
|
||||
bool WallCheckObstructionWithTrack(WallSceneryEntry * wall, int32_t z0, TrackElement * trackElement, bool* wallAcrossTrack)
|
||||
const;
|
||||
bool WallCheckObstructionWithTrack(
|
||||
WallSceneryEntry* wall, int32_t z0, TrackElement* trackElement, bool* wallAcrossTrack) const;
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006E5C1A
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(WallRemoveAction, GameCommand::RemoveWall, GameActions::Result)
|
||||
class WallRemoveAction final : public GameActionBase<GameCommand::RemoveWall>
|
||||
{
|
||||
private:
|
||||
CoordsXYZD _loc;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(WallSetColourAction, GameCommand::SetWallColour, GameActions::Result)
|
||||
class WallSetColourAction final : public GameActionBase<GameCommand::SetWallColour>
|
||||
{
|
||||
private:
|
||||
CoordsXYZD _loc;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(WaterLowerAction, GameCommand::LowerWater, GameActions::Result)
|
||||
class WaterLowerAction final : public GameActionBase<GameCommand::LowerWater>
|
||||
{
|
||||
private:
|
||||
MapRange _range;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(WaterRaiseAction, GameCommand::RaiseWater, GameActions::Result)
|
||||
class WaterRaiseAction final : public GameActionBase<GameCommand::RaiseWater>
|
||||
{
|
||||
private:
|
||||
MapRange _range;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "GameAction.h"
|
||||
|
||||
DEFINE_GAME_ACTION(WaterSetHeightAction, GameCommand::SetWaterHeight, GameActions::Result)
|
||||
class WaterSetHeightAction final : public GameActionBase<GameCommand::SetWaterHeight>
|
||||
{
|
||||
private:
|
||||
CoordsXY _coords;
|
||||
|
||||
@@ -521,7 +521,7 @@
|
||||
<ClCompile Include="actions\FootpathRemoveAction.cpp" />
|
||||
<ClCompile Include="actions\GameAction.cpp" />
|
||||
<ClCompile Include="actions\GameActionCompat.cpp" />
|
||||
<ClCompile Include="actions\GameActionRegistration.cpp" />
|
||||
<ClCompile Include="actions\GameActionRegistry.cpp" />
|
||||
<ClCompile Include="actions\GameActionResult.cpp" />
|
||||
<ClCompile Include="actions\GuestSetFlagsAction.cpp" />
|
||||
<ClCompile Include="actions\GuestSetNameAction.cpp" />
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
struct GameAction;
|
||||
class GameAction;
|
||||
struct Peep;
|
||||
struct CoordsXYZ;
|
||||
namespace GameActions
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
struct duk_hthread;
|
||||
typedef struct duk_hthread duk_context;
|
||||
|
||||
struct GameAction;
|
||||
class GameAction;
|
||||
namespace GameActions
|
||||
{
|
||||
class Result;
|
||||
|
||||
Reference in New Issue
Block a user