public void AddEntity(DungeonEntityType entityType, int x, int y, DungeonRotation rotation) { //if (!CheckValidPosition(x, y)) // throw new ArgumentException("Invalid entity position in room"); dungeon.AddEntity(entityType, roomPositionX + x, roomPositionY + y, rotation); }
public DungeonEntity AddEntity(DungeonEntityType entityType, int x, int y, DungeonRotation rotation) { DungeonEntity entity = DungeonEntityFactory.CreateEntity(entityType); if (entity == null) { throw new ArgumentException("Unknown entity type " + entityType); } AddEntity(entity, x, y, rotation); return(entity); }
static public DungeonEntity CreateEntity(DungeonEntityType entityType) { switch (entityType) { case DungeonEntityType.Avatar: return(new DungeonEntityAvatar()); case DungeonEntityType.Light: return(new DungeonEntityLight()); } return(null); }
public GameObject GetPrefab(DungeonEntityType entityType) { return(entitiesDictionary[entityType]); }