using System;
using Server;
using Server.Mobiles;
using Server.Regions;

namespace Server.Items
{
	[Flipable(0x0E42, 0x0E43)]
    public class InnChest : Item
	{
        [Constructable]
        public InnChest() : base(0x0E42)
		{
            Name = "Inn Chest";
			Movable = false;
        }

        public override void OnDoubleClick(Mobile from)
		{
			if ( from.Region is InnRegion && from.InRange( this.GetWorldLocation(), 4 ) )
			{
				InnBox box = from.InnBox;
				if (box != null)
				{
					box.Open();
				}
			}
			else
			{
				from.SendLocalizedMessage( 502138 ); // That is too far away for you to use
			}
        }

        public InnChest( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
	    }
    }
}