Table of Contents

Class ContentRegistry

Namespace
TileWorld.Engine.Content.Registry
Assembly
TileWorld.Engine.dll

Stores tile definitions that are available to the runtime and rendering systems.

public sealed class ContentRegistry
Inheritance
ContentRegistry
Inherited Members

Constructors

ContentRegistry()

Creates a registry and seeds it with the built-in air tile definition.

public ContentRegistry()

Methods

EnumerateItemDefs()

Enumerates all registered item definitions.

public IEnumerable<ItemDef> EnumerateItemDefs()

Returns

IEnumerable<ItemDef>

An enumeration of all registered item definitions.

EnumerateObjectDefs()

Enumerates all registered object definitions.

public IEnumerable<ObjectDef> EnumerateObjectDefs()

Returns

IEnumerable<ObjectDef>

An enumeration of all registered object definitions.

EnumerateTileDefs()

Enumerates all registered tile definitions.

public IEnumerable<TileDef> EnumerateTileDefs()

Returns

IEnumerable<TileDef>

An enumeration of all registered tile definitions.

EnumerateWallDefs()

Enumerates all registered wall definitions.

public IEnumerable<WallDef> EnumerateWallDefs()

Returns

IEnumerable<WallDef>

An enumeration of all registered wall definitions.

GetItemDef(int)

Resolves an item definition or throws when the identifier is unknown.

public ItemDef GetItemDef(int id)

Parameters

id int

The numeric item identifier.

Returns

ItemDef

The registered item definition.

GetObjectDef(int)

Resolves an object definition or throws when the identifier is unknown.

public ObjectDef GetObjectDef(int id)

Parameters

id int

The numeric object identifier.

Returns

ObjectDef

The registered object definition.

GetTileDef(ushort)

Resolves a tile definition or throws when the identifier is unknown.

public TileDef GetTileDef(ushort id)

Parameters

id ushort

The numeric tile identifier.

Returns

TileDef

The registered tile definition.

GetWallDef(ushort)

Resolves a wall definition or throws when the identifier is unknown.

public WallDef GetWallDef(ushort id)

Parameters

id ushort

The numeric wall identifier.

Returns

WallDef

The registered wall definition.

HasItemDef(int)

Returns true when the supplied item identifier is registered.

public bool HasItemDef(int id)

Parameters

id int

The numeric item identifier.

Returns

bool

true when the identifier is registered.

HasObjectDef(int)

Returns true when the supplied object identifier is registered.

public bool HasObjectDef(int id)

Parameters

id int

The numeric object identifier.

Returns

bool

true when the identifier is registered.

HasTileDef(ushort)

Returns true when the identifier is registered.

public bool HasTileDef(ushort id)

Parameters

id ushort

The numeric tile identifier.

Returns

bool

true when the identifier is registered.

HasWallDef(ushort)

Returns true when the supplied wall identifier is registered.

public bool HasWallDef(ushort id)

Parameters

id ushort

The numeric wall identifier.

Returns

bool

true when the identifier is registered.

RegisterItem(ItemDef)

Registers an item definition by its numeric identifier.

public void RegisterItem(ItemDef itemDef)

Parameters

itemDef ItemDef

The item definition to register.

RegisterObject(ObjectDef)

Registers an object definition by its numeric identifier.

public void RegisterObject(ObjectDef objectDef)

Parameters

objectDef ObjectDef

The object definition to register.

RegisterTile(TileDef)

Registers a tile definition by its numeric identifier.

public void RegisterTile(TileDef tileDef)

Parameters

tileDef TileDef

The tile definition to register.

RegisterWall(WallDef)

Registers a wall definition by its numeric identifier.

public void RegisterWall(WallDef wallDef)

Parameters

wallDef WallDef

The wall definition to register.

TryGetItemDef(int, out ItemDef)

Attempts to resolve an item definition for the supplied identifier.

public bool TryGetItemDef(int id, out ItemDef itemDef)

Parameters

id int

The numeric item identifier.

itemDef ItemDef

The resolved item definition when the lookup succeeds.

Returns

bool

true when the identifier is registered.

TryGetObjectDef(int, out ObjectDef)

Attempts to resolve an object definition for the supplied identifier.

public bool TryGetObjectDef(int id, out ObjectDef objectDef)

Parameters

id int

The numeric object identifier.

objectDef ObjectDef

The resolved object definition when the lookup succeeds.

Returns

bool

true when the identifier is registered.

TryGetTileDef(ushort, out TileDef)

Attempts to resolve a tile definition for the supplied identifier.

public bool TryGetTileDef(ushort id, out TileDef tileDef)

Parameters

id ushort

The numeric tile identifier.

tileDef TileDef

The resolved tile definition when the lookup succeeds.

Returns

bool

true when the identifier is registered.

TryGetWallDef(ushort, out WallDef)

Attempts to resolve a wall definition for the supplied identifier.

public bool TryGetWallDef(ushort id, out WallDef wallDef)

Parameters

id ushort

The numeric wall identifier.

wallDef WallDef

The resolved wall definition when the lookup succeeds.

Returns

bool

true when the identifier is registered.