Base interface class for all actors in the game. Lifecycle is handled by ActorMgr.
More...
#include <ActorBase.h>
Inherited by Actor, BgCenter, and CourseSelectActor.
Public Types | |
| enum | MainState { cState_None = 0 , cState_Failed , cState_Success , cState_Wait } |
| Represents the execution state of a main operation, and whether it was skipped. More... | |
| enum | Result { cResult_Wait = 0 , cResult_Success , cResult_Failed } |
| Defines signals to pass to ActorMgr when performing create and delete operations on the actor. More... | |
| enum | Flag { cFlag_NoEventFreeze = 1 << 1 , cFlag_NoNormalEventFreeze = 1 << 2 } |
| Properties which control execution policy during events. More... | |
| typedef sead::OffsetList< ActorBase > | List |
Public Member Functions | |
| bool | isActive () const |
| Whether this actor has been successfully created and is now active. | |
| void | deleteRequest () |
| Schedule this actor for deletion on the next frame. | |
| bool | isRequestedDelete () const |
| Whether this actor has been scheduled for deletion on the next frame. | |
| UniqueID | getUniqueID () const |
| The unique identifier handle for this actor. | |
| s32 | getProfileID () const |
| The specific profile ID which this actor was instantiated from. | |
| Profile * | getProfile () const |
| The specific profile which this actor was instantiated from. | |
| bool | isCreatedImmediately () const |
Whether the actor was created with ActorMgr::createImmediately(), rather than deferred with ActorMgr::createLater(). | |
| bool | isMapActor () const |
Whether the actor was spawned from the level with ActorCreateMgr, rather than dynamically spawned by another actor. | |
| u32 | getParam0 () const |
| Level designer configuration. Also known as "nybbles" or "spritedata". | |
| u32 | getParam1 () const |
| Level designer configuration. Also known as "nybbles" or "spritedata". | |
| ActorParameterEx1 | getParamEx () const |
| Extra level designer configuration. Also known as "nybbles" or "spritedata". | |
| const List & | getChildList () const |
sead::OffsetList used for holding child actors spawned by this actor. Managed automatically if param.parent_id is set when spawning. | |
| sead::Heap * | getActorHeap () const |
| The personal heap for this actor. | |
| ActorBase * | getParent () const |
| template<typename T> | |
| T * | getParent () const |
The parent actor pointer if this actor is a child, nullptr otherwise. | |
| void | removeChild (ActorBase *child) |
| Disconnects a child from this actor's family tree. | |
| void | getCoinSE (s32 player_no, const sead::Vector3f &position) |
| Plays the coin-get sound. | |
| ActorBase (const ActorCreateParameter ¶m) | |
| Constructs an actor from configuration data. | |
| virtual | ~ActorBase () |
| Destroys the actor and orphans all of its children. | |
| virtual bool | preCreate () |
Callback invoked before the create operation. | |
| virtual Result | create () |
| Main initialization/setup callback for the actor. | |
| virtual void | postCreate (MainState state) |
Callback invoked unconditionally after the create phase completes. It executes even if preCreate() bypassed the main create() operation. | |
| virtual bool | preExecute () |
Callback invoked before the execute operation. | |
| virtual bool | execute () |
| Main execution/logic callback for the actor. Called every frame (the game runs at exactly 60 FPS). | |
| virtual void | postExecute (MainState state) |
Callback invoked unconditionally after the execute phase completes. It executes even if preExecute() bypassed the main execute() operation. | |
| virtual void | lastExecute () |
| Callback which is called after all other actors have finished executing for this frame. | |
| virtual bool | preDraw () |
Callback invoked before the draw operation. | |
| virtual bool | draw () |
| Main rendering callback for the actor. Called every frame (the game runs at exactly 60 FPS). | |
| virtual void | postDraw (MainState state) |
Callback invoked unconditionally after the draw phase completes. It executes even if preDraw() bypassed the main draw() operation. | |
| virtual bool | preDestroy () |
Callback invoked before the delete operation. | |
| virtual Result | destroy () |
| Main deletion callback for the actor. | |
| virtual void | postDestroy (MainState state) |
Unconditionally called callback for after the delete operation. | |
Protected Member Functions | |
| void | setActive_ (bool active) |
Protected Attributes | |
| sead::Heap * | mActorHeap |
Personal heap for this actor of type sead::FrameHeap. Capacity of 0x20200, but profiles in the player whitelist get 0x1A0200. | |
| UniqueID | mUniqueID |
| The unique identifier handle for this actor. | |
| Profile * | mActorProfile |
| The specific profile which this actor was instantiated from. | |
| bool | mCreatedImmediately |
Whether the actor was created with ActorMgr::createImmediately(), rather than deferred with ActorMgr::createLater(). | |
| bool | mIsMapActor |
Whether the actor was spawned from the level with ActorCreateMgr, rather than dynamically spawned by another actor. | |
| bool | mIsActive |
Whether the create operation has completed and the actor is executing. | |
| bool | mDeleteRequestFlag |
| Whether to delete this actor on the next frame. | |
| u32 | mParam0 |
| Level designer configuration. Also known as "nybbles" or "spritedata". | |
| u32 | mParam1 |
| Level designer configuration. Also known as "nybbles" or "spritedata". | |
| ActorParameterEx1 | mParamEx |
| Extra level designer configuration. Also known as "nybbles" or "spritedata". | |
| List | mChildList |
sead::OffsetList used for holding child actors spawned by this actor. Managed automatically if param.parent_id is set when spawning. | |
| sead::ListNode | mChildNode |
Implementation detail. Used to track our position in the parent's mChildList. | |
| ActorBase * | mParent |
The parent actor if this actor is a child. Automatically set to nullptr if orphaned. | |
| sead::ListNode | mExecuteNode |
Implementation detail. Used to track our position in ActorMgr lists. | |
| sead::ListNode | mDrawNode |
Implementation detail. Used to track our position in ActorMgr mDrawManage list. | |
| sead::BitFlag32 | mFlag |
Properties which control execution policy during events. See ActorBase::Flag enum. | |
Friends | |
| class | ActorMgr |
Base interface class for all actors in the game. Lifecycle is handled by ActorMgr.
Size: 0x50vtable Address: 0x100006C0| typedef sead::OffsetList<ActorBase> ActorBase::List |
| enum ActorBase::MainState |
Represents the execution state of a main operation, and whether it was skipped.
In the case of preX skipping the main callback, cState_None will be passed to postX. Otherwise, the signal is forwarded.
| Enumerator | |
|---|---|
| cState_None | The operation was skipped. |
| cState_Failed | The operation was cancelled. |
| cState_Success | The operation was successful. |
| cState_Wait | The operation was stalled. |
| enum ActorBase::Result |
Defines signals to pass to ActorMgr when performing create and delete operations on the actor.
| enum ActorBase::Flag |
Properties which control execution policy during events.
| Enumerator | |
|---|---|
| cFlag_NoEventFreeze | Always execute during event freezes. See |
| cFlag_NoNormalEventFreeze | Always execute during "normal" event freezes. See |
| ActorBase::ActorBase | ( | const ActorCreateParameter & | param | ) |
Constructs an actor from configuration data.
| param | Parameters and user configuration to pass to the actor. |
|
virtual |
Destroys the actor and orphans all of its children.
|
inline |
Whether this actor has been successfully created and is now active.
|
inline |
Schedule this actor for deletion on the next frame.
|
inline |
Whether this actor has been scheduled for deletion on the next frame.
|
inline |
The unique identifier handle for this actor.
| s32 ActorBase::getProfileID | ( | ) | const |
The specific profile ID which this actor was instantiated from.
|
inline |
The specific profile which this actor was instantiated from.
|
inline |
Whether the actor was created with ActorMgr::createImmediately(), rather than deferred with ActorMgr::createLater().
|
inline |
Whether the actor was spawned from the level with ActorCreateMgr, rather than dynamically spawned by another actor.
|
inline |
Level designer configuration. Also known as "nybbles" or "spritedata".
|
inline |
Level designer configuration. Also known as "nybbles" or "spritedata".
|
inline |
Extra level designer configuration. Also known as "nybbles" or "spritedata".
|
inline |
sead::OffsetList used for holding child actors spawned by this actor. Managed automatically if param.parent_id is set when spawning.
|
inline |
The personal heap for this actor.
|
inline |
The parent actor pointer if this actor is a child, nullptr otherwise.
|
inline |
The parent actor pointer if this actor is a child, nullptr otherwise.
| T | The parent type to cast to, returns nullptr if the types are incompatible. |
| void ActorBase::removeChild | ( | ActorBase * | child | ) |
Disconnects a child from this actor's family tree.
| child | The target actor to orphan. |
|
inline |
Plays the coin-get sound.
| player_no | The target player whose controller's speaker to broadcast the sound from. |
| position | The spatial position from which to emit the sound. |
|
virtual |
Callback invoked before the create operation.
create callback, rather than skip to postExecute().Returns true by default.
|
virtual |
Main initialization/setup callback for the actor.
Returns cResult_Success by default.
Reimplemented in ActorBlockHatena, ActorBlockRenga, ActorBlockSwitch, ActorCoin, ActorCoinDemoJump, ActorCoinShowerJump, Birikyu, Bomhei, Boss, BossDemo, BrosBase, FireBallBase, IceBallBase, KillerHoudai, Koton, KuriboBase, MechaKoopa, PlayerBase, PlayerObject, RingBase, RouletteBlock, SnakeBlock, and TarzanIvyBase.
|
virtual |
Callback invoked unconditionally after the create phase completes. It executes even if preCreate() bypassed the main create() operation.
| state | The signal which create() returned, or cState_None if preCreate() skipped it. |
Reimplemented in Actor, ActorCollision, and Shell.
|
virtual |
Callback invoked before the execute operation.
execute callback, rather than skip to postExecute().Returns true by default unless the game is paused or frozen. See EventMgr::isJoin().
Reimplemented in Actor, ActorCollision, Boss, CarryBlockBase, CarryEnemy, CarryObjBase, CourseSelectActor, CourseSelectDemoActor, Enemy, FireBallBase, PlayerBase, PlayerObject, and Shell.
|
virtual |
Main execution/logic callback for the actor. Called every frame (the game runs at exactly 60 FPS).
true / false imply cState_Success / cState_Failed.Returns true by default.
Reimplemented in ActorBlockBase, ActorCoin, ActorCoinBase, ActorCoinDemoBase, BgActorBase, Birikyu, Bomhei, BossDemo, BrosBase, CarryBlockBase, FireBallBase, IceBallBase, KillerHoudai, Koton, KuriboBase, MechaKoopa, PlayerBase, RingBase, RouletteBlock, SnakeBlock, and TarzanIvyBase.
|
virtual |
Callback invoked unconditionally after the execute phase completes. It executes even if preExecute() bypassed the main execute() operation.
| state | The signal which execute() returned, or cState_None if preExecute() skipped it. |
Reimplemented in Actor, ActorCollision, Boss, CarryBlockBase, CarryObjBase, PlayerBase, PlayerObject, and Shell.
|
virtual |
Callback which is called after all other actors have finished executing for this frame.
The actor must subscribe to the finalUpdate signal on a per-frame basis via ActorMgr::addToFinalUpdate().
|
virtual |
Callback invoked before the draw operation.
draw callback, rather than skip to postDraw().Returns true by default.
Reimplemented in Actor, CourseSelectActor, PlayerBase, and PlayerObject.
|
virtual |
Main rendering callback for the actor. Called every frame (the game runs at exactly 60 FPS).
true / false imply cState_Success / cState_Failed. However, signaling failure does not delete the actor.Returns true by default.
Reimplemented in ActorBlockAngle, ActorBlockBase, ActorCoinBase, ActorCoinDemoBase, BgActorBase, Birikyu, Bomhei, BrosBase, ChikuwaBlockBase, FireBallBase, IceBallBase, ItemBase, KillerHoudai, Koton, KuriboBase, MechaKoopa, PlayerObject, RingBase, RouletteBlock, SnakeBlock, and TarzanIvyBase.
|
virtual |
|
virtual |
Callback invoked before the delete operation.
doDelete callback.Returns true by default.
|
virtual |
Main deletion callback for the actor.
Failure and Success both result in deletion. Only Wait results in a stall.
Reimplemented in ActorBlockBase, and ActorCollision.
|
virtual |
Unconditionally called callback for after the delete operation.
| state | The signal which doDelete() returned, or cState_None if preDelete() skipped it. |
|
inlineprotected |
|
friend |
|
protected |
Personal heap for this actor of type sead::FrameHeap. Capacity of 0x20200, but profiles in the player whitelist get 0x1A0200.
|
protected |
The unique identifier handle for this actor.
|
protected |
The specific profile which this actor was instantiated from.
|
protected |
Whether the actor was created with ActorMgr::createImmediately(), rather than deferred with ActorMgr::createLater().
|
protected |
Whether the actor was spawned from the level with ActorCreateMgr, rather than dynamically spawned by another actor.
|
protected |
Whether the create operation has completed and the actor is executing.
|
protected |
Whether to delete this actor on the next frame.
|
protected |
Level designer configuration. Also known as "nybbles" or "spritedata".
|
protected |
Level designer configuration. Also known as "nybbles" or "spritedata".
|
protected |
Extra level designer configuration. Also known as "nybbles" or "spritedata".
|
protected |
sead::OffsetList used for holding child actors spawned by this actor. Managed automatically if param.parent_id is set when spawning.
|
protected |
Implementation detail. Used to track our position in the parent's mChildList.
|
protected |
The parent actor if this actor is a child. Automatically set to nullptr if orphaned.
|
protected |
Implementation detail. Used to track our position in ActorMgr lists.
|
protected |
Implementation detail. Used to track our position in ActorMgr mDrawManage list.
|
protected |
Properties which control execution policy during events. See ActorBase::Flag enum.