context: using System;
  using Server.Network;
  
  namespace Server.Items
  {
  	public class Tapestry1N : Item
  	{
  		private InternalItem m_Item;
  
  		[Constructable]
  		public Tapestry1N() : base( 0xEAA )
  		{
  			Movable = false;
  
  			m_Item = new InternalItem( this );
  		}
  
  		public Tapestry1N( Serial serial ) : base( serial )
  		{
  		}
  
  		public override void OnLocationChange( Point3D oldLocation )
  		{
  			if ( m_Item != null )
  				m_Item.Location = new Point3D( X + 1, Y , Z );
  		}
  
  		public override void OnMapChange()
  		{
  			if ( m_Item != null )
  				m_Item.Map = Map;
  		}
  
  		public override void OnAfterDelete()
  		{
  			base.OnAfterDelete();
  
  			if ( m_Item != null )
  				m_Item.Delete();
  		}
  
  		public override void Serialize( GenericWriter writer )
  		{
  			base.Serialize( writer );
  
  			writer.Write( (int) 0 ); // version
  
  			writer.Write( m_Item );
  		}
  
  		public override void Deserialize( GenericReader reader )
  		{
  			base.Deserialize( reader );
  
  			/*int version = */reader.ReadInt();
  
  			m_Item = reader.ReadItem() as InternalItem;
  		}
  		private class InternalItem : Item
  		{
  			private Tapestry1N m_Item;
  
  			public InternalItem( Tapestry1N item ) : base( 0xEAB )
  			{
  				Movable = true;
  
  				m_Item = item;
  			}
  
  			public InternalItem( Serial serial ) : base( serial )
  			{
  			}
  
  			public override void OnLocationChange( Point3D oldLocation )
  			{
  				if ( m_Item != null )
  					m_Item.Location = new Point3D( X - 1, Y , Z );
  			}
  
  			public override void OnMapChange()
  			{
  				if ( m_Item != null )
  					m_Item.Map = Map;
  			}
  
  			public override void OnAfterDelete()
  			{
  				base.OnAfterDelete();
  
  				if ( m_Item != null )
  					m_Item.Delete();
  			}
  
  			public override void Serialize( GenericWriter writer )
  			{
  				base.Serialize( writer );
  
  				writer.Write( (int) 0 ); // version
  
  				writer.Write( m_Item );
  			}
  
  			public override void Deserialize( GenericReader reader )
  			{
  				base.Deserialize( reader );
  
  				/*int version = */reader.ReadInt();
  
  				m_Item = reader.ReadItem() as Tapestry1N;
  			}
  		}
  	}
  
  	public class Tapestry2N : Item
  	{
  		private InternalItem m_Item;
  
  		[Constructable]
  		public Tapestry2N() : base( 0xEAC )
  		{
  			Movable = false;
  
  			m_Item = new InternalItem( this );
  		}
  
  		public Tapestry2N( Serial serial ) : base( serial )
  		{
  		}
  
  		public override void OnLocationChange( Point3D oldLocation )
  		{
  			if ( m_Item != null )
  				m_Item.Location = new Point3D( X + 1, Y , Z );
  		}
  
  		public override void OnMapChange()
  		{
  			if ( m_Item != null )
  				m_Item.Map = Map;
  		}
  
  		public override void OnAfterDelete()
  		{
  			base.OnAfterDelete();
  
  			if ( m_Item != null )
  				m_Item.Delete();
  		}
  
  		public override void Serialize( GenericWriter writer )
  		{
  			base.Serialize( writer );
  
  			writer.Write( (int) 0 ); // version
  
  			writer.Write( m_Item );
  		}
  
  		public override void Deserialize( GenericReader reader )
  		{
  			base.Deserialize( reader );
  
  			/*int version = */reader.ReadInt();
  
  			m_Item = reader.ReadItem() as InternalItem;
  		}
  		private class InternalItem : Item
  		{
  			private Tapestry2N m_Item;
  
  			public InternalItem( Tapestry2N item ) : base( 0xEAD )
  			{
  				Movable = true;
  
  				m_Item = item;
  			}
  
  			public InternalItem( Serial serial ) : base( serial )
  			{
  			}
  
  			public override void OnLocationChange( Point3D oldLocation )
  			{
  				if ( m_Item != null )
  					m_Item.Location = new Point3D( X - 1, Y , Z );
  			}
  
  			public override void OnMapChange()
  			{
  				if ( m_Item != null )
  					m_Item.Map = Map;
  			}
  
  			public override void OnAfterDelete()
  			{
  				base.OnAfterDelete();
  
  				if ( m_Item != null )
  					m_Item.Delete();
  			}
  
  			public override void Serialize( GenericWriter writer )
  			{
  				base.Serialize( writer );
  
  				writer.Write( (int) 0 ); // version
  
  				writer.Write( m_Item );
  			}
  
  			public override void Deserialize( GenericReader reader )
  			{
  				base.Deserialize( reader );
  
  				/*int version = */reader.ReadInt();
  
  				m_Item = reader.ReadItem() as Tapestry2N;
  			}
  		}
  	}
  	public class Tapestry2W : Item
  	{
  		private InternalItem m_Item;
  
  		[Constructable]
  		public Tapestry2W() : base( 0xEAE )
  		{
  			Movable = false;
  
  			m_Item = new InternalItem( this );
  		}
  
  		public Tapestry2W( Serial serial ) : base( serial )
  		{
  		}
  
  		public override void OnLocationChange( Point3D oldLocation )
  		{
  			if ( m_Item != null )
  
gt: 				m_Item.Location = new Point3D( X , Y - 1 , Z );