My Project
|
key for actions and animations. More...
#include <KeyFrame.h>
Public Types | |
enum | KeyID { TOGGLE_TO_WALK =0, TOGGLE_TO_RUN, JUMP, MOUNT, NONE } |
Public Member Functions | |
ActionKey (const char *name) | |
ActionKey (const std::string &name) | |
ActionKey (KeyID keyID) | |
ActionKey (int nAnimID) | |
const char * | ToString () const |
get the string of the action key. More... | |
int | ToAnimID () const |
get the animation ID,please refer to the animation table. More... | |
bool | IsJump () const |
whether this is a jump action key. More... | |
bool | IsToggleToWalk () const |
whether this is a key that set the default moving style as walking. More... | |
bool | IsToggleToRun () const |
whether this is a key that set the default moving style as running. More... | |
bool | IsMount () const |
whether this is a key that mount the character object on nearest object. More... | |
Public Attributes | |
string | sActionName |
Static Public Attributes | |
static const int | MAX_ACTIONNAME_LEN = 16 |
key for actions and animations.
The key is internally stored as action string. if the action string is a number, it is treated as the ID of the action in AnimTable, such as "11","0","123" if the action string is not a number(i.e. failed convert to number using atoi()), then it is treated as the name of the action, and the AnimTable is used to retrieve the animation ID for the name. If there is no valid animation ID, 0 is returned. some action string is reserved. they are "_toggletowalk","_toggletorun","_mount".
bool ActionKey::IsJump | ( | ) | const |
whether this is a jump action key.
whether the action string is "js" (jump start).
bool ActionKey::IsMount | ( | ) | const |
whether this is a key that mount the character object on nearest object.
whether the action string is "_mount".
bool ActionKey::IsToggleToRun | ( | ) | const |
whether this is a key that set the default moving style as running.
whether the action string is "_toggletorun".
bool ActionKey::IsToggleToWalk | ( | ) | const |
whether this is a key that set the default moving style as walking.
whether the action string is "_toggletowalk".
int ActionKey::ToAnimID | ( | ) | const |
get the animation ID,please refer to the animation table.
if the action string is a number, it is treated as the ID of the action in AnimTable, such as "11","0","123" if the action string is not a number(i.e. failed convert to number using atoi()), then it is treated as the name of the action, and the AnimTable is used to retrieve the animation ID for the name. If there is no valid animation ID, 0 is returned.
const char * ActionKey::ToString | ( | ) | const |
get the string of the action key.