/**********************************************************
RunUO 2.0 AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by 
Filepath: scripts\_custom\items\resources\Boards.cs
Lines of code: 262
***********************************************************/


using System;
using Server.Items;
using Server.Network;

namespace Server.Items
{
	public abstract class BaseWoodBoard : Item, ICommodity
	{
		private CraftResource m_Resource;

		[CommandProperty( AccessLevel.GameMaster )]
		public CraftResource Resource
		{
			get{ return m_Resource; }
			set{ m_Resource = value; InvalidateProperties(); }
		}

		public override double DefaultWeight
		{
			get { return 1; }
		}
		
		string ICommodity.Description
		{
			get
			{
				return String.Format( Amount == 1 ? "{0} {1} Board" : "{0} {1} Boards", Amount, CraftResources.GetName( m_Resource ).ToLower() );
			}
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 0 ); // version

			writer.Write( (int) m_Resource );
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			m_Resource = (CraftResource)reader.ReadInt();
		}

		public BaseWoodBoard( CraftResource resource ) : this( resource, 1 )
		{
		}

		public BaseWoodBoard( CraftResource resource, int amount ) : base( 0x1BD7 )
		{
			Stackable = true;
			Amount = amount;
			Hue = CraftResources.GetHue( resource );

			m_Resource = resource;
		}

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

		public override void AddNameProperty( ObjectPropertyList list )
		{
			if ( Amount > 1 )
				list.Add( 1050039, "{0}\t#{1}", Amount, 1015101 ); // ~1_NUMBER~ ~2_ITEMNAME~
			else
				list.Add( 1027127 ); // Board
		}

		public override void GetProperties( ObjectPropertyList list )
		{
			base.GetProperties( list );

			if ( !CraftResources.IsStandard( m_Resource ) )
			{
				int num = CraftResources.GetLocalizationNumber( m_Resource );

				if ( num > 0 )
					list.Add( num );
				else
					list.Add( CraftResources.GetName( m_Resource ) );
			}
		}

		public override int LabelNumber
		{
			get
			{
				switch ( m_Resource)
				{
				case CraftResource.Oakwood: return 1075052;
				case CraftResource.Ashwood: return 1075053; 
				case CraftResource.Yewwood: return 1075054; 
				case CraftResource.Heartwood: return 1075062; 
				case CraftResource.Bloodwood: return 1075055;
				case CraftResource.Frostwood: return 1075056; 				
				}
				return 1027127;
			}
		}
	}

	[FlipableAttribute( 0x1BD7, 0x1BDA )]
	public class Board : BaseWoodBoard
	{
		[Constructable]
		public Board() : this( 1 )
		{
		}

		[Constructable]
		public Board( int amount ) : base( CraftResource.Wood, amount )
		{
		}

		public Board( 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();
		}

		
	}

	[FlipableAttribute( 0x1BD7, 0x1BDA )]
	public class OakBoard : BaseWoodBoard
	{
		[Constructable]
		public OakBoard() : this( 1 )
		{
		}

		[Constructable]
		public OakBoard( int amount ) : base( CraftResource.Oakwood, amount )
		{
		}

		public OakBoard( 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();
		}

		
	}

	[FlipableAttribute( 0x1BD7, 0x1BDA )]
	public class AshBoard : BaseWoodBoard
	{
		[Constructable]
		public AshBoard() : this( 1 )
		{
		}

		[Constructable]
		public AshBoard( int amount ) : base( CraftResource.Ashwood, amount )
		{
		}

		public AshBoard( 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();
		}

		
	}

	[FlipableAttribute( 0x1BD7, 0x1BDA )]
	public class YewBoard : BaseWoodBoard
	{
		[Constructable]
		public YewBoard() : this( 1 )
		{
		}

		[Constructable]
		public YewBoard( int amount ) : base( CraftResource.Yewwood, amount )
		{
		}

		public YewBoard( 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();
		}

		
	}

	[FlipableAttribute( 0x1BD7, 0x1BDA )]
	public class BloodwoodBoard : BaseWoodBoard
	{
		[Constructable]
		public BloodwoodBoard() : this( 1 )
		{
		}

		[Constructable]
		public BloodwoodBoard( int amount ) : base( CraftResource.Bloodwood, amount )
		{
		}

		public BloodwoodBoard( 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();
		}

		
	}

	[FlipableAttribute( 0x1BD7, 0x1BDA )]
	public class HeartwoodBoard : BaseWoodBoard
	{
		[Constructable]
		public HeartwoodBoard() : this( 1 )
		{
		}

		[Constructable]
		public HeartwoodBoard( int amount ) : base( CraftResource.Heartwood, amount )
		{
		}

		public HeartwoodBoard( 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();
		}

		
	}

	[FlipableAttribute( 0x1BD7, 0x1BDA )]
	public class FrostwoodBoard : BaseWoodBoard
	{
		[Constructable]
		public FrostwoodBoard() : this( 1 )
		{
		}

		[Constructable]
		public FrostwoodBoard( int amount ) : base( CraftResource.Frostwood, amount )
		{
		}

		public FrostwoodBoard( 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();
		}
	}
	
	
	/*public static Item GenerateRandomBoard(int amt)
	{
	
	
	
	
	
	}*/

}