Example #1
0
 public Tile(Tile copy)
 {
     flags = copy.flags;
     tileType = copy.tileType;
     tileFrame = copy.tileFrame;
     wallType = copy.wallType;
     liquidLevel = copy.liquidLevel;
 }
Example #2
0
        private void ReadWorldTiles()
        {
            Boolean theB;
            Byte theI;
            Tile theTile;
            Int32 i, j;

            if (bw != null)
                bw.ReportProgress((Int32)(((Single)progressPosition / stream.Length) * readWorldPerc)
                    , "Reading Tiles");

            tiles = new Tile[MaxX, MaxY];

            for (i = 0; i < MaxX; i++)
            {
                for (j = 0; j < MaxY; j++)
                {
                    theTile = new Tile();

                    theB = reader.ReadBoolean();

                    theTile.Active = theB;
                    if (theB == true)
                    {
                        theI = reader.ReadByte();

                        if (theI > 85)
                            theTile.TileType = theI;

                        theTile.TileType = theI;

                        if (tileImportant[theI] == true)
                        {
                            theTile.Important = true;
                            theTile.Frame = new PointInt16(reader.ReadInt16() ,reader.ReadInt16());
                        }
                        else
                            theTile.Important = false;
                    }

                    theTile.Lighted = reader.ReadBoolean();

                    theB = reader.ReadBoolean();

                    theTile.Wall = theB;
                    if (theB == true)
                        theTile.WallType = reader.ReadByte();

                    if (theTile.WallType == 0 && theTile.Wall == true)
                        theTile.Wall = true;

                    theB = reader.ReadBoolean();
                    theTile.Liquid = theB;

                    if (theB == true)
                    {
                        theTile.LiquidLevel = reader.ReadByte();
                        theTile.Lava = reader.ReadBoolean();
                    }

                    tiles[i, j] = theTile;
                }
                progressPosition = stream.Position;
            }

            posChests = stream.Position;
        }
Example #3
0
            public tileReader(tileReader copy)
            {
                id = nextId;
                nextId++;

                filePos = copy.filePos;

                tileLookup = new TileImportance(copy.tileLookup);
                tile = new Tile(copy.tile);
                tileOrder = new List<Byte>();

                tilesRead = copy.tilesRead;

                foreach (Byte b in copy.tileOrder)
                    tileOrder.Add(b);
            }
Example #4
0
            public tileReader(Int64 fPos)
            {
                id = nextId;
                nextId++;

                filePos = fPos;

                tileLookup = new TileImportance();
                tile = new Tile();
                tileOrder = new List<Byte>();

                tilesRead = 0;
            }