Exemplo n.º 1
0
        static void Main(string[] args)
        {
            //build a Tank crew within a tank platoon
            Driver  Dan   = new Driver();
            Gunner  John  = new Gunner();
            TankCdr Oscar = new TankCdr();
            Loader  Matt  = new Matt();

            Console.WriteLine("Hello and welcome");
            Console.WriteLine("I'll let the crew introduce themselves");
            Console.WriteLine();

            //Call the crew to talk
            Dan.Talk();
            John.Talk();
            Oscar.Talk();
            Matt.Talk();
        }
            private void _read()
            {
                _chunkId = ((MagicavoxelVox.ChunkType)m_io.ReadU4be());
                _numBytesOfChunkContent   = m_io.ReadU4le();
                _numBytesOfChildrenChunks = m_io.ReadU4le();
                if (NumBytesOfChunkContent != 0)
                {
                    switch (ChunkId)
                    {
                    case MagicavoxelVox.ChunkType.Size: {
                        __raw_chunkContent = m_io.ReadBytes(NumBytesOfChunkContent);
                        var io___raw_chunkContent = new KaitaiStream(__raw_chunkContent);
                        _chunkContent = new Size(io___raw_chunkContent, this, m_root);
                        break;
                    }

                    case MagicavoxelVox.ChunkType.Matt: {
                        __raw_chunkContent = m_io.ReadBytes(NumBytesOfChunkContent);
                        var io___raw_chunkContent = new KaitaiStream(__raw_chunkContent);
                        _chunkContent = new Matt(io___raw_chunkContent, this, m_root);
                        break;
                    }

                    case MagicavoxelVox.ChunkType.Xyzi: {
                        __raw_chunkContent = m_io.ReadBytes(NumBytesOfChunkContent);
                        var io___raw_chunkContent = new KaitaiStream(__raw_chunkContent);
                        _chunkContent = new Xyzi(io___raw_chunkContent, this, m_root);
                        break;
                    }

                    case MagicavoxelVox.ChunkType.Pack: {
                        __raw_chunkContent = m_io.ReadBytes(NumBytesOfChunkContent);
                        var io___raw_chunkContent = new KaitaiStream(__raw_chunkContent);
                        _chunkContent = new Pack(io___raw_chunkContent, this, m_root);
                        break;
                    }

                    case MagicavoxelVox.ChunkType.Rgba: {
                        __raw_chunkContent = m_io.ReadBytes(NumBytesOfChunkContent);
                        var io___raw_chunkContent = new KaitaiStream(__raw_chunkContent);
                        _chunkContent = new Rgba(io___raw_chunkContent, this, m_root);
                        break;
                    }

                    default: {
                        _chunkContent = m_io.ReadBytes(NumBytesOfChunkContent);
                        break;
                    }
                    }
                }
                if (NumBytesOfChildrenChunks != 0)
                {
                    _childrenChunks = new List <Chunk>();
                    {
                        var i = 0;
                        while (!m_io.IsEof)
                        {
                            _childrenChunks.Add(new Chunk(m_io, this, m_root));
                            i++;
                        }
                    }
                }
            }