Exemplo n.º 1
0
        private WorldData GetWorldDataFromId(string entryId, string worldId)
        {
            bool      beta = false;
            WorldType type;

            switch (entryId)
            {
            case "worldhome":
                type = WorldType.HomeWorld;
                break;

            case "betaonlyroom":
                type = WorldType.Massive;
                beta = true;
                break;

            default:
                type = (WorldType)int.Parse(entryId.Substring("world".Length).Split('x')[0]);
                break;
            }

            var size = WorldUtils.GetWorldSize(type);

            var name = this.DatabaseObject.GetObject("myworldnames")?.GetString(worldId, null);

            return(new WorldData(worldId, name, type, size.Width, size.Height, beta));
        }