forked from mirrors/NBTExplorer
Added enumerator to Entity/TileEntity factories
This commit is contained in:
parent
432d87ac4f
commit
e87a8e0bd3
2 changed files with 26 additions and 0 deletions
|
@ -77,6 +77,19 @@ namespace Substrate
|
||||||
_registry[id] = subtype;
|
_registry[id] = subtype;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets an enumerator over all registered Entities.
|
||||||
|
/// </summary>
|
||||||
|
public static IEnumerable<KeyValuePair<string, Type>> RegisteredEntities
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
foreach (KeyValuePair<string, Type> kvp in _registry) {
|
||||||
|
yield return kvp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static EntityFactory ()
|
static EntityFactory ()
|
||||||
{
|
{
|
||||||
_registry[EntityArrow.TypeId] = typeof(EntityArrow);
|
_registry[EntityArrow.TypeId] = typeof(EntityArrow);
|
||||||
|
|
|
@ -75,6 +75,19 @@ namespace Substrate
|
||||||
_registry[id] = subtype;
|
_registry[id] = subtype;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets an enumerator over all registered TileEntities.
|
||||||
|
/// </summary>
|
||||||
|
public static IEnumerable<KeyValuePair<string, Type>> RegisteredTileEntities
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
foreach (KeyValuePair<string, Type> kvp in _registry) {
|
||||||
|
yield return kvp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static TileEntityFactory ()
|
static TileEntityFactory ()
|
||||||
{
|
{
|
||||||
_registry[TileEntityEndPortal.TypeId] = typeof(TileEntityEndPortal);
|
_registry[TileEntityEndPortal.TypeId] = typeof(TileEntityEndPortal);
|
||||||
|
|
Loading…
Reference in a new issue