Пример #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            //NbtFile test = new NbtFile("C:\\Users\\Paul Bruner\\Desktop\\Ol Drive\\alu-new-sixteen-bits.schematic",true);
            // test.LoadFile();

            redBmp = new redstoneBmp();
        }
Пример #2
0
        private void AssertNbtBigFile(NbtFile file)
        {
            // NbtList enities;
            //NbtList tileenities;

            // See TestFiles/bigtest.nbt.txt to see the expected format


            NbtCompound root = file.RootTag;

            if (root.Name == "Schematic")
            {
                redBmp = new redstoneBmp();
                // I don't know why but I keep getting cofused with the height, width, length stuff
                // maybe its because I deal with to many 2d objects.
                rYmax      = root.Query <NbtShort>("/Schematic/Width").Value;
                rZmax      = root.Query <NbtShort>("/Schematic/Height").Value;
                rXmax      = root.Query <NbtShort>("/Schematic/Length").Value;
                rMaterials = root.Query <NbtString>("/Schematic/Materials").Value;
                rBlocks    = root.Query <NbtByteArray>("/Schematic/Blocks").Value;
                rData      = root.Query <NbtByteArray>("/Schematic/Data").Value;
                rGrid      = new gBlockTypeStruct[rBlocks.Length];

                // Ok, lets get this link list a starting
                for (int i = 0; i < rBlocks.Length; i++)
                {
                    // Put the normal code here to fill the data for the blocks, and data
                    // skipping for now as its more important to get the link list working
                }

                // Just so I can get a good visual on it going to precaculate the numbers
                int xStride = rXmax;
                int zStride = xStride * rYmax;

                // Precaculate the last line in a floor and the last floor
                int zLast = rData.Length - zStride;
                int yLast = zStride - xStride;

                // Lets try something diffrent and do all bounds checking

                for (int i = 0; i < rBlocks.Length; i++)
                {
                    int z = i / zStride;
                    int y = (i - z * zStride) / xStride;
                    int x = i - (y * xStride) - (z * zStride);
                    rGrid[i]   = redBmp.getSet(rBlocks[i]);
                    rGrid[i].X = x; rGrid[i].Y = y; rGrid[i].Z = z;
                }
            }
        }
Пример #3
0
        private void AssertNbtBigFile(NbtFile file)
        {
            // NbtList enities;
            //NbtList tileenities;

            // See TestFiles/bigtest.nbt.txt to see the expected format

            NbtCompound root = file.RootTag;
            if (root.Name == "Schematic")
            {
                redBmp = new redstoneBmp();
                // I don't know why but I keep getting cofused with the height, width, length stuff
                // maybe its because I deal with to many 2d objects.
                rYmax = root.Query<NbtShort>("/Schematic/Width").Value;
                rZmax = root.Query<NbtShort>("/Schematic/Height").Value;
                rXmax = root.Query<NbtShort>("/Schematic/Length").Value;
                rMaterials = root.Query<NbtString>("/Schematic/Materials").Value;
                rBlocks = root.Query<NbtByteArray>("/Schematic/Blocks").Value;
                rData = root.Query<NbtByteArray>("/Schematic/Data").Value;
                rGrid = new gBlockTypeStruct[rBlocks.Length];

                // Ok, lets get this link list a starting
                for (int i = 0; i < rBlocks.Length; i++)
                {
                    // Put the normal code here to fill the data for the blocks, and data
                    // skipping for now as its more important to get the link list working
                }

                // Just so I can get a good visual on it going to precaculate the numbers
                int xStride = rXmax;
                int zStride = xStride * rYmax;

                // Precaculate the last line in a floor and the last floor
                int zLast = rData.Length - zStride;
                int yLast = zStride - xStride;

                // Lets try something diffrent and do all bounds checking

                for (int i = 0; i < rBlocks.Length; i++)
                {

                    int z =  i/zStride;
                    int y = (i - z * zStride)/xStride;
                    int x = i - (y * xStride) - (z * zStride);
                    rGrid[i] = redBmp.getSet(rBlocks[i]);
                    rGrid[i].X = x; rGrid[i].Y = y; rGrid[i].Z = z;
                }
            }
        }
Пример #4
0
        private void Form1_Load(object sender, EventArgs e)
        {
            NbtFile test = new NbtFile("C:\\Users\\Paul Bruner\\Desktop\\Ol Drive\\alu-new-sixteen-bits.schematic",true);
            test.LoadFile();

            redBmp = new redstoneBmp();
        }