private void testingggg()
 {
     var mt = new MemTile(1234, 4321);
     mt.liquid = 1;
     var gg = "start";
     if (mt.liquid > 0)
     {
         gg = "middle";
     }
     gg = "end";
     System.Console.WriteLine(gg);
 }
        public static void SetTile(int x, int y, MemTile tile)
        {
            #if MemTile
            if (null == data)
            {
                Prepare(8400, 2400);
            }
//            System.Console.WriteLine(x + ',' + y);
            if (null == Terraria.Main.tile[x, y])
            {
                Terraria.Main.tile[x, y] = new MemTile(x, y);
            }
            else
            {
                Terraria.Main.tile[x, y].x = (short)x;
                Terraria.Main.tile[x, y].y = (short)y;
            }

            if (tile != null)
            {
                data[x, y] = data[tile.x, tile.y];
            }
            #endif
        }
 public bool HasSameSlope(MemTile tile)
 {
     return (data[x, y]._sTileHeader & 29696) == (tile.sTileHeader & 29696);
 }
 public bool isTheSameAs(MemTile compTile)
 {
     //if (compTile == null)
     //{
     //    return false;
     //}
     if (data[x, y]._sTileHeader != compTile.sTileHeader)
     {
         return false;
     }
     if (this.active())
     {
         if (data[x, y]._type != compTile.type)
         {
             return false;
         }
         if (Terraria.Main.tileFrameImportant[(int)data[x, y]._type] && (data[x, y]._frameX != compTile.frameX || data[x, y]._frameY != compTile.frameY))
         {
             return false;
         }
     }
     if (data[x, y]._wall != compTile.wall || data[x, y]._liquid != compTile.liquid)
     {
         return false;
     }
     if (compTile.liquid == 0)
     {
         if (this.wallColor() != compTile.wallColor())
         {
             return false;
         }
     }
     else if (data[x, y]._bTileHeader != compTile.bTileHeader)
     {
         return false;
     }
     return true;
 }
 public void CopyFrom(MemTile from)
 {
     data[x, y]._type = from.type;
     data[x, y]._wall = from.wall;
     data[x, y]._liquid = from.liquid;
     data[x, y]._sTileHeader = from.sTileHeader;
     data[x, y]._bTileHeader = from.bTileHeader;
     data[x, y]._bTileHeader2 = from.bTileHeader2;
     data[x, y]._bTileHeader3 = from.bTileHeader3;
     data[x, y]._frameX = from.frameX;
     data[x, y]._frameY = from.frameY;
 }
 public MemTile(MemTile copy)
 {
     //if (copy == null)
     //{
     //    data[x, y]._type = 0;
     //    data[x, y]._wall = 0;
     //    data[x, y]._liquid = 0;
     //    data[x, y]._sTileHeader = 0;
     //    data[x, y]._bTileHeader = 0;
     //    data[x, y]._bTileHeader2 = 0;
     //    data[x, y]._bTileHeader3 = 0;
     //    data[x, y]._frameX = 0;
     //    data[x, y]._frameY = 0;
     //    return;
     //}
     this.x = copy.x;
     this.y = copy.y;
     data[x, y]._type = copy.type;
     data[x, y]._wall = copy.wall;
     data[x, y]._liquid = copy.liquid;
     data[x, y]._sTileHeader = copy.sTileHeader;
     data[x, y]._bTileHeader = copy.bTileHeader;
     data[x, y]._bTileHeader2 = copy.bTileHeader2;
     data[x, y]._bTileHeader3 = copy.bTileHeader3;
     data[x, y]._frameX = copy.frameX;
     data[x, y]._frameY = copy.frameY;
 }