![]() |
Peoplemon
0.1.0
Peoplemon 3 game source documentation
|
Emitted by the BattleFSM. All UI is handled via a queue of commands. Commands are resolved in the order they are received. Commands are sent over the network and each player individually resolves them. More...
#include <Command.hpp>
Public Types | |
enum | Type : std::uint8_t { DisplayMessage = 0 , PlayAnimation = 1 , SyncStateNoSwitch = 2 , SyncStateSwitch = 3 , WaitForView = 4 , NotifyBattleWinner = 5 } |
The type the command is. More... | |
Public Member Functions | |
Command (Type type) | |
Creates a new command of the given type with no data. More... | |
Command (Type type, bool forHost) | |
Creates a new command of the given type and a bool to indicate which battler it is for. More... | |
Command (cmd::Message &&message) | |
Creates a new DisplayMessage command. More... | |
Command (cmd::Animation &&anim) | |
Creates a new PlayAnimation command. More... | |
Type | getType () const |
Returns the type of this command. More... | |
const cmd::Message & | getMessage () const |
Returns the message if this command is a message. More... | |
const cmd::Animation & | getAnimation () const |
Returns the animation if this command is an animation. More... | |
bool | forHost () const |
Returns whether or not this command is for the active battler. More... | |
Emitted by the BattleFSM. All UI is handled via a queue of commands. Commands are resolved in the order they are received. Commands are sent over the network and each player individually resolves them.
Definition at line 22 of file Command.hpp.
enum core::battle::Command::Type : std::uint8_t |
The type the command is.
Enumerator | |
---|---|
DisplayMessage | |
PlayAnimation | |
SyncStateNoSwitch | |
SyncStateSwitch | |
WaitForView | |
NotifyBattleWinner |
Definition at line 28 of file Command.hpp.
core::battle::Command::Command | ( | Type | type | ) |
Creates a new command of the given type with no data.
type | The command type to create |
Definition at line 7 of file Command.cpp.
core::battle::Command::Command | ( | Type | type, |
bool | forHost | ||
) |
Creates a new command of the given type and a bool to indicate which battler it is for.
type | The command type to create |
forActiveBattler | True if cmd is for active battler, false for inactive |
Definition at line 11 of file Command.cpp.
core::battle::Command::Command | ( | cmd::Message && | message | ) |
Creates a new DisplayMessage command.
message | The message to display |
Definition at line 15 of file Command.cpp.
core::battle::Command::Command | ( | cmd::Animation && | anim | ) |
Creates a new PlayAnimation command.
anim | The animation descriptor to play |
Definition at line 19 of file Command.cpp.
bool core::battle::Command::forHost | ( | ) | const |
Returns whether or not this command is for the active battler.
Definition at line 37 of file Command.cpp.
const cmd::Animation & core::battle::Command::getAnimation | ( | ) | const |
Returns the animation if this command is an animation.
Definition at line 31 of file Command.cpp.
const cmd::Message & core::battle::Command::getMessage | ( | ) | const |
Returns the message if this command is a message.
Definition at line 25 of file Command.cpp.
Command::Type core::battle::Command::getType | ( | ) | const |
Returns the type of this command.
Definition at line 23 of file Command.cpp.