MonoWorld

Namespace: Murder.Core
Assembly: Murder.dll

public class MonoWorld : World, IDisposable

World implementation based in MonoGame.

Implements: World, IDisposable

⭐ Constructors

public MonoWorld(IList<T> systems, Camera2D camera, Guid worldAssetGuid)

Parameters
systems IList<T>
camera Camera2D
worldAssetGuid Guid

⭐ Properties

_cachedRenderSystems

protected readonly SortedList<TKey, TValue> _cachedRenderSystems;

Returns
SortedList<TKey, TValue>

_overallStopwatch

protected readonly Stopwatch _overallStopwatch;

Returns
Stopwatch

_stopwatch

protected readonly Stopwatch _stopwatch;

Returns
Stopwatch

Camera

public readonly Camera2D Camera;

Returns
Camera2D

Contexts

protected readonly Dictionary<TKey, TValue> Contexts;

Returns
Dictionary<TKey, TValue>

EntityCount

public int EntityCount { get; }

Returns
int

FixedUpdateCounters

public readonly Dictionary<TKey, TValue> FixedUpdateCounters;

Returns
Dictionary<TKey, TValue>

GuiCounters

public readonly Dictionary<TKey, TValue> GuiCounters;

This has the duration of each gui render system (id) to its corresponding time (in ms). See World.IdToSystem on how to fetch the actual system.

Returns
Dictionary<TKey, TValue>

IdToSystem

public readonly ImmutableDictionary<TKey, TValue> IdToSystem;

Returns
ImmutableDictionary<TKey, TValue>

IsExiting

public bool IsExiting { get; }

Returns
bool

IsPaused

public bool IsPaused { get; }

Returns
bool

PreRenderCounters

public readonly Dictionary<TKey, TValue> PreRenderCounters;

This has the duration of each reactive system (id) to its corresponding time (in ms). See World.IdToSystem on how to fetch the actual system.

Returns
Dictionary<TKey, TValue>

ReactiveCounters

public readonly Dictionary<TKey, TValue> ReactiveCounters;

Returns
Dictionary<TKey, TValue>

RenderCounters

public readonly Dictionary<TKey, TValue> RenderCounters;

This has the duration of each render system (id) to its corresponding time (in ms). See World.IdToSystem on how to fetch the actual system.

Returns
Dictionary<TKey, TValue>

UpdateCounters

public readonly Dictionary<TKey, TValue> UpdateCounters;

Returns
Dictionary<TKey, TValue>

WorldAssetGuid

public readonly Guid WorldAssetGuid;

Returns
Guid

⭐ Methods

ClearDiagnosticsCountersForSystem(int)

protected virtual void ClearDiagnosticsCountersForSystem(int id)

Parameters
id int

InitializeDiagnosticsForSystem(int, ISystem)

protected virtual void InitializeDiagnosticsForSystem(int systemId, ISystem system)

Parameters
systemId int
system ISystem

InitializeDiagnosticsCounters()

protected void InitializeDiagnosticsCounters()

ActivateSystem()

public bool ActivateSystem()

Returns
bool

ActivateSystem(Type)

public bool ActivateSystem(Type t)

Parameters
t Type

Returns
bool

DeactivateSystem(bool)

public bool DeactivateSystem(bool immediately)

Parameters
immediately bool

Returns
bool

DeactivateSystem(int, bool)

public bool DeactivateSystem(int id, bool immediately)

Parameters
id int
immediately bool

Returns
bool

DeactivateSystem(Type, bool)

public bool DeactivateSystem(Type t, bool immediately)

Parameters
t Type
immediately bool

Returns
bool

IsSystemActive(Type)

public bool IsSystemActive(Type t)

Parameters
t Type

Returns
bool

AddEntity()

public Entity AddEntity()

Returns
Entity

AddEntity(IComponent[])

public Entity AddEntity(IComponent[] components)

Parameters
components IComponent[]

Returns
Entity

AddEntity(T?, IComponent[])

public Entity AddEntity(T? id, IComponent[] components)

Parameters
id T?
components IComponent[]

Returns
Entity

GetEntity(int)

public Entity GetEntity(int id)

Parameters
id int

Returns
Entity

GetUniqueEntity()

public Entity GetUniqueEntity()

Returns
Entity

TryGetEntity(int)

public Entity TryGetEntity(int id)

Parameters
id int

Returns
Entity

TryGetUniqueEntity()

public Entity TryGetUniqueEntity()

Returns
Entity

GetAllEntities()

public ImmutableArray<T> GetAllEntities()

Returns
ImmutableArray<T>

GetEntitiesWith(ContextAccessorFilter, Type[])

public ImmutableArray<T> GetEntitiesWith(ContextAccessorFilter filter, Type[] components)

Parameters
filter ContextAccessorFilter
components Type[]

Returns
ImmutableArray<T>

GetEntitiesWith(Type[])

public ImmutableArray<T> GetEntitiesWith(Type[] components)

Parameters
components Type[]

Returns
ImmutableArray<T>

GetUnique()

public T GetUnique()

Returns
T

TryGetUnique()

public T? TryGetUnique()

Returns
T?

Dispose()

public virtual void Dispose()

Pause()

public virtual void Pause()

Resume()

public virtual void Resume()

ActivateAllSystems()

public void ActivateAllSystems()

DeactivateAllSystems(Type[])

public void DeactivateAllSystems(Type[] skip)

Parameters
skip Type[]

Draw(RenderContext)

public void Draw(RenderContext render)

Parameters
render RenderContext

DrawGui(RenderContext)

public void DrawGui(RenderContext render)

Parameters
render RenderContext

Exit()

public void Exit()

FixedUpdate()

public void FixedUpdate()

PreDraw()

public void PreDraw()

Start()

public void Start()

Update()

public void Update()