FInstanceComponents
- Module
- Game
- Header
#include "Game/InstanceComponents.h"- Namespace
Mowo
Public functions
| Returns | Name | Description |
|---|---|---|
bool | CanAdd | A concrete, constructible MActorComponent subclass a designer may add: not abstract, transient, not placeable, an interface half or ECS-mirrored. |
std::vector<MClass*> | CollectAddable | Every registered class CanAdd accepts, ordered by name. |
bool | CanRemove | Whether Remove may take this component: one a designer added that is not the actor's root. |
std::string | UniqueName | A name no component of actor has: the class name, then name1, name2... |
MActorComponent* | Create | Constructs, names, flags and attaches the component with no lifecycle call: the serializer's load path, where the actor registers (OnRegister) itself afterwards. |
MActorComponent* | Add | Create for a live actor: also runs OnRegister, and BeginPlay when the actor has already begun play. |
bool | Remove | Detaches a component Add/Create made. |
Function details
CanAdd
static bool CanAdd(MClass* cls)A concrete, constructible MActorComponent subclass a designer may add: not abstract, transient, not placeable, an interface half or ECS-mirrored.
CollectAddable
static std::vector<MClass*> CollectAddable()Every registered class CanAdd accepts, ordered by name.
CanRemove
static bool CanRemove(const AActor* actor, const MActorComponent* component)Whether Remove may take this component: one a designer added that is not the actor's root.
UniqueName
static std::string UniqueName(const AActor* actor, const MClass* cls)A name no component of actor has: the class name, then name1, name2...
Create
static MActorComponent* Create(AActor* actor, MClass* cls, const std::string& name)Constructs, names, flags and attaches the component with no lifecycle call: the serializer's load path, where the actor registers (OnRegister) itself afterwards. Null when the class cannot be added or the name is taken.
Add
static MActorComponent* Add(AActor* actor, MClass* cls, const std::string& name = std::string(), int32_t index = -1)Create for a live actor: also runs OnRegister, and BeginPlay when the actor has already begun play. An empty name picks a unique one. index >= 0 puts it at that place in the actor's component list (undoing a removal restores the order); -1 appends.
Remove
static bool Remove(AActor* actor, MActorComponent* component)Detaches a component Add/Create made. False for a constructor component.