Exemple #1
0
        public static RawSchematicSize LoadRawSize(NbtFile nbtFile)
        {
            RawSchematicSize raw = new RawSchematicSize();
            var rootTag          = nbtFile.RootTag;

            foreach (NbtTag tag in rootTag.Tags)
            {
                switch (tag.Name)
                {
                case "Width":     //Short
                    raw.XMax = tag.IntValue;
                    break;

                case "Height":     //Short
                    raw.YMax = tag.IntValue;
                    break;

                case "Length":     //Short
                    raw.ZMax = tag.IntValue;
                    break;

                default:
                    break;
                }
            }
            return(raw);
        }
Exemple #2
0
        public static bool TryGetSchematicSize(string name, int colonyId, out RawSchematicSize size)
        {
            if (TryGetScematicFilePath(name, colonyId, out var scematic))
            {
                size = LoadRawSize(new NbtFile(scematic));
            }
            else
            {
                size = null;
            }

            return(size != null);
        }