Exemplo n.º 1
0
    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);
    }
Exemplo n.º 2
0
    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);
    }
Exemplo n.º 4
0
 public GameObject GetPrefab(DungeonEntityType entityType)
 {
     return(entitiesDictionary[entityType]);
 }