Base interface class for all actors in the game. Lifecycle is handled by ActorMgr.
More...
#include <ActorBase.h>
Inherited by Actor, BgCenter, and CourseSelectActor.
|
| | ActorBase (const ActorCreateParam ¶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 | finalUpdate () |
| | 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 | preDelete () |
| | Callback invoked before the delete operation.
|
| virtual Result | doDelete () |
| | Main deletion callback for the actor.
|
| virtual void | postDelete (MainState state) |
| | Unconditionally called callback for after the delete operation.
|
| void | setActive_ (bool active) |
Base interface class for all actors in the game. Lifecycle is handled by ActorMgr.
Size: 0x50
vtable Address: 0x100006C0
◆ List
◆ 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.
|
◆ Result
Defines signals to pass to ActorMgr when performing create and delete operations on the actor.
| Enumerator |
|---|
| cResult_Wait | Stall the operation, tries to call again the next frame.
|
| cResult_Success | The operation was successful, continue execution.
|
| cResult_Failed | Cancel the operation. This deletes the actor.
|
◆ ActorBase()
Constructs an actor from configuration data.
- Parameters
-
| param | Parameters and user configuration to pass to the actor. |
- Address: 0x02002CE0
◆ ~ActorBase()
| virtual ActorBase::~ActorBase |
( |
| ) |
|
|
protectedvirtual |
Destroys the actor and orphans all of its children.
- Address: 0x02002E68
◆ isActive()
| bool ActorBase::isActive |
( |
| ) |
const |
|
inline |
Whether this actor has been successfully created and is now active.
◆ deleteRequest()
| void ActorBase::deleteRequest |
( |
| ) |
|
|
inline |
Schedule this actor for deletion on the next frame.
◆ isRequestedDelete()
| bool ActorBase::isRequestedDelete |
( |
| ) |
const |
|
inline |
Whether this actor has been scheduled for deletion on the next frame.
◆ getActorUniqueID()
The unique identifier handle for this actor.
◆ getProfileID()
| s32 ActorBase::getProfileID |
( |
| ) |
const |
The specific profile ID which this actor was instantiated from.
- Address: 0x02002C80
◆ getProfile()
| Profile * ActorBase::getProfile |
( |
| ) |
const |
|
inline |
The specific profile which this actor was instantiated from.
◆ isCreatedImmediately()
| bool ActorBase::isCreatedImmediately |
( |
| ) |
const |
|
inline |
◆ isMapActor()
| bool ActorBase::isMapActor |
( |
| ) |
const |
|
inline |
Whether the actor was spawned from the level with ActorCreateMgr, rather than dynamically spawned by another actor.
◆ getParam0()
| u32 ActorBase::getParam0 |
( |
| ) |
const |
|
inline |
Level designer configuration. Also known as "nybbles" or "spritedata".
◆ getParam1()
| u32 ActorBase::getParam1 |
( |
| ) |
const |
|
inline |
Level designer configuration. Also known as "nybbles" or "spritedata".
◆ getParamEx()
Extra level designer configuration. Also known as "nybbles" or "spritedata".
◆ getChildList()
| const List & ActorBase::getChildList |
( |
| ) |
const |
|
inline |
sead::OffsetList used for holding child actors spawned by this actor. Managed automatically if param.parent_id is set when spawning.
◆ getActorHeap()
The personal heap for this actor.
◆ getParent() [1/2]
The parent actor pointer if this actor is a child, nullptr otherwise.
◆ getParent() [2/2]
template<typename T>
| T * ActorBase::getParent |
( |
| ) |
const |
|
inline |
The parent actor pointer if this actor is a child, nullptr otherwise.
- Template Parameters
-
| T | The parent type to cast to, returns nullptr if the types are incompatible. |
◆ removeChild()
| void ActorBase::removeChild |
( |
ActorBase * | child | ) |
|
Disconnects a child from this actor's family tree.
- Parameters
-
| child | The target actor to orphan. |
- Address: 0x02002C8C
◆ preCreate()
| virtual bool ActorBase::preCreate |
( |
| ) |
|
|
protectedvirtual |
Callback invoked before the create operation.
- Returns
- Whether to continue to the main
create callback, rather than skip to postExecute().
Returns true by default.
- Address: 0x02002F7C
◆ create()
| virtual Result ActorBase::create |
( |
| ) |
|
|
protectedvirtual |
Main initialization/setup callback for the actor.
- Returns
- A signal for how to handle the operation.
Returns cResult_Success by default.
- Address: 0x02002F84
Reimplemented in Birikyu, Bomhei, Boss, BossDemo, BrosBase, KillerHoudai, Koton, KuriboBase, MechaKoopa, PlayerBase, PlayerObject, and TarzanIvyBase.
◆ postCreate()
| virtual void ActorBase::postCreate |
( |
MainState | state | ) |
|
|
protectedvirtual |
Callback invoked unconditionally after the create phase completes. It executes even if preCreate() bypassed the main create() operation.
- Parameters
-
- Address: 0x02002F00
Reimplemented in Actor, and ActorCollision.
◆ preExecute()
| virtual bool ActorBase::preExecute |
( |
| ) |
|
|
protectedvirtual |
◆ execute()
| virtual bool ActorBase::execute |
( |
| ) |
|
|
protectedvirtual |
Main execution/logic callback for the actor. Called every frame (the game runs at exactly 60 FPS).
- Returns
- A signal for how to handle the operation.
true / false imply cState_Success / cState_Failed.
Returns true by default.
- Address: 0x02002F8C
Reimplemented in ActorBlockBase, Birikyu, Bomhei, BossDemo, BrosBase, KillerHoudai, Koton, KuriboBase, MechaKoopa, PlayerBase, and TarzanIvyBase.
◆ postExecute()
| virtual void ActorBase::postExecute |
( |
MainState | state | ) |
|
|
protectedvirtual |
◆ finalUpdate()
| virtual void ActorBase::finalUpdate |
( |
| ) |
|
|
protectedvirtual |
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().
- Address: 0x02002F94
◆ preDraw()
| virtual bool ActorBase::preDraw |
( |
| ) |
|
|
protectedvirtual |
◆ draw()
| virtual bool ActorBase::draw |
( |
| ) |
|
|
protectedvirtual |
Main rendering callback for the actor. Called every frame (the game runs at exactly 60 FPS).
- Note
- This is only for scheduling deferred render tasks; actual rendering may not be performed at this stage.
- Returns
- A signal for how to handle the operation.
true / false imply cState_Success / cState_Failed. However, signaling failure does not delete the actor.
Returns true by default.
- Address 0x02002FA0
Reimplemented in ActorBlockAngle, ActorBlockBase, Birikyu, Bomhei, BrosBase, ChikuwaBlockBase, KillerHoudai, Koton, KuriboBase, MechaKoopa, PlayerObject, and TarzanIvyBase.
◆ postDraw()
| virtual void ActorBase::postDraw |
( |
MainState | state | ) |
|
|
protectedvirtual |
Callback invoked unconditionally after the draw phase completes. It executes even if preDraw() bypassed the main draw() operation.
- Parameters
-
| state | The signal which draw() returned, or cState_None if preDraw() skipped it. |
- Address 0x02002F38
◆ preDelete()
| virtual bool ActorBase::preDelete |
( |
| ) |
|
|
protectedvirtual |
Callback invoked before the delete operation.
- Returns
- Whether to continue to the main
doDelete callback.
Returns true by default.
- Address: 0x02002FA8
◆ doDelete()
| virtual Result ActorBase::doDelete |
( |
| ) |
|
|
protectedvirtual |
Main deletion callback for the actor.
- Returns
- A signal for how to handle the operation.
Failure and Success both result in deletion. Only Wait results in a stall.
- Address: 0x02002FB0
Reimplemented in ActorCollision, Birikyu, Bomhei, Boss, BossDemo, BrosBase, CarryEnemy, KillerHoudai, Koton, Kuribo, KuriboBase, and PlayerObject.
◆ postDelete()
| virtual void ActorBase::postDelete |
( |
MainState | state | ) |
|
|
protectedvirtual |
Unconditionally called callback for after the delete operation.
- Parameters
-
- Note
- The actor has still technically not been deleted yet at this point, that occurs right after this call.
- Address: 0x02002F3C
◆ setActive_()
| void ActorBase::setActive_ |
( |
bool | active | ) |
|
|
inlineprotected |
◆ ActorMgr
◆ mActorHeap
Personal heap for this actor of type sead::FrameHeap. Capacity of 0x20200, but profiles in the player whitelist get 0x1A0200.
◆ mActorUniqueID
The unique identifier handle for this actor.
◆ mActorProfile
The specific profile which this actor was instantiated from.
◆ mCreatedImmediately
| bool ActorBase::mCreatedImmediately |
|
protected |
◆ mIsMapActor
| bool ActorBase::mIsMapActor |
|
protected |
Whether the actor was spawned from the level with ActorCreateMgr, rather than dynamically spawned by another actor.
◆ mIsActive
| bool ActorBase::mIsActive |
|
protected |
Whether the create operation has completed and the actor is executing.
◆ mDeleteRequestFlag
| bool ActorBase::mDeleteRequestFlag |
|
protected |
Whether to delete this actor on the next frame.
◆ mParam0
Level designer configuration. Also known as "nybbles" or "spritedata".
◆ mParam1
Level designer configuration. Also known as "nybbles" or "spritedata".
◆ mParamEx
Extra level designer configuration. Also known as "nybbles" or "spritedata".
◆ mChildList
| List ActorBase::mChildList |
|
protected |
sead::OffsetList used for holding child actors spawned by this actor. Managed automatically if param.parent_id is set when spawning.
◆ mChildNode
Implementation detail. Used to track our position in the parent's mChildList.
◆ mParent
The parent actor if this actor is a child. Automatically set to nullptr if orphaned.
◆ mExecuteNode
Implementation detail. Used to track our position in ActorMgr lists.
◆ mDrawNode
Implementation detail. Used to track our position in ActorMgr mDrawManage list.
◆ mFlag