class

FInstanceComponents

Module
Game
Header
#include "Game/InstanceComponents.h"
Namespace
Mowo

Public functions

ReturnsNameDescription
boolCanAddA concrete, constructible MActorComponent subclass a designer may add: not abstract, transient, not placeable, an interface half or ECS-mirrored.
std::vector<MClass*>CollectAddableEvery registered class CanAdd accepts, ordered by name.
boolCanRemoveWhether Remove may take this component: one a designer added that is not the actor's root.
std::stringUniqueNameA name no component of actor has: the class name, then name1, name2...
MActorComponent*CreateConstructs, names, flags and attaches the component with no lifecycle call: the serializer's load path, where the actor registers (OnRegister) itself afterwards.
MActorComponent*AddCreate for a live actor: also runs OnRegister, and BeginPlay when the actor has already begun play.
boolRemoveDetaches a component Add/Create made.

Function details

CanAdd

C++
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

C++
static std::vector<MClass*> CollectAddable()

Every registered class CanAdd accepts, ordered by name.

CanRemove

C++
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

C++
static std::string UniqueName(const AActor* actor, const MClass* cls)

A name no component of actor has: the class name, then name1, name2...

Create

C++
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

C++
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

C++
static bool Remove(AActor* actor, MActorComponent* component)

Detaches a component Add/Create made. False for a constructor component.

Generated from Game/InstanceComponents.h via game.json · Nov 5, 2026Version 1.0.0