wallColor() public method

public wallColor ( ) : byte
return byte
Example #1
0
        public static void WallFrame(int i, int j, bool resetFrame = false)
        {
            if (i <= 0 || j <= 0 || i >= Main.maxTilesX - 1 || j >= Main.maxTilesY - 1 || Main.tile[i, j] == null)
            {
                return;
            }
            Tile tile = Main.tile[i, j];

            if (tile.wall == 0)
            {
                tile.wallColor(0);
                return;
            }
            int  num   = 0;
            Tile tile2 = Main.tile[i, j - 1];

            if (tile2 != null && tile2.wall > 0)
            {
                num = 1;
            }
            tile2 = Main.tile[i - 1, j];
            if (tile2 != null && tile2.wall > 0)
            {
                num |= 2;
            }
            tile2 = Main.tile[i + 1, j];
            if (tile2 != null && tile2.wall > 0)
            {
                num |= 4;
            }
            tile2 = Main.tile[i, j + 1];
            if (tile2 != null && tile2.wall > 0)
            {
                num |= 8;
            }
            int num2;

            if (Main.wallLargeFrames[(int)tile.wall] == 1)
            {
                num2 = Framing.largeTileFrameNumberLookup[j % 4][i % 3] - 1;
                tile.wallFrameNumber((byte)num2);
            }
            else if (resetFrame)
            {
                num2 = WorldGen.genRand.Next(0, 3);
                tile.wallFrameNumber((byte)num2);
            }
            else
            {
                num2 = (int)tile.wallFrameNumber();
            }
            if (num == 15)
            {
                num += Framing.centerWallFrameLookup[i % 3][j % 3];
            }
            Point16 point = Framing.wallFrameLookup[num][num2];

            tile.wallFrameX((int)point.x);
            tile.wallFrameY((int)point.y);
        }
Example #2
0
 public bool isTheSameAs(Tile compTile)
 {
     if (compTile == null || (int)this.sTileHeader != (int)compTile.sTileHeader || this.active() && ((int)this.type != (int)compTile.type || Main.tileFrameImportant[(int)this.type] && ((int)this.frameX != (int)compTile.frameX || (int)this.frameY != (int)compTile.frameY)) || ((int)this.wall != (int)compTile.wall || (int)this.liquid != (int)compTile.liquid))
     {
         return(false);
     }
     if ((int)compTile.liquid == 0)
     {
         if ((int)this.wallColor() != (int)compTile.wallColor() || this.wire4() != compTile.wire4())
         {
             return(false);
         }
     }
     else if ((int)this.bTileHeader != (int)compTile.bTileHeader)
     {
         return(false);
     }
     return(true);
 }
Example #3
0
 public bool isTheSameAs(Tile compTile)
 {
     if (compTile == null)
     {
         return(false);
     }
     if (sTileHeader != compTile.sTileHeader)
     {
         return(false);
     }
     if (active())
     {
         if (type != compTile.type)
         {
             return(false);
         }
         if (Main.tileFrameImportant[type] && (frameX != compTile.frameX || frameY != compTile.frameY))
         {
             return(false);
         }
     }
     if (wall != compTile.wall || liquid != compTile.liquid)
     {
         return(false);
     }
     if (compTile.liquid == 0)
     {
         if (wallColor() != compTile.wallColor())
         {
             return(false);
         }
         if (wire4() != compTile.wire4())
         {
             return(false);
         }
     }
     else if (bTileHeader != compTile.bTileHeader)
     {
         return(false);
     }
     return(true);
 }
Example #4
0
 public bool isTheSameAs(Tile compTile)
 {
     if (compTile == null)
     {
         return(false);
     }
     if (this.active() != compTile.active())
     {
         return(false);
     }
     if (this.active())
     {
         if (this.type != compTile.type)
         {
             return(false);
         }
         if (Main.tileFrameImportant[(int)this.type])
         {
             if (this.frameX != compTile.frameX)
             {
                 return(false);
             }
             if (this.frameY != compTile.frameY)
             {
                 return(false);
             }
         }
     }
     return(this.wall == compTile.wall && this.liquid == compTile.liquid && this.lava() == compTile.lava() && this.honey() == compTile.honey() && this.wire() == compTile.wire() && this.wire2() == compTile.wire2() && this.wire3() == compTile.wire3() && this.halfBrick() == compTile.halfBrick() && this.actuator() == compTile.actuator() && this.inActive() == compTile.inActive() && this.wallColor() == compTile.wallColor() && this.color() == compTile.color() && this.slope() == compTile.slope());
 }
Example #5
0
        public static void WallFrame(int i, int j, bool resetFrame = false)
        {
            if (WorldGen.SkipFramingBecauseOfGen || i <= 0 || j <= 0 || i >= Main.maxTilesX - 1 || j >= Main.maxTilesY - 1 || Main.tile[i, j] == null)
            {
                return;
            }
            WorldGen.UpdateMapTile(i, j);
            Tile tile = Main.tile[i, j];

            if (tile.wall == 0)
            {
                tile.wallColor(0);
                return;
            }
            int  num   = 0;
            Tile tile2 = Main.tile[i, j - 1];

            if (tile2 != null && (tile2.wall > 0 || (tile2.active() && tile2.type == 54)))
            {
                num = 1;
            }
            tile2 = Main.tile[i - 1, j];
            if (tile2 != null && (tile2.wall > 0 || (tile2.active() && tile2.type == 54)))
            {
                num |= 2;
            }
            tile2 = Main.tile[i + 1, j];
            if (tile2 != null && (tile2.wall > 0 || (tile2.active() && tile2.type == 54)))
            {
                num |= 4;
            }
            tile2 = Main.tile[i, j + 1];
            if (tile2 != null && (tile2.wall > 0 || (tile2.active() && tile2.type == 54)))
            {
                num |= 8;
            }
            int num2 = 0;

            if (Main.wallLargeFrames[tile.wall] == 1)
            {
                num2 = phlebasTileFrameNumberLookup[j % 4][i % 3] - 1;
                tile.wallFrameNumber((byte)num2);
            }
            else if (Main.wallLargeFrames[tile.wall] == 2)
            {
                num2 = lazureTileFrameNumberLookup[i % 2][j % 2] - 1;
                tile.wallFrameNumber((byte)num2);
            }
            else if (resetFrame)
            {
                num2 = WorldGen.genRand.Next(0, 3);
                if (tile.wall == 21 && WorldGen.genRand.Next(2) == 0)
                {
                    num2 = 2;
                }
                tile.wallFrameNumber((byte)num2);
            }
            else
            {
                num2 = tile.wallFrameNumber();
            }
            if (num == 15)
            {
                num += centerWallFrameLookup[i % 3][j % 3];
            }
            Point16 point = wallFrameLookup[num][num2];

            tile.wallFrameX(point.X);
            tile.wallFrameY(point.Y);
        }
Example #6
0
        public static void WallFrame(int i, int j, bool resetFrame = false)
        {
            if (i <= 0 || j <= 0 || (i >= Main.maxTilesX - 1 || j >= Main.maxTilesY - 1) || Main.tile[i, j] == null)
            {
                return;
            }
            WorldGen.UpdateMapTile(i, j, true);
            Tile tile1 = Main.tile[i, j];

            if ((int)tile1.wall == 0)
            {
                tile1.wallColor((byte)0);
            }
            else
            {
                int  index1 = 0;
                Tile tile2  = Main.tile[i, j - 1];
                if (tile2 != null && ((int)tile2.wall > 0 || tile2.active() && (int)tile2.type == 54))
                {
                    index1 = 1;
                }
                Tile tile3 = Main.tile[i - 1, j];
                if (tile3 != null && ((int)tile3.wall > 0 || tile3.active() && (int)tile3.type == 54))
                {
                    index1 |= 2;
                }
                Tile tile4 = Main.tile[i + 1, j];
                if (tile4 != null && ((int)tile4.wall > 0 || tile4.active() && (int)tile4.type == 54))
                {
                    index1 |= 4;
                }
                Tile tile5 = Main.tile[i, j + 1];
                if (tile5 != null && ((int)tile5.wall > 0 || tile5.active() && (int)tile5.type == 54))
                {
                    index1 |= 8;
                }
                int index2;
                if ((int)Main.wallLargeFrames[(int)tile1.wall] == 1)
                {
                    index2 = Framing.phlebasTileFrameNumberLookup[j % 4][i % 3] - 1;
                    tile1.wallFrameNumber((byte)index2);
                }
                else if ((int)Main.wallLargeFrames[(int)tile1.wall] == 2)
                {
                    index2 = Framing.lazureTileFrameNumberLookup[i % 2][j % 2] - 1;
                    tile1.wallFrameNumber((byte)index2);
                }
                else if (resetFrame)
                {
                    index2 = WorldGen.genRand.Next(0, 3);
                    tile1.wallFrameNumber((byte)index2);
                }
                else
                {
                    index2 = (int)tile1.wallFrameNumber();
                }
                if (index1 == 15)
                {
                    index1 += Framing.centerWallFrameLookup[i % 3][j % 3];
                }
                Point16 point16 = Framing.wallFrameLookup[index1][index2];
                tile1.wallFrameX((int)point16.X);
                tile1.wallFrameY((int)point16.Y);
            }
        }
Example #7
0
 public bool isTheSameAs(Tile compTile)
 {
     if (compTile == null)
     {
         return false;
     }
     if (this.active() != compTile.active())
     {
         return false;
     }
     if (this.active())
     {
         if (this.type != compTile.type)
         {
             return false;
         }
         if (Main.tileFrameImportant[(int)this.type])
         {
             if (this.frameX != compTile.frameX)
             {
                 return false;
             }
             if (this.frameY != compTile.frameY)
             {
                 return false;
             }
         }
     }
     if (this.wall != compTile.wall)
     {
         return false;
     }
     if (this.liquid != compTile.liquid)
     {
         return false;
     }
     if (this.liquid > 0)
     {
         if (this.lava() != compTile.lava())
         {
             return false;
         }
         if (this.honey() != compTile.honey())
         {
             return false;
         }
     }
     return this.wire() == compTile.wire() && this.wire2() == compTile.wire2() && this.wire3() == compTile.wire3() && this.halfBrick() == compTile.halfBrick() && this.actuator() == compTile.actuator() && this.inActive() == compTile.inActive() && this.wallColor() == compTile.wallColor() && this.color() == compTile.color() && this.slope() == compTile.slope();
 }
Example #8
0
		public bool isTheSameAs(Tile compTile)
		{
			if (compTile == null)
			{
				return false;
			}
			if (this.sTileHeader != compTile.sTileHeader)
			{
				return false;
			}
			if (this.active())
			{
				if (this.type != compTile.type)
				{
					return false;
				}
				if (Main.tileFrameImportant[(int)this.type] && (this.frameX != compTile.frameX || this.frameY != compTile.frameY))
				{
					return false;
				}
			}
			if (this.wall != compTile.wall || this.liquid != compTile.liquid)
			{
				return false;
			}
			if (compTile.liquid == 0)
			{
				if (this.wallColor() != compTile.wallColor())
				{
					return false;
				}
			}
			else if (this.bTileHeader != compTile.bTileHeader)
			{
				return false;
			}
			return true;
		}
Example #9
0
        public static void WallFrame(int i, int j, bool resetFrame = false)
        {
            if (i <= 0 || j <= 0 || i >= Main.maxTilesX - 1 || j >= Main.maxTilesY - 1 || Main.tile[i, j] == null)
            {
                return;
            }
            WorldGen.UpdateMapTile(i, j, true);
            Tile tile = Main.tile[i, j];

            if (tile.wall == WallID.None)
            {
                tile.wallColor(0);
                return;
            }
            int  num   = 0;
            Tile tile1 = Main.tile[i, j - 1];

            if (tile1 != null && (tile1.wall > 0 || tile1.active() && tile1.type == 54))
            {
                num = 1;
            }
            tile1 = Main.tile[i - 1, j];
            if (tile1 != null && (tile1.wall > 0 || tile1.active() && tile1.type == 54))
            {
                num = num | 2;
            }
            tile1 = Main.tile[i + 1, j];
            if (tile1 != null && (tile1.wall > 0 || tile1.active() && tile1.type == 54))
            {
                num = num | 4;
            }
            tile1 = Main.tile[i, j + 1];
            if (tile1 != null && (tile1.wall > 0 || tile1.active() && tile1.type == 54))
            {
                num = num | 8;
            }
            int num1 = 0;

            if (Main.wallLargeFrames[tile.wall] == 1)
            {
                num1 = Framing.phlebasTileFrameNumberLookup[j % 4][i % 3] - 1;
                tile.wallFrameNumber((byte)num1);
            }
            else if (Main.wallLargeFrames[tile.wall] == 2)
            {
                num1 = Framing.lazureTileFrameNumberLookup[i % 2][j % 2] - 1;
                tile.wallFrameNumber((byte)num1);
            }
            else if (!resetFrame)
            {
                num1 = tile.wallFrameNumber();
            }
            else
            {
                num1 = WorldGen.genRand.Next(0, 3);
                tile.wallFrameNumber((byte)num1);
            }
            if (num == 15)
            {
                num = num + Framing.centerWallFrameLookup[i % 3][j % 3];
            }
            Point16 point16 = Framing.wallFrameLookup[num][num1];

            tile.wallFrameX(point16.X);
            tile.wallFrameY(point16.Y);
        }
Example #10
0
 public static bool validateWorld(string validatePath)
 {
     Stopwatch stopwatch = new Stopwatch();
     stopwatch.Start();
     if (WorldGen.genRand == null)
     {
         WorldGen.genRand = new Random((int)DateTime.Now.Ticks);
     }
     bool result;
     using (FileStream fileStream = new FileStream(validatePath, FileMode.Open))
     {
         using (BinaryReader binaryReader = new BinaryReader(fileStream))
         {
             try
             {
                 int num = binaryReader.ReadInt32();
                 if (num > Main.curRelease)
                 {
                     try
                     {
                         binaryReader.Close();
                         fileStream.Close();
                     }
                     catch
                     {
                     }
                     result = false;
                 }
                 else
                 {
                     string b = binaryReader.ReadString();
                     int num2 = binaryReader.ReadInt32();
                     binaryReader.ReadInt32();
                     binaryReader.ReadInt32();
                     binaryReader.ReadInt32();
                     binaryReader.ReadInt32();
                     int num3 = binaryReader.ReadInt32();
                     int num4 = binaryReader.ReadInt32();
                     if (num >= 63)
                     {
                         binaryReader.ReadByte();
                     }
                     if (num >= 44)
                     {
                         binaryReader.ReadInt32();
                         binaryReader.ReadInt32();
                         binaryReader.ReadInt32();
                         binaryReader.ReadInt32();
                         binaryReader.ReadInt32();
                         binaryReader.ReadInt32();
                         binaryReader.ReadInt32();
                     }
                     if (num >= 60)
                     {
                         binaryReader.ReadInt32();
                         binaryReader.ReadInt32();
                         binaryReader.ReadInt32();
                         binaryReader.ReadInt32();
                         binaryReader.ReadInt32();
                         binaryReader.ReadInt32();
                         binaryReader.ReadInt32();
                         binaryReader.ReadInt32();
                         if (num >= 61)
                         {
                             binaryReader.ReadInt32();
                             binaryReader.ReadInt32();
                         }
                     }
                     binaryReader.ReadInt32();
                     binaryReader.ReadInt32();
                     binaryReader.ReadDouble();
                     binaryReader.ReadDouble();
                     binaryReader.ReadDouble();
                     binaryReader.ReadBoolean();
                     binaryReader.ReadInt32();
                     binaryReader.ReadBoolean();
                     if (num >= 70)
                     {
                         binaryReader.ReadBoolean();
                     }
                     binaryReader.ReadInt32();
                     binaryReader.ReadInt32();
                     if (num >= 56)
                     {
                         binaryReader.ReadBoolean();
                     }
                     binaryReader.ReadBoolean();
                     binaryReader.ReadBoolean();
                     binaryReader.ReadBoolean();
                     if (num >= 66)
                     {
                         binaryReader.ReadBoolean();
                     }
                     if (num >= 44)
                     {
                         binaryReader.ReadBoolean();
                         binaryReader.ReadBoolean();
                         binaryReader.ReadBoolean();
                         binaryReader.ReadBoolean();
                     }
                     if (num >= 64)
                     {
                         binaryReader.ReadBoolean();
                         binaryReader.ReadBoolean();
                     }
                     if (num >= 29)
                     {
                         binaryReader.ReadBoolean();
                         binaryReader.ReadBoolean();
                         if (num >= 34)
                         {
                             binaryReader.ReadBoolean();
                         }
                         binaryReader.ReadBoolean();
                     }
                     if (num >= 32)
                     {
                         binaryReader.ReadBoolean();
                     }
                     if (num >= 37)
                     {
                         binaryReader.ReadBoolean();
                     }
                     if (num >= 56)
                     {
                         binaryReader.ReadBoolean();
                     }
                     binaryReader.ReadBoolean();
                     binaryReader.ReadBoolean();
                     binaryReader.ReadByte();
                     if (num >= 23)
                     {
                         binaryReader.ReadInt32();
                         binaryReader.ReadBoolean();
                     }
                     binaryReader.ReadInt32();
                     binaryReader.ReadInt32();
                     binaryReader.ReadInt32();
                     binaryReader.ReadDouble();
                     if (num >= 53)
                     {
                         binaryReader.ReadBoolean();
                         binaryReader.ReadInt32();
                         binaryReader.ReadSingle();
                     }
                     if (num >= 54)
                     {
                         binaryReader.ReadInt32();
                         binaryReader.ReadInt32();
                         binaryReader.ReadInt32();
                     }
                     if (num >= 55)
                     {
                         binaryReader.ReadByte();
                         binaryReader.ReadByte();
                         binaryReader.ReadByte();
                     }
                     if (num >= 60)
                     {
                         binaryReader.ReadByte();
                         binaryReader.ReadByte();
                         binaryReader.ReadByte();
                         binaryReader.ReadByte();
                         binaryReader.ReadByte();
                     }
                     if (num >= 60)
                     {
                         binaryReader.ReadInt32();
                     }
                     if (num >= 62)
                     {
                         binaryReader.ReadInt16();
                         binaryReader.ReadSingle();
                     }
                     for (int i = 0; i < num4; i++)
                     {
                         float num5 = (float)i / (float)Main.maxTilesX;
                         Main.statusText = string.Concat(new object[]
                         {
                             Lang.gen[73],
                             " ",
                             (int)(num5 * 100f + 1f),
                             "%"
                         });
                         for (int j = 0; j < num3; j++)
                         {
                             Tile tile = new Tile();
                             tile.active(binaryReader.ReadBoolean());
                             if (tile.active())
                             {
                                 tile.type = binaryReader.ReadByte();
                                 if (tile.type == 127)
                                 {
                                     tile.active(false);
                                 }
                                 if (num < 72 && (tile.type == 35 || tile.type == 36 || tile.type == 170 || tile.type == 171 || tile.type == 172))
                                 {
                                     tile.frameX = binaryReader.ReadInt16();
                                     tile.frameY = binaryReader.ReadInt16();
                                 }
                                 else if (Main.tileFrameImportant[(int)tile.type])
                                 {
                                     if (num < 28 && tile.type == 4)
                                     {
                                         tile.frameX = 0;
                                         tile.frameY = 0;
                                     }
                                     else if (num < 40 && tile.type == 19)
                                     {
                                         tile.frameX = 0;
                                         tile.frameY = 0;
                                     }
                                     else
                                     {
                                         tile.frameX = binaryReader.ReadInt16();
                                         tile.frameY = binaryReader.ReadInt16();
                                         if (tile.type == 144)
                                         {
                                             tile.frameY = 0;
                                         }
                                     }
                                 }
                                 else
                                 {
                                     tile.frameX = -1;
                                     tile.frameY = -1;
                                 }
                                 if (num >= 48 && binaryReader.ReadBoolean())
                                 {
                                     tile.color(binaryReader.ReadByte());
                                 }
                             }
                             if (num <= 25)
                             {
                                 binaryReader.ReadBoolean();
                             }
                             if (binaryReader.ReadBoolean())
                             {
                                 tile.wall = binaryReader.ReadByte();
                                 if (num >= 48 && binaryReader.ReadBoolean())
                                 {
                                     tile.wallColor(binaryReader.ReadByte());
                                 }
                             }
                             if (binaryReader.ReadBoolean())
                             {
                                 tile.liquid = binaryReader.ReadByte();
                                 tile.lava(binaryReader.ReadBoolean());
                                 if (num >= 51)
                                 {
                                     tile.honey(binaryReader.ReadBoolean());
                                 }
                             }
                             if (num >= 33)
                             {
                                 tile.wire(binaryReader.ReadBoolean());
                             }
                             if (num >= 43)
                             {
                                 tile.wire2(binaryReader.ReadBoolean());
                                 tile.wire3(binaryReader.ReadBoolean());
                             }
                             if (num >= 41)
                             {
                                 tile.halfBrick(binaryReader.ReadBoolean());
                                 if (!Main.tileSolid[(int)tile.type])
                                 {
                                     tile.halfBrick(false);
                                 }
                                 if (num >= 49)
                                 {
                                     tile.slope(binaryReader.ReadByte());
                                     if (!Main.tileSolid[(int)tile.type])
                                     {
                                         tile.slope(0);
                                     }
                                 }
                             }
                             if (num >= 42)
                             {
                                 tile.actuator(binaryReader.ReadBoolean());
                                 tile.inActive(binaryReader.ReadBoolean());
                             }
                             if (num >= 25)
                             {
                                 int num6 = (int)binaryReader.ReadInt16();
                                 j += num6;
                             }
                         }
                     }
                     int num7 = 40;
                     if (num < 58)
                     {
                         num7 = 20;
                     }
                     for (int k = 0; k < 1000; k++)
                     {
                         if (binaryReader.ReadBoolean())
                         {
                             binaryReader.ReadInt32();
                             binaryReader.ReadInt32();
                             for (int l = 0; l < 40; l++)
                             {
                                 if (l < num7)
                                 {
                                     int num8;
                                     if (num >= 59)
                                     {
                                         num8 = (int)binaryReader.ReadInt16();
                                     }
                                     else
                                     {
                                         num8 = (int)binaryReader.ReadByte();
                                     }
                                     if (num8 > 0)
                                     {
                                         if (num >= 38)
                                         {
                                             binaryReader.ReadInt32();
                                         }
                                         else
                                         {
                                             binaryReader.ReadString();
                                         }
                                         binaryReader.ReadByte();
                                     }
                                 }
                             }
                         }
                     }
                     for (int m = 0; m < 1000; m++)
                     {
                         if (binaryReader.ReadBoolean())
                         {
                             binaryReader.ReadString();
                             binaryReader.ReadInt32();
                             binaryReader.ReadInt32();
                         }
                     }
                     bool flag = binaryReader.ReadBoolean();
                     int num9 = 0;
                     while (flag)
                     {
                         binaryReader.ReadString();
                         binaryReader.ReadSingle();
                         binaryReader.ReadSingle();
                         binaryReader.ReadBoolean();
                         binaryReader.ReadInt32();
                         binaryReader.ReadInt32();
                         flag = binaryReader.ReadBoolean();
                         num9++;
                     }
                     if (num >= 31)
                     {
                         binaryReader.ReadString();
                         binaryReader.ReadString();
                         binaryReader.ReadString();
                         binaryReader.ReadString();
                         binaryReader.ReadString();
                         binaryReader.ReadString();
                         binaryReader.ReadString();
                         binaryReader.ReadString();
                         binaryReader.ReadString();
                         if (num >= 35)
                         {
                             binaryReader.ReadString();
                             if (num >= 65)
                             {
                                 binaryReader.ReadString();
                                 binaryReader.ReadString();
                                 binaryReader.ReadString();
                                 binaryReader.ReadString();
                                 binaryReader.ReadString();
                                 binaryReader.ReadString();
                                 binaryReader.ReadString();
                                 binaryReader.ReadString();
                             }
                         }
                     }
                     if (num >= 7)
                     {
                         bool flag2 = binaryReader.ReadBoolean();
                         string text = binaryReader.ReadString();
                         int num10 = binaryReader.ReadInt32();
                         if (!flag2 || (!(text == b) && num10 != num2))
                         {
                             binaryReader.Close();
                             fileStream.Close();
                             result = false;
                             return result;
                         }
                     }
                     binaryReader.Close();
                     fileStream.Close();
                     result = true;
                 }
             }
             catch
             {
                 try
                 {
                     binaryReader.Close();
                     fileStream.Close();
                 }
                 catch
                 {
                 }
                 result = false;
             }
         }
     }
     return result;
 }
Example #11
0
        public bool isTheSameAs(Tile compTile)
        {
            if (compTile == null || (int)this.sTileHeader != (int)compTile.sTileHeader || this.active() && ((int)this.type != (int)compTile.type || Main.tileFrameImportant[(int)this.type] && ((int)this.frameX != (int)compTile.frameX || (int)this.frameY != (int)compTile.frameY)) || ((int)this.wall != (int)compTile.wall || (int)this.liquid != (int)compTile.liquid))
                return false;
			if (k_wireFlags != compTile.k_wireFlags)
				return false;
			if ((int)compTile.liquid == 0)
            {
                if ((int)this.wallColor() != (int)compTile.wallColor())
                    return false;
            }
            else if ((int)this.bTileHeader != (int)compTile.bTileHeader)
                return false;
            return true;
        }
        private void Tile(Tile tile)
        {
            byte flags = 0;

            var active = tile.active();
            var wall = tile.wall;
            var liquid = tile.liquid;

            if (active) flags += 1;
            //if (tile.Lighted)    flags += 2; //UNUSED
            if (wall > 0) flags += 4;
            if (liquid > 0) flags += 8;
            if (tile.wire()) flags += 16;
            if (tile.halfBrick()) flags += 32;
            if (tile.actuator()) flags += 64;
            if (tile.inActive()) flags += 128;

            Byte(flags);

            byte tileColour = 0, wallColour = 0;
            flags = 0;
            if (tile.wire2()) flags += 1;
            if (tile.wire3()) flags += 2;
            if (tile.active() && tile.color() > 0)
            {
                flags += 4;
                tileColour = tile.color();
            }
            if (tile.wall > 0 && tile.wallColor() > 0)
            {
                flags += 8;
                wallColour = tile.wallColor();
            }
            Byte(flags + (byte)(tile.slope() << 4));

            if (tileColour > 0) Byte(tileColour);
            if (wallColour > 0) Byte(wallColour);

            if (tile.active())
            {
                UShort(tile.type);
                if (Main.tileFrameImportant[(int)tile.type])
                {
                    Short(tile.frameX);
                    Short(tile.frameY);
                }
            }
            if (tile.wall > 0) Byte(tile.wall);

            if (tile.liquid > 0)
            {
                Byte(tile.liquid);
                Byte(tile.liquidType());
            }
        }