Karma Engine
Loading...
Searching...
No Matches
Karma::UWorld Class Reference

#include <World.h>

Inheritance diagram for Karma::UWorld:
Collaboration diagram for Karma::UWorld:

Classes

struct  InitializationValues
 

Public Member Functions

AActorSpawnActor (UClass *Class, FTransform const *Transform, const FActorSpawnParameters &SpawnParameters=FActorSpawnParameters())
 
template<class T >
T * SpawnActor (UClass *Class, const FActorSpawnParameters &SpawnParameters=FActorSpawnParameters())
 
ULevelGetPersistentLevel () const
 
void SetGameInstance (UGameInstance *NewGI)
 
void Tick (float DeltaSeconds)
 
FORCEINLINE double GetTimeSeconds () const
 
FORCEINLINE ULevelGetCurrentLevel () const
 
bool AreActorsInitialized () const
 
bool HasBegunPlay () const
 
void InitializeNewWorld (const InitializationValues IVS=InitializationValues(), bool bInSkipInitWorld=false)
 
void InitializeActorsForPlay (const FURL &InURL, bool bResetTime=true)
 
void ModifyLevel (ULevel *Level) const
 
bool IsGameWorld () const
 
void RemoveActor (AActor *Actor, bool bShouldModifyLevel) const
 
bool ShivaActor (AActor *Actor, bool bNetForce=false, bool bShouldModifyLevel=true)
 
void AddOnActorSpawnedHandler () const
 
void RemoveOnActorSpawnedHander () const
 
void OnActorSpawned ()
 
- Public Member Functions inherited from Karma::UObject
 UObject ()
 
virtual void FinishDestroy ()
 
virtual const std::string & GetDesc ()
 Return a one line description of an object for viewing in the thumbnail view of the generic browser.
 
virtual class UWorldGetWorld () const
 Returns what UWorld this object is contained within.
 
bool IsValidChecked (const UObject *Test)
 
virtual void BeginDestroy ()
 Called before destroying the object. This is called immediately upon deciding to destroy the object, to allow the object to begin an asynchronous cleanup process.
 
FORCEINLINE bool Modify (bool bAlwaysMarkDirty=true)
 
bool IsSelected () const
 Test the selection state of a UObject.
 
- Public Member Functions inherited from Karma::UObjectBase
 UObjectBase (UClass *inClass, EObjectFlags inFlags, EInternalObjectFlags inInternalFlags, UObject *inOuter, const std::string &inName)
 
UPackageGetPackage () const
 
UPackageGetExternalPackage () const
 
bool IsUnreachable () const
 
FORCEINLINE void SetInternalIndex (uint32_t StoreIndex)
 
FORCEINLINE uint32_t GetInterIndex () const
 
void MarkAsGarbage ()
 
void ClearGarbage ()
 
FORCEINLINE const std::string & GetName () const
 
FORCEINLINE void SetObjectName (const std::string &aName)
 
FORCEINLINE UObjectGetOuter () const
 
UObjectGetTypedOuter (UClass *Target) const
 
template<typename T >
T * GetTypedOuter () const
 
bool IsValidLowLevel () const
 
template<typename OtherClassType >
FORCEINLINE bool IsA (OtherClassType SomeBase) const
 
FORCEINLINE UClassGetClass () const
 
FORCEINLINE EObjectFlags GetFlags () const
 
FORCEINLINE void SetFlags (EObjectFlags NewFlags)
 
FORCEINLINE void ClearFlags (EObjectFlags NewFlags)
 
FORCEINLINE bool HasAnyFlags (EObjectFlags FlagsToCheck) const
 
FORCEINLINE bool HasAnyInternalFlags (EInternalObjectFlags FlagsToCheck) const
 
FORCEINLINE void SetInternalFlags (EInternalObjectFlags FlagsToSet) const
 
FORCEINLINE void AddToRoot ()
 

Static Public Member Functions

static UWorldCreateWorld (const EWorldType::Type InWorldType, bool bInformEngineOfWorld, const std::string &WorldName="NoName", UPackage *InWorldPackage=NULL, bool bAddToRoot=true, bool bInSkipInitWorld=false)
 
- Static Public Member Functions inherited from Karma::UObject
static const char * StaticConfigName ()
 
- Static Public Member Functions inherited from Karma::UObjectBase
static FORCEINLINE EInternalObjectFlags FixGarbageOrPendingKillInternalObjectFlags (const EInternalObjectFlags InFlags)
 

Public Attributes

uint8_t m_bIsTearingDown: 1
 
uint8_t m_bActorsInitialized: 1
 
uint8_t m_bBegunPlay: 1
 
EWorldType::Type m_WorldType
 

Additional Inherited Members

- Protected Member Functions inherited from Karma::UObjectBase
FORCEINLINE void SetFlagsTo (EObjectFlags NewFlags)
 

Detailed Description

The World is the top level object representing a map or a sandbox in which Actors and Components will exist and be rendered.

A World can be a single Persistent Level with an optional list of streaming levels that are loaded and unloaded via volumes and blueprint functions or it can be a collection of levels organized with a World Composition.

In a standalone game, generally only a single World exists except during seamless area transitions when both a destination and current world exists. In the editor many Worlds exist: The level being edited, each PIE instance, each editor tool which has an interactive rendered viewport, and many more.

Member Function Documentation

◆ AddOnActorSpawnedHandler()

void Karma::UWorld::AddOnActorSpawnedHandler ( ) const

Add a listener for OnActorSpawned events

Not functional

◆ AreActorsInitialized()

bool Karma::UWorld::AreActorsInitialized ( ) const

Returns true if the actors have been initialized and are ready to start play

◆ CreateWorld()

UWorld * Karma::UWorld::CreateWorld ( const EWorldType::Type InWorldType,
bool bInformEngineOfWorld,
const std::string & WorldName = "NoName",
UPackage * InWorldPackage = NULL,
bool bAddToRoot = true,
bool bInSkipInitWorld = false )
static

Static function that creates a new UWorld and returns a pointer to it

◆ HasBegunPlay()

bool Karma::UWorld::HasBegunPlay ( ) const

Initializes a newly created world. This and nearby functions (create destroy world for instance) should be useful Returns true if gameplay has already started, false otherwise.

◆ InitializeActorsForPlay()

void Karma::UWorld::InitializeActorsForPlay ( const FURL & InURL,
bool bResetTime = true )

Initializes all actors and prepares them to start gameplay

Parameters
InURLcommandline URL
bResetTime(optional) whether the WorldSettings's TimeSeconds should be reset to zero

◆ InitializeNewWorld()

void Karma::UWorld::InitializeNewWorld ( const InitializationValues IVS = InitializationValues(),
bool bInSkipInitWorld = false )

Initializes a newly created world.

◆ IsGameWorld()

bool Karma::UWorld::IsGameWorld ( ) const

Returns true if this world is any kind of game world (including PIE worlds)

◆ ModifyLevel()

void Karma::UWorld::ModifyLevel ( ULevel * Level) const

Transacts the specified level – the correct way to modify a level as opposed to calling Level->Modify.

◆ OnActorSpawned()

void Karma::UWorld::OnActorSpawned ( )

Broadcasts a notification whenever an actor is spawned. This event is only for newly created actors.

We may take digression from ue in the sense that we may use Karma's own event broadcasting system Not functional

◆ RemoveActor()

void Karma::UWorld::RemoveActor ( AActor * Actor,
bool bShouldModifyLevel ) const

Removes the passed in actor from the actor lists. Please note that the code actually doesn't physically remove the index but rather clears it so other indices are still valid and the actors array size doesn't change.

Parameters
ActorActor to remove.
bShouldModifyLevelIf true, Modify() the level before removing the actor if in the editor.

◆ SetGameInstance()

void Karma::UWorld::SetGameInstance ( UGameInstance * NewGI)
inline

Sets the owning game instance for this world

◆ ShivaActor()

bool Karma::UWorld::ShivaActor ( AActor * Actor,
bool bNetForce = false,
bool bShouldModifyLevel = true )

Removes the actor from its level's actor list and generally cleans up the engine's internal state. What this function does not do, but is handled via garbage collection instead, is remove references to this actor from all other actors, and kill the actor's resources. This function is set up so that no problems occur even if the actor is being destroyed inside its recursion stack.

In UE this routine is called DestoryActor, in Karma, obviously, we be using ShivaActor which should mean the same.

Parameters
ThisActorActor to remove.
bNetForce[optional] Ignored unless called during play. Default is false.
bShouldModifyLevel[optional] If true, Modify() the level before removing the actor. Default is true.
Returns
true if destroyed or already marked for destruction, false if actor couldn't be destroyed.
See also
Actor::DispatchBeginPlay(bool bFromLevelStreaming)

◆ SpawnActor() [1/2]

template<class T >
T * Karma::UWorld::SpawnActor ( UClass * Class,
const FActorSpawnParameters & SpawnParameters = FActorSpawnParameters() )
inline

Templated version of SpawnActor that allows you to specify the class type via parameter while the return type is a parent class of that type

◆ SpawnActor() [2/2]

AActor * Karma::UWorld::SpawnActor ( UClass * Class,
FTransform const * Transform,
const FActorSpawnParameters & SpawnParameters = FActorSpawnParameters() )

Spawn Actors with given transform and SpawnParameters

Parameters
ClassKarma's, UE based, meta info Class to Spawn
TransformWorld Transform to spawn with
SpawnParametersSpawn Parameters specific to the Actor
Returns
Actor that just spawned

◆ Tick()

void Karma::UWorld::Tick ( float DeltaSeconds)

Update the level after a variable amount of time, DeltaSeconds, has passed. All child actors are ticked after their owners have been ticked.

Member Data Documentation

◆ m_bActorsInitialized

uint8_t Karma::UWorld::m_bActorsInitialized

Time in seconds since level began play, but IS paused when the game is paused, and IS dilated/clamped. Whether actors have been initialized for play

◆ m_bBegunPlay

uint8_t Karma::UWorld::m_bBegunPlay

Whether BeginPlay has been called on actors

◆ m_bIsTearingDown

uint8_t Karma::UWorld::m_bIsTearingDown

Is the world being torn down

◆ m_WorldType

EWorldType::Type Karma::UWorld::m_WorldType

The type of world this is. Describes the context in which it is being used (Editor, Game, Preview etc.)


The documentation for this class was generated from the following files: