//public int AnimID { get; set; } internal StaticTile(InternalStaticTile staticTile) { this.Flags = staticTile.Flags; this.Weight = staticTile.Weight; this.Quantity = staticTile.Quantity; this.ID = staticTile.ID; //this.AnimID = staticTile.AnimID; this.Name = staticTile.Name; }
private static void LoadStaticTiles(byte[] data, InternalStaticTile[] staticTiles) { MemoryStream ms = new MemoryStream(data, false); BinaryReader bin = new BinaryReader(ms); if (oldFormat) { int offset = 428032; ms.Seek(offset, SeekOrigin.Begin); for (int i = 0; i < 0x8000; ++i) { if ((i & 0x1F) == 0) { bin.ReadInt32(); // header } staticTiles[i].ID = (ushort)i; staticTiles[i].Flags = (TileFlags)bin.ReadInt32(); staticTiles[i].Weight = bin.ReadByte(); int quality = bin.ReadByte(); bin.ReadInt16(); bin.ReadByte(); staticTiles[i].Quantity = bin.ReadByte(); bin.ReadInt16(); bin.ReadByte(); bin.ReadByte(); bin.ReadInt16(); int height = bin.ReadByte(); staticTiles[i].Name = ASCIIEncoding.ASCII.GetString(bin.ReadBytes(20)).TrimEnd('\0'); } } else { int offset = 493568; ms.Seek(offset, SeekOrigin.Begin); for (int i = 0; i < 0x10000; ++i) { if ((i & 0x1F) == 0) { bin.ReadInt32(); // header } staticTiles[i].ID = (ushort)i; staticTiles[i].Flags = (TileFlags)bin.ReadInt64(); staticTiles[i].Weight = bin.ReadByte(); int quality = bin.ReadByte(); bin.ReadInt16(); bin.ReadByte(); staticTiles[i].Quantity = bin.ReadByte(); bin.ReadInt32(); bin.ReadByte(); int value = bin.ReadByte(); int height = bin.ReadByte(); staticTiles[i].Name = ASCIIEncoding.ASCII.GetString(bin.ReadBytes(20)).TrimEnd('\0'); } } ms.Close(); }