コード例 #1
0
        public Entity GetEntity(EntityType entityType, long entityId)
        {
            switch (entityType)
            {
            case EntityType.NPC:
                return(Npcs.GetValueOrDefault(entityId));

            case EntityType.MONSTER:
                return(Monsters.GetValueOrDefault(entityId));

            case EntityType.PLAYER:
                return(Players.GetValueOrDefault(entityId));

            case EntityType.GROUND_ITEM:
                return(GroundItems.GetValueOrDefault(entityId));

            default:
                throw new InvalidOperationException();
            }
        }