mirror of https://github.com/OpenRCT2/OpenRCT2.git
Add tag and flags to game action
This commit is contained in:
parent
c89a00badd
commit
33397005b0
|
@ -43,6 +43,12 @@ enum class GA_ERROR : uint16
|
||||||
UNKNOWN = UINT16_MAX,
|
UNKNOWN = UINT16_MAX,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
namespace GA_FLAGS
|
||||||
|
{
|
||||||
|
constexpr uint16 ALLOW_WHILE_PAUSED = 1 << 0;
|
||||||
|
constexpr uint16 CLIENT_ONLY = 1 << 1;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the result of a game action query or execution.
|
* Represents the result of a game action query or execution.
|
||||||
*/
|
*/
|
||||||
|
@ -53,6 +59,7 @@ struct GameActionResult
|
||||||
rct_xyz32 Position = { 0 };
|
rct_xyz32 Position = { 0 };
|
||||||
money32 Cost = 0;
|
money32 Cost = 0;
|
||||||
uint16 ExpenditureType = 0;
|
uint16 ExpenditureType = 0;
|
||||||
|
void * Tag = nullptr;
|
||||||
|
|
||||||
GameActionResult();
|
GameActionResult();
|
||||||
GameActionResult(GA_ERROR error, rct_string_id message);
|
GameActionResult(GA_ERROR error, rct_string_id message);
|
||||||
|
@ -64,6 +71,13 @@ struct GameActionResult
|
||||||
*/
|
*/
|
||||||
interface IGameAction
|
interface IGameAction
|
||||||
{
|
{
|
||||||
|
virtual ~IGameAction() = default;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the GA_FLAGS flags that are enabled for this game action.
|
||||||
|
*/
|
||||||
|
virtual uint16 GetFlags() const abstract;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads the game action directly from the given stream. Used for
|
* Reads the game action directly from the given stream. Used for
|
||||||
* sending across the network in multiplayer.
|
* sending across the network in multiplayer.
|
||||||
|
|
|
@ -30,6 +30,11 @@ class SetParkEntranceFeeAction : public IGameAction
|
||||||
public:
|
public:
|
||||||
money16 Fee;
|
money16 Fee;
|
||||||
|
|
||||||
|
uint16 GetFlags() const override
|
||||||
|
{
|
||||||
|
return GA_FLAGS::ALLOW_WHILE_PAUSED;
|
||||||
|
}
|
||||||
|
|
||||||
void Deserialise(IStream * stream) override
|
void Deserialise(IStream * stream) override
|
||||||
{
|
{
|
||||||
Fee = stream->ReadValue<money16>();
|
Fee = stream->ReadValue<money16>();
|
||||||
|
|
Loading…
Reference in New Issue