Esempio n. 1
0
        public void TestTerrainDescriptor()
        {
            // Expected results are: Dry flat, dry North edge, dry NWcorner, dry block, dry undefined, partially-
            // submerged and south edge slope, waterfall, hole and east edge slope, undefined undefined
            byte[] descriptorData = new byte[] { 0x0, 0x02, 0x09, 0x0E, 0x0F, 0x24, 0x3E, 0x49, 0xDE };

            for (int i = 0; i < descriptorData.Length; i++)
            {
                TerrainDescriptor td = new TerrainDescriptor(descriptorData[i]);
                Trace.Write("TD " + i + ": ");
                Trace.WriteLine(td);
            }
        }
Esempio n. 2
0
        internal override void ParseSegment(FileStream file)
        {
            base.ParseSegment(file);

            int counter = 0;

            using (MemoryStream ms = new MemoryStream(Data))
            {
                TerrainDescriptor td;
                while (ms.Position < ms.Length)
                {
                    td = new TerrainDescriptor((byte)ms.ReadByte());
                    Terrain[counter % CityMap.TILES_PER_SIDE, counter / (CityMap.TILES_PER_SIDE)] = td;
                    counter++;
                }
            }
        }
Esempio n. 3
0
 public XTER()
     : base("XTER")
 {
     Terrain = new TerrainDescriptor[CityMap.TILES_PER_SIDE, CityMap.TILES_PER_SIDE];
 }