mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-10 09:32:29 +01:00
Merge pull request #15886 from ZehMatt/refactor/gameaction-setcallback2
Refactor out DEFINE_GAME_ACTION
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 };
|
||||
|
||||
@@ -19,11 +19,11 @@ public:
|
||||
BalloonPressAction() = default;
|
||||
BalloonPressAction(uint16_t spriteIndex);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
@@ -27,11 +27,11 @@ public:
|
||||
BannerPlaceAction() = default;
|
||||
BannerPlaceAction(const CoordsXYZD& loc, ObjectEntryIndex bannerType, colour_t primaryColour);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -20,11 +20,11 @@ public:
|
||||
BannerRemoveAction() = default;
|
||||
BannerRemoveAction(const CoordsXYZD& loc);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -21,11 +21,11 @@ public:
|
||||
BannerSetColourAction() = default;
|
||||
BannerSetColourAction(const CoordsXYZD& loc, uint8_t primaryColour);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
|
||||
@@ -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,11 +21,11 @@ public:
|
||||
BannerSetNameAction() = default;
|
||||
BannerSetNameAction(BannerIndex bannerIndex, const std::string& name);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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 };
|
||||
@@ -32,11 +32,11 @@ public:
|
||||
BannerSetStyleAction() = default;
|
||||
BannerSetStyleAction(BannerSetStyleType type, uint8_t bannerIndex, uint8_t parameter);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -12,16 +12,16 @@
|
||||
#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;
|
||||
ChangeMapSizeAction(const int32_t targetSize);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
ClearAction() = default;
|
||||
ClearAction(MapRange range, ClearableItems itemsToClear);
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
|
||||
@@ -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{};
|
||||
@@ -21,11 +21,11 @@ public:
|
||||
ClimateSetAction() = default;
|
||||
ClimateSetAction(ClimateType climate);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
@@ -28,7 +28,7 @@ public:
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
@@ -21,11 +21,11 @@ public:
|
||||
FootpathAdditionPlaceAction() = default;
|
||||
FootpathAdditionPlaceAction(const CoordsXYZ& loc, ObjectEntryIndex pathItemType);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
@@ -20,11 +20,11 @@ public:
|
||||
FootpathAdditionRemoveAction() = default;
|
||||
FootpathAdditionRemoveAction(const CoordsXYZ& loc);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
@@ -27,21 +27,21 @@ public:
|
||||
FootpathPlaceAction(
|
||||
const CoordsXYZ& loc, uint8_t slope, ObjectEntryIndex type, ObjectEntryIndex railingsType,
|
||||
Direction direction = INVALID_DIRECTION, PathConstructFlags constructFlags = 0);
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
private:
|
||||
GameActions::Result::Ptr ElementUpdateQuery(PathElement * pathElement, GameActions::Result::Ptr res) const;
|
||||
GameActions::Result::Ptr ElementUpdateExecute(PathElement * pathElement, GameActions::Result::Ptr res) const;
|
||||
GameActions::Result::Ptr ElementUpdateQuery(PathElement* pathElement, GameActions::Result::Ptr res) const;
|
||||
GameActions::Result::Ptr ElementUpdateExecute(PathElement* pathElement, GameActions::Result::Ptr res) const;
|
||||
GameActions::Result::Ptr ElementInsertQuery(GameActions::Result::Ptr res) const;
|
||||
GameActions::Result::Ptr ElementInsertExecute(GameActions::Result::Ptr res) const;
|
||||
void AutomaticallySetPeepSpawn() const;
|
||||
void RemoveIntersectingWalls(PathElement * pathElement) const;
|
||||
void RemoveIntersectingWalls(PathElement* pathElement) const;
|
||||
PathElement* map_get_footpath_element_slope(const CoordsXYZ& footpathPos, int32_t slope) const;
|
||||
bool IsSameAsPathElement(const PathElement* pathElement) const;
|
||||
bool IsSameAsEntranceElement(const EntranceElement& entranceElement) const;
|
||||
|
||||
@@ -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;
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -21,16 +21,16 @@ public:
|
||||
FootpathRemoveAction() = default;
|
||||
FootpathRemoveAction(const CoordsXYZ& location);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
private:
|
||||
TileElement* GetFootpathElement() const;
|
||||
money32 GetRefundPrice(TileElement * footpathElement) const;
|
||||
money32 GetRefundPrice(TileElement* footpathElement) const;
|
||||
GameActions::Result::Ptr RemoveBannersAtElement(const CoordsXY& loc, TileElement* tileElement) const;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
@@ -179,38 +158,6 @@ namespace GameActions
|
||||
_actionQueue.clear();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
static bool initialized = false;
|
||||
if (initialized)
|
||||
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 +463,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)...);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -263,9 +256,8 @@ namespace GameActions
|
||||
{
|
||||
using GameActionFactory = GameAction* (*)();
|
||||
|
||||
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
|
||||
@@ -291,25 +283,4 @@ namespace GameActions
|
||||
GameActions::Result::Ptr QueryNested(const GameAction* action);
|
||||
GameActions::Result::Ptr ExecuteNested(const GameAction* action);
|
||||
|
||||
GameActionFactory Register(GameCommand id, GameActionFactory action);
|
||||
|
||||
template<typename T> static GameActionFactory Register()
|
||||
{
|
||||
GameActionFactory factory = []() -> GameAction* { return new T(); };
|
||||
Register(T::TYPE, factory);
|
||||
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
|
||||
252
src/openrct2/actions/GameActionRegistry.cpp
Normal file
252
src/openrct2/actions/GameActionRegistry.cpp
Normal file
@@ -0,0 +1,252 @@
|
||||
/*****************************************************************************
|
||||
* Copyright (c) 2014-2021 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"
|
||||
|
||||
#include <array>
|
||||
|
||||
namespace GameActions
|
||||
{
|
||||
struct GameActionEntry
|
||||
{
|
||||
GameActionFactory factory{};
|
||||
const char* name{};
|
||||
};
|
||||
|
||||
using GameActionRegistry = std::array<GameActionEntry, EnumValue(GameCommand::Count)>;
|
||||
|
||||
template<GameCommand TId>
|
||||
static constexpr void Register(GameActionRegistry& registry, GameActionFactory factory, const char* name)
|
||||
{
|
||||
constexpr auto idx = static_cast<size_t>(TId);
|
||||
|
||||
static_assert(idx < EnumValue(GameCommand::Count));
|
||||
|
||||
registry[idx] = { factory, name };
|
||||
}
|
||||
|
||||
template<typename T> static constexpr void Register(GameActionRegistry& registry, const char* name)
|
||||
{
|
||||
GameActionFactory factory = []() -> GameAction* { return new T(); };
|
||||
Register<T::TYPE>(registry, factory, name);
|
||||
}
|
||||
|
||||
static constexpr GameActionRegistry BuildRegistry()
|
||||
{
|
||||
GameActionRegistry registry{};
|
||||
|
||||
#define REGISTER_ACTION(type) Register<type>(registry, #type)
|
||||
|
||||
REGISTER_ACTION(BalloonPressAction);
|
||||
REGISTER_ACTION(BannerPlaceAction);
|
||||
REGISTER_ACTION(BannerRemoveAction);
|
||||
REGISTER_ACTION(BannerSetColourAction);
|
||||
REGISTER_ACTION(BannerSetNameAction);
|
||||
REGISTER_ACTION(BannerSetStyleAction);
|
||||
REGISTER_ACTION(ClimateSetAction);
|
||||
REGISTER_ACTION(FootpathPlaceAction);
|
||||
REGISTER_ACTION(FootpathPlaceFromTrackAction);
|
||||
REGISTER_ACTION(FootpathRemoveAction);
|
||||
REGISTER_ACTION(FootpathAdditionPlaceAction);
|
||||
REGISTER_ACTION(FootpathAdditionRemoveAction);
|
||||
REGISTER_ACTION(GuestSetNameAction);
|
||||
REGISTER_ACTION(MazePlaceTrackAction);
|
||||
REGISTER_ACTION(MazeSetTrackAction);
|
||||
REGISTER_ACTION(NetworkModifyGroupAction);
|
||||
REGISTER_ACTION(ParkMarketingAction);
|
||||
REGISTER_ACTION(ParkEntranceRemoveAction);
|
||||
REGISTER_ACTION(ParkSetLoanAction);
|
||||
REGISTER_ACTION(ParkSetNameAction);
|
||||
REGISTER_ACTION(ParkSetParameterAction);
|
||||
REGISTER_ACTION(ParkSetResearchFundingAction);
|
||||
REGISTER_ACTION(PeepPickupAction);
|
||||
REGISTER_ACTION(PlaceParkEntranceAction);
|
||||
REGISTER_ACTION(PlacePeepSpawnAction);
|
||||
REGISTER_ACTION(PlayerKickAction);
|
||||
REGISTER_ACTION(PlayerSetGroupAction);
|
||||
REGISTER_ACTION(RideCreateAction);
|
||||
REGISTER_ACTION(RideDemolishAction);
|
||||
REGISTER_ACTION(RideEntranceExitPlaceAction);
|
||||
REGISTER_ACTION(RideEntranceExitRemoveAction);
|
||||
REGISTER_ACTION(RideSetColourSchemeAction);
|
||||
REGISTER_ACTION(RideSetNameAction);
|
||||
REGISTER_ACTION(RideSetPriceAction);
|
||||
REGISTER_ACTION(RideSetStatusAction);
|
||||
REGISTER_ACTION(RideSetAppearanceAction);
|
||||
REGISTER_ACTION(RideSetVehicleAction);
|
||||
REGISTER_ACTION(RideSetSettingAction);
|
||||
REGISTER_ACTION(ScenarioSetSettingAction);
|
||||
REGISTER_ACTION(SetParkEntranceFeeAction);
|
||||
REGISTER_ACTION(SignSetNameAction);
|
||||
REGISTER_ACTION(SignSetStyleAction);
|
||||
REGISTER_ACTION(StaffFireAction);
|
||||
REGISTER_ACTION(StaffHireNewAction);
|
||||
REGISTER_ACTION(StaffSetColourAction);
|
||||
REGISTER_ACTION(StaffSetNameAction);
|
||||
REGISTER_ACTION(StaffSetOrdersAction);
|
||||
REGISTER_ACTION(StaffSetCostumeAction);
|
||||
REGISTER_ACTION(StaffSetPatrolAreaAction);
|
||||
REGISTER_ACTION(SurfaceSetStyleAction);
|
||||
REGISTER_ACTION(WallPlaceAction);
|
||||
REGISTER_ACTION(WallRemoveAction);
|
||||
REGISTER_ACTION(WallSetColourAction);
|
||||
REGISTER_ACTION(SmallSceneryPlaceAction);
|
||||
REGISTER_ACTION(SmallSceneryRemoveAction);
|
||||
REGISTER_ACTION(SmallScenerySetColourAction);
|
||||
REGISTER_ACTION(LargeSceneryPlaceAction);
|
||||
REGISTER_ACTION(LargeSceneryRemoveAction);
|
||||
REGISTER_ACTION(LargeScenerySetColourAction);
|
||||
REGISTER_ACTION(LandBuyRightsAction);
|
||||
REGISTER_ACTION(LandLowerAction);
|
||||
REGISTER_ACTION(LandRaiseAction);
|
||||
REGISTER_ACTION(LandSetHeightAction);
|
||||
REGISTER_ACTION(LandSetRightsAction);
|
||||
REGISTER_ACTION(LandSmoothAction);
|
||||
REGISTER_ACTION(TileModifyAction);
|
||||
REGISTER_ACTION(TrackDesignAction);
|
||||
REGISTER_ACTION(TrackPlaceAction);
|
||||
REGISTER_ACTION(TrackRemoveAction);
|
||||
REGISTER_ACTION(TrackSetBrakeSpeedAction);
|
||||
REGISTER_ACTION(ClearAction);
|
||||
REGISTER_ACTION(PauseToggleAction);
|
||||
REGISTER_ACTION(LoadOrQuitAction);
|
||||
REGISTER_ACTION(WaterSetHeightAction);
|
||||
REGISTER_ACTION(WaterLowerAction);
|
||||
REGISTER_ACTION(WaterRaiseAction);
|
||||
REGISTER_ACTION(GuestSetFlagsAction);
|
||||
REGISTER_ACTION(ParkSetDateAction);
|
||||
REGISTER_ACTION(SetCheatAction);
|
||||
REGISTER_ACTION(ChangeMapSizeAction);
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
REGISTER_ACTION(CustomAction);
|
||||
#endif
|
||||
|
||||
#undef REGISTER_ACTION
|
||||
|
||||
return registry;
|
||||
}
|
||||
|
||||
static constexpr GameActionRegistry _registry = BuildRegistry();
|
||||
|
||||
const char* GetName(GameCommand id)
|
||||
{
|
||||
const auto idx = static_cast<size_t>(id);
|
||||
Guard::IndexInRange(idx, _registry);
|
||||
|
||||
return _registry[idx].name;
|
||||
}
|
||||
|
||||
std::unique_ptr<GameAction> Create(GameCommand id)
|
||||
{
|
||||
const auto idx = static_cast<size_t>(id);
|
||||
|
||||
GameAction* result = nullptr;
|
||||
if (idx < std::size(_registry))
|
||||
{
|
||||
GameActionFactory factory = _registry[idx].factory;
|
||||
if (factory != nullptr)
|
||||
{
|
||||
result = factory();
|
||||
}
|
||||
}
|
||||
Guard::ArgumentNotNull(result, "Attempting to create unregistered game action: %u", id);
|
||||
return std::unique_ptr<GameAction>(result);
|
||||
}
|
||||
|
||||
bool IsValidId(uint32_t id)
|
||||
{
|
||||
if (id < std::size(_registry))
|
||||
{
|
||||
return _registry[id].factory != 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 };
|
||||
@@ -21,11 +21,11 @@ public:
|
||||
GuestSetFlagsAction() = default;
|
||||
GuestSetFlagsAction(uint16_t peepId, uint32_t flags);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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 };
|
||||
@@ -24,11 +24,11 @@ public:
|
||||
uint16_t GetSpriteIndex() const;
|
||||
std::string GetGuestName() const;
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
@@ -34,16 +34,16 @@ private:
|
||||
money32 GetSmallSceneryRemovalCost() const;
|
||||
void SmallSceneryRemoval() const;
|
||||
rct_string_id CheckRideSupports() const;
|
||||
TileElement* CheckFloatingStructures(TileElement * surfaceElement, uint8_t zCorner) const;
|
||||
TileElement* CheckUnremovableObstructions(TileElement * surfaceElement, uint8_t zCorner) const;
|
||||
money32 GetSurfaceHeightChangeCost(SurfaceElement * surfaceElement) const;
|
||||
void SetSurfaceHeight(TileElement * surfaceElement) const;
|
||||
TileElement* CheckFloatingStructures(TileElement* surfaceElement, uint8_t zCorner) const;
|
||||
TileElement* CheckUnremovableObstructions(TileElement* surfaceElement, uint8_t zCorner) const;
|
||||
money32 GetSurfaceHeightChangeCost(SurfaceElement* surfaceElement) const;
|
||||
void SetSurfaceHeight(TileElement* surfaceElement) const;
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x00663CB9
|
||||
*/
|
||||
static int32_t map_set_land_height_clear_func(
|
||||
TileElement * *tile_element, [[maybe_unused]] const CoordsXY& coords, [[maybe_unused]] uint8_t flags,
|
||||
TileElement** tile_element, [[maybe_unused]] const CoordsXY& coords, [[maybe_unused]] uint8_t flags,
|
||||
[[maybe_unused]] money32* price);
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
@@ -35,7 +35,7 @@ public:
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -30,7 +30,7 @@ public:
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -34,17 +34,17 @@ public:
|
||||
LargeSceneryPlaceAction(
|
||||
const CoordsXYZD& loc, ObjectEntryIndex sceneryType, uint8_t primaryColour, uint8_t secondaryColour);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
private:
|
||||
int16_t GetTotalNumTiles(rct_large_scenery_tile * tiles) const;
|
||||
bool CheckMapCapacity(rct_large_scenery_tile * tiles, int16_t numTiles) const;
|
||||
int16_t GetMaxSurfaceHeight(rct_large_scenery_tile * tiles) const;
|
||||
void SetNewLargeSceneryElement(LargeSceneryElement & sceneryElement, uint8_t tileNum) const;
|
||||
int16_t GetTotalNumTiles(rct_large_scenery_tile* tiles) const;
|
||||
bool CheckMapCapacity(rct_large_scenery_tile* tiles, int16_t numTiles) const;
|
||||
int16_t GetMaxSurfaceHeight(rct_large_scenery_tile* tiles) const;
|
||||
void SetNewLargeSceneryElement(LargeSceneryElement& sceneryElement, uint8_t tileNum) const;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
@@ -21,11 +21,11 @@ public:
|
||||
LargeSceneryRemoveAction() = default;
|
||||
LargeSceneryRemoveAction(const CoordsXYZD& location, uint16_t tileIndex);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -25,7 +25,7 @@ public:
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
|
||||
@@ -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{};
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
@@ -21,8 +21,8 @@ public:
|
||||
MazePlaceTrackAction() = default;
|
||||
MazePlaceTrackAction(const CoordsXYZ& location, NetworkRideId_t rideIndex, uint16_t mazeEntry);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
@@ -49,8 +49,8 @@ public:
|
||||
MazeSetTrackAction() = default;
|
||||
MazeSetTrackAction(const CoordsXYZD& location, bool initialPlacement, NetworkRideId_t rideIndex, uint8_t mode);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
|
||||
@@ -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 };
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
@@ -22,7 +22,7 @@ public:
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
|
||||
@@ -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{};
|
||||
@@ -22,11 +22,11 @@ public:
|
||||
ParkMarketingAction() = default;
|
||||
ParkMarketingAction(int32_t type, int32_t item, int32_t numWeeks);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
|
||||
@@ -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{};
|
||||
@@ -22,11 +22,11 @@ public:
|
||||
ParkSetDateAction() = default;
|
||||
ParkSetDateAction(int32_t year, int32_t month, int32_t day);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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 };
|
||||
@@ -20,11 +20,11 @@ public:
|
||||
ParkSetLoanAction() = default;
|
||||
ParkSetLoanAction(money32 value);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
@@ -20,11 +20,11 @@ public:
|
||||
ParkSetNameAction() = default;
|
||||
ParkSetNameAction(const std::string& name);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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 };
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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 };
|
||||
@@ -33,10 +33,10 @@ public:
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
private:
|
||||
void CancelConcurrentPickups(Peep * pickedPeep) const;
|
||||
void CancelConcurrentPickups(Peep* pickedPeep) const;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
@@ -23,7 +23,7 @@ public:
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -22,7 +22,7 @@ public:
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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 };
|
||||
@@ -23,7 +23,7 @@ public:
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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 };
|
||||
@@ -23,7 +23,7 @@ public:
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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 };
|
||||
@@ -23,13 +23,13 @@ public:
|
||||
RideCreateAction() = default;
|
||||
RideCreateAction(int32_t rideType, ObjectEntryIndex subType, int32_t colour1, int32_t colour2);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
int32_t GetRideType() const;
|
||||
int32_t GetRideObject() const;
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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 };
|
||||
@@ -21,19 +21,19 @@ public:
|
||||
RideDemolishAction() = default;
|
||||
RideDemolishAction(ride_id_t rideIndex, uint8_t modifyType);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint32_t GetCooldownTime() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
private:
|
||||
GameActions::Result::Ptr DemolishRide(Ride * ride) const;
|
||||
GameActions::Result::Ptr DemolishRide(Ride* ride) const;
|
||||
money32 MazeRemoveTrack(const CoordsXYZD& coords) const;
|
||||
money32 DemolishTracks() const;
|
||||
GameActions::Result::Ptr RefurbishRide(Ride * ride) const;
|
||||
GameActions::Result::Ptr RefurbishRide(Ride* ride) const;
|
||||
money32 GetRefurbishPrice(const Ride* ride) const;
|
||||
money32 GetRefundPrice(const Ride* ride) const;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
@@ -26,11 +26,11 @@ public:
|
||||
RideEntranceExitPlaceAction(
|
||||
const CoordsXY& loc, Direction direction, ride_id_t rideIndex, StationIndex stationNum, bool isExit);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -23,11 +23,11 @@ public:
|
||||
RideEntranceExitRemoveAction() = default;
|
||||
RideEntranceExitRemoveAction(const CoordsXY& loc, ride_id_t rideIndex, StationIndex stationNum, bool isExit);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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 };
|
||||
@@ -36,11 +36,11 @@ public:
|
||||
RideSetAppearanceAction() = default;
|
||||
RideSetAppearanceAction(ride_id_t rideIndex, RideSetAppearanceType type, uint16_t value, uint32_t index);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
@@ -22,11 +22,11 @@ public:
|
||||
RideSetColourSchemeAction() = default;
|
||||
RideSetColourSchemeAction(const CoordsXYZD& location, track_type_t trackType, uint16_t newColourScheme);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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 };
|
||||
@@ -21,11 +21,11 @@ public:
|
||||
RideSetNameAction() = default;
|
||||
RideSetNameAction(ride_id_t rideIndex, const std::string& name);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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 };
|
||||
@@ -22,11 +22,11 @@ public:
|
||||
RideSetPriceAction() = default;
|
||||
RideSetPriceAction(ride_id_t rideIndex, money16 price, bool primaryPrice);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
|
||||
@@ -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 };
|
||||
@@ -37,18 +37,18 @@ public:
|
||||
RideSetSettingAction() = default;
|
||||
RideSetSettingAction(ride_id_t rideIndex, RideSetSetting setting, uint8_t value);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
private:
|
||||
bool ride_is_mode_valid(Ride * ride) const;
|
||||
bool ride_is_valid_lift_hill_speed(Ride * ride) const;
|
||||
bool ride_is_mode_valid(Ride* ride) const;
|
||||
bool ride_is_valid_lift_hill_speed(Ride* ride) const;
|
||||
bool ride_is_valid_num_circuits() const;
|
||||
bool ride_is_valid_operation_option(Ride * ride) const;
|
||||
rct_string_id GetOperationErrorMessage(Ride * ride) const;
|
||||
bool ride_is_valid_operation_option(Ride* ride) const;
|
||||
rct_string_id GetOperationErrorMessage(Ride* ride) const;
|
||||
};
|
||||
|
||||
@@ -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 };
|
||||
@@ -21,11 +21,11 @@ public:
|
||||
RideSetStatusAction() = default;
|
||||
RideSetStatusAction(ride_id_t rideIndex, RideStatus status);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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 };
|
||||
@@ -31,14 +31,14 @@ public:
|
||||
RideSetVehicleAction() = default;
|
||||
RideSetVehicleAction(ride_id_t rideIndex, RideSetVehicleType type, uint8_t value, uint8_t colour = 0);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
private:
|
||||
bool ride_is_vehicle_type_valid(Ride * ride) const;
|
||||
bool ride_is_vehicle_type_valid(Ride* ride) const;
|
||||
};
|
||||
|
||||
@@ -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 };
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
return GameAction::GetActionFlags() | GameActions::Flags::AllowWhilePaused;
|
||||
}
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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>>;
|
||||
|
||||
@@ -24,11 +24,11 @@ public:
|
||||
SetCheatAction() = default;
|
||||
SetCheatAction(CheatType cheatType, int32_t param1 = 0, int32_t param2 = 0);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
|
||||
@@ -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 };
|
||||
@@ -20,11 +20,11 @@ public:
|
||||
SetParkEntranceFeeAction() = default;
|
||||
SetParkEntranceFeeAction(money16 fee);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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 };
|
||||
@@ -21,11 +21,11 @@ public:
|
||||
SignSetNameAction() = default;
|
||||
SignSetNameAction(BannerIndex bannerIndex, const std::string& name);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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 };
|
||||
@@ -25,7 +25,7 @@ public:
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
@@ -33,12 +33,12 @@ public:
|
||||
SmallSceneryPlaceAction(
|
||||
const CoordsXYZD& loc, uint8_t quadrant, ObjectEntryIndex sceneryType, uint8_t primaryColour, uint8_t secondaryColour);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint32_t GetCooldownTime() const override;
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
@@ -23,11 +23,11 @@ public:
|
||||
SmallSceneryRemoveAction() = default;
|
||||
SmallSceneryRemoveAction(const CoordsXYZ& location, uint8_t quadrant, ObjectEntryIndex sceneryType);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -27,7 +27,7 @@ public:
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
|
||||
@@ -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 };
|
||||
@@ -22,7 +22,7 @@ public:
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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{};
|
||||
@@ -29,15 +29,15 @@ public:
|
||||
StaffHireNewAction() = default;
|
||||
StaffHireNewAction(bool autoPosition, StaffType staffType, EntertainerCostume entertainerType, uint32_t staffOrders);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
private:
|
||||
GameActions::Result::Ptr QueryExecute(bool execute) const;
|
||||
void AutoPositionNewStaff(Peep * newPeep) const;
|
||||
void AutoPositionNewStaff(Peep* newPeep) const;
|
||||
};
|
||||
|
||||
@@ -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{};
|
||||
@@ -23,7 +23,7 @@ public:
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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 };
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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 };
|
||||
@@ -22,7 +22,7 @@ public:
|
||||
StaffSetNameAction(uint16_t spriteIndex, const std::string& name);
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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 };
|
||||
@@ -23,7 +23,7 @@ public:
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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 };
|
||||
@@ -31,7 +31,7 @@ public:
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
@@ -22,7 +22,7 @@ public:
|
||||
SurfaceSetStyleAction() = default;
|
||||
SurfaceSetStyleAction(MapRange range, ObjectEntryIndex surfaceStyle, ObjectEntryIndex edgeStyle);
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -22,11 +22,11 @@ public:
|
||||
TrackDesignAction() = default;
|
||||
TrackDesignAction(const CoordsXYZD& location, const TrackDesign& td);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
@@ -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 };
|
||||
@@ -34,11 +34,11 @@ public:
|
||||
NetworkRideId_t rideIndex, int32_t trackType, const CoordsXYZD& origin, int32_t brakeSpeed, int32_t colour,
|
||||
int32_t seatRotation, int32_t liftHillAndAlternativeState, bool fromTrackDesign);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override final;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
|
||||
@@ -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{};
|
||||
@@ -22,11 +22,11 @@ public:
|
||||
TrackRemoveAction() = default;
|
||||
TrackRemoveAction(track_type_t trackType, int32_t sequence, const CoordsXYZD& origin);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override final;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
@@ -22,11 +22,11 @@ public:
|
||||
TrackSetBrakeSpeedAction() = default;
|
||||
TrackSetBrakeSpeedAction(const CoordsXYZ& loc, track_type_t trackType, uint8_t brakeSpeed);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override final;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
|
||||
@@ -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 };
|
||||
@@ -37,11 +37,11 @@ public:
|
||||
ObjectEntryIndex wallType, const CoordsXYZ& loc, uint8_t edge, int32_t primaryColour, int32_t secondaryColour,
|
||||
int32_t tertiaryColour);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override final;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
@@ -50,13 +50,13 @@ 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
|
||||
*/
|
||||
GameActions::Result::Ptr WallCheckObstruction(WallSceneryEntry * wall, int32_t z0, int32_t z1, bool* wallAcrossTrack) const;
|
||||
GameActions::Result::Ptr WallCheckObstruction(WallSceneryEntry* wall, int32_t z0, int32_t z1, bool* wallAcrossTrack) const;
|
||||
|
||||
/**
|
||||
* Gets whether the given track type can have a wall placed on the edge of the given direction.
|
||||
|
||||
@@ -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;
|
||||
@@ -20,8 +20,8 @@ public:
|
||||
WallRemoveAction() = default;
|
||||
WallRemoveAction(const CoordsXYZD& loc);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor & visitor) override;
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -25,7 +25,7 @@ public:
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
@@ -22,7 +22,7 @@ public:
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -22,7 +22,7 @@ public:
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -23,7 +23,7 @@ public:
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser & stream) override;
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
GameActions::Result::Ptr Query() const override;
|
||||
GameActions::Result::Ptr Execute() const override;
|
||||
|
||||
|
||||
@@ -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