public SWITCH_PANEL()
 {
     blockData = new Rotatable();
 }
Esempio n. 2
0
 public DISPLAY_PANEL()
 {
     blockData = new Rotatable();
 }
Esempio n. 3
0
 public CHAIR()
 {
     blockData = new Rotatable();
 }
Esempio n. 4
0
        public static void LoadVoxelObject(VoxelObject _voxelObject, string _fileName)
        {
            String path = @"external/saves/voxel objects/" + _fileName + ".svo";

            if (File.Exists(path) == true)
            {
                StreamReader file = new StreamReader(path);

                string name = file.ReadLine();

                string   size  = file.ReadLine();
                string[] parts = size.Split(',');
                int      sizeX = int.Parse(parts[0]);
                int      sizeY = int.Parse(parts[1]);
                int      sizeZ = int.Parse(parts[2]);

                _voxelObject.setName(name);
                _voxelObject.chunkSizeX = sizeX;
                _voxelObject.chunkSizeY = sizeY;
                _voxelObject.chunkSizeZ = sizeZ;
                _voxelObject.Reset();

                while (file.EndOfStream == false)
                {
                    Voxel voxel     = Voxel.VOID;
                    Block thisBlock = null;
                    int   posX      = 0;
                    int   posY      = 0;
                    int   posZ      = 0;

                    string   entry    = file.ReadLine();
                    string[] sections = entry.Split('/');
                    for (int i = 0; i < sections.Length; i++)
                    {
                        string[] section = sections[i].Split(':');
                        string   tag     = section[0];
                        string   value   = section[1];

                        if (tag == "v")
                        {
                            voxel     = (Voxel)Enum.Parse(typeof(Voxel), value);
                            thisBlock = voxel.toBlock();
                        }
                        else if (tag == "p")
                        {
                            parts = value.Split(',');
                            posX  = int.Parse(parts[0]);
                            posY  = int.Parse(parts[1]);
                            posZ  = int.Parse(parts[2]);
                        }
                        else if (tag == "r")
                        {
                            Direction facing = (Direction)Enum.Parse(typeof(Direction), value);
                            Rotatable data   = (Rotatable)thisBlock.getBlockData();
                            data.setDirection(facing);
                            thisBlock.setBlockData(data);
                        }
                        else if (tag == "f")
                        {
                            bool      flipped = bool.Parse(value);
                            Flippable data    = (Flippable)thisBlock.getBlockData();
                            data.setFlipped(flipped);
                            thisBlock.setBlockData(data);
                        }
                        else if (tag == "o")
                        {
                            Direction  orientation = (Direction)Enum.Parse(typeof(Direction), value);
                            Orientated data        = (Orientated)thisBlock.getBlockData();
                            data.setOrientation(orientation);
                            thisBlock.setBlockData(data);
                        }
                    }

                    _voxelObject.setBlockAt(posX, posY, posZ, thisBlock);
                }

                file.Close();
            }
        }
 public CONSOLE()
 {
     blockData = new Rotatable();
 }
 public METAL_CRATE()
 {
     blockData = new Rotatable();
 }
Esempio n. 7
0
 public DIAGNOSTIC_PANEL()
 {
     blockData = new Rotatable();
 }
Esempio n. 8
0
 public INTERFACE_PANEL()
 {
     blockData = new Rotatable();
 }