Added enumerator to Entity/TileEntity factories

This commit is contained in:
Justin Aquadro 2011-11-14 22:04:06 -05:00
parent 432d87ac4f
commit e87a8e0bd3
2 changed files with 26 additions and 0 deletions

View file

@ -77,6 +77,19 @@ namespace Substrate
_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 ()
{
_registry[EntityArrow.TypeId] = typeof(EntityArrow);

View file

@ -75,6 +75,19 @@ namespace Substrate
_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 ()
{
_registry[TileEntityEndPortal.TypeId] = typeof(TileEntityEndPortal);