Table of Contents

Class World

Namespace
Ghost.Entities
Assembly
Ghost.Entities.dll
public class World : IDisposable, IEquatable<World>
Inheritance
World
Implements
Inherited Members

Properties

ComponentManager

Gets the component manager for this world.

public ComponentManager ComponentManager { get; }

Property Value

ComponentManager

EntityCommandBuffer

Gets the main entity command buffer for this world.

public EntityCommandBuffer EntityCommandBuffer { get; }

Property Value

EntityCommandBuffer

Remarks

Use GetThreadLocalEntityCommandBuffer(int) to get thread-local command buffers for multi-threaded jobs.

EntityManager

Gets the publicntity manager for this world.

public EntityManager EntityManager { get; }

Property Value

EntityManager

ID

Gets the unique identifier of this world.

public Identifier<World> ID { get; }

Property Value

Identifier<World>

JobScheduler

Gets the job scheduler associated with this world.

public JobScheduler? JobScheduler { get; }

Property Value

JobScheduler

SystemManager

Gets the system manager for this world.

public SystemManager SystemManager { get; }

Property Value

SystemManager

Version

Gets the current version number of the world.

public int Version { get; }

Property Value

int

WorldCount

public static int WorldCount { get; }

Property Value

int

Methods

AddService<T>(T)

Registers or overwrites a global resource in the world.

public void AddService<T>(T resource) where T : class

Parameters

resource T

Type Parameters

T

Create(JobScheduler?, int)

public static World Create(JobScheduler? jobScheduler = null, int entityCapacity = 16)

Parameters

jobScheduler JobScheduler
entityCapacity int

Returns

World

Destroy(Identifier<World>)

public static void Destroy(Identifier<World> id)

Parameters

id Identifier<World>

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Equals(World?)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(World? other)

Parameters

other World

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

~World()

protected ~World()

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

GetService<T>()

Retrieves a global resource from the world.

public T GetService<T>() where T : class

Returns

T

Type Parameters

T

GetThreadLocalEntityCommandBuffer(int)

Gets the thread-local entity command buffer for the specified thread index.

public EntityCommandBuffer GetThreadLocalEntityCommandBuffer(int threadIndex)

Parameters

threadIndex int

Returns

EntityCommandBuffer

GetWorld(Identifier<World>)

public static World? GetWorld(Identifier<World> id)

Parameters

id Identifier<World>

Returns

World

GetWorldUncheck(Identifier<World>)

public static World GetWorldUncheck(Identifier<World> id)

Parameters

id Identifier<World>

Returns

World

HasService<T>()

Checks if a global resource exists.

public bool HasService<T>() where T : class

Returns

bool

Type Parameters

T

Operators

operator ==(World?, World?)

public static bool operator ==(World? left, World? right)

Parameters

left World
right World

Returns

bool

operator !=(World?, World?)

public static bool operator !=(World? left, World? right)

Parameters

left World
right World

Returns

bool