#include "C:\L\Avatars\Item.h"
Item::Item()
{
	Reset();
}
Item::~Item()
{
	/*Empty Destructor*/
}
const Item& Item::operator= (const Item &other)
{
	if(this != &other)
	{
		What	= other.What;
		Facing	= other.Facing;
		Number	= other.Number;
	}
	return *this;
}
const Item* Item::operator= (const Item *other)
{
	if(this != other)
	{
		What	= other->What;
		Facing	= other->Facing;
		Number	= other->Number;
	}
	return this;
}
void Item::Increment(int i)
{
	//Test outside of Class to ensure that we are 
	//not adding more than what the game calls for.
	if(i > 0) Number += i;
}
void Item::Decrement(int i)
{
	//Test outside of Class to ensure that if deleting a number 
	//that, if it reaches zero, to totally delete it from the listing
	if(i > 0)
	{ 
		if(Number - i > 0) Number -= i;
	}
}
void Item::Reset()
{
	What = itNegOne; Facing = 0; Number = 0; State = false;
}
int Item::GetMaxRange(int What)
{
	switch(What)
	{
	case itLgBow:
	case itCLgBow:		return 9;	break;

	case itCBow:
	case itCStBow:
	case itStBow:		return 7;	break;

	case itLance:
	case itSpear:
	case itTrident:
	case itWhip:		return 2;	break;

	case itHeld:		case itBastSw:		case itBattAxe:
	case itBrdSw:		case itClub:		case itDagger:
	case itFlail:		case itHandAxe:		case itLgSw:
	case itMace:		case itMoStar:		case itPick:
	case itQrStaff:		case itScim:		case itScourge:
	case itStSw:		case itSickle:		case itWarHam:
	case itSWoSh:		case itMWoSh:		case itLWoSh:
	case itSMeSh:		case itMMeSh:		case itLMeSh:
	case itShuval:		case itPickAxe:		case itScyth:
	case itWoodAxe:		case itConHammer:	case itSledgeHammer:
	case itHandSaw:		return 1;	break;
	default: return -1;
	};
}