Example #1
0
        public Entity GetEntity(EntityType entityType, long entityId)
        {
            switch (entityType)
            {
            case EntityType.Monster:
                return(Monsters.GetValue(entityId));

            case EntityType.Npc:
                return(Npcs.GetValue(entityId));

            case EntityType.Player:
                return(Players.GetValue(entityId));

            case EntityType.MapObject:
                return(MapObjects.GetValue(entityId));

            default:
                throw new ArgumentOutOfRangeException(nameof(entityType), entityType, "Incorrect entity type");
            }
        }