Add tag and flags to game action

This commit is contained in:
Ted John 2017-01-11 22:00:10 +00:00 committed by Michał Janiszewski
parent c89a00badd
commit 33397005b0
2 changed files with 19 additions and 0 deletions

View File

@ -43,6 +43,12 @@ enum class GA_ERROR : uint16
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.
*/
@ -53,6 +59,7 @@ struct GameActionResult
rct_xyz32 Position = { 0 };
money32 Cost = 0;
uint16 ExpenditureType = 0;
void * Tag = nullptr;
GameActionResult();
GameActionResult(GA_ERROR error, rct_string_id message);
@ -64,6 +71,13 @@ struct GameActionResult
*/
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
* sending across the network in multiplayer.

View File

@ -30,6 +30,11 @@ class SetParkEntranceFeeAction : public IGameAction
public:
money16 Fee;
uint16 GetFlags() const override
{
return GA_FLAGS::ALLOW_WHILE_PAUSED;
}
void Deserialise(IStream * stream) override
{
Fee = stream->ReadValue<money16>();