#include "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 0:	break;
		/*
	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;
	};
}
string Item::NameOfItem(int index) const
{
	string name = "";

	switch(index)
	{
	case itArquebus:		name = "arquebus";				break;
	case itAwlPike:			name = "awl pike";				break;
	case itBardiche:		name = "bardiche";				break;
	case itBastardSword:	name = "bastard sword";			break;
	case itBattleAxe:		name = "battle axe";			break;
	case itBecDeCorbin:		name = "bec de corbin";			break;
	case itBillGuisarme:	name = "bill-guisarme";			break;
	case itBlowgun:			name = "blow gun";				break;
	case itBowCompLong:		name = "bow, composite long";	break;
	case itBowCompShort:	name = "bow, composite short";	break;
	case itBowLong:			name = "bow, long";				break;
	case itBowShort:		name = "bow, short";			break;
	case itBroadSword:		name = "broad sword";			break;
	case itClub:			name = "club";					break;
	case itCrossbowHand:	name = "crossbow, hand";		break;
	case itCrossbowHeavy:	name = "crossbow, heavy";		break;
	case itCrossbowLight:	name = "crossbow, light";		break;
	case itDagger:			name = "dagger";				break;
	case itDirk:			name = "dirk";					break;
	case itDart:			name = "dart";					break;
	case itFauchard:		name = "fauchard";				break;
	case itFauchardFork:	name = "fauchard-fork";			break;
	case itFlailFoot:		name = "flail, footman's";		break;
	case itFlailHorse:		name = "flail, horseman's";		break;
	case itGlaiveGuisarme:	name = "glaive-guisarme";		break;
	case itGuisarme:		name = "guisarme";				break;
	case itGuisarmeVoulge:	name = "guisarme-voulge";		break;
	case itHalberd:			name = "halberd";				break;
	case itHookFauchard:	name = "hook, fauchard";		break;
	case itKhopesh:			name = "khopesh";				break;
	case itKnife:			name = "knife";					break;
	case itJavelin:			name = "javelin";				break;
	case itLanceHvy:		name = "lance, heavy";			break;
	case itLanceLgt:		name = "lance, light";			break;
	case itLanceMed:		name = "lance, medium";			break;
	case itLongSword:		name = "sword, long";			break;
	case itLucernHammer:	name = "licern hammer";			break;
	case itMaceFoot:		name = "mace, footman's";		break;
	case itMaceHorse:		name = "mace, horseman's";		break;
	case itMancatcher:		name = "mancatcher";			break;
	case itMilitaryFork:	name = "military fork";			break;
	case itMorningStar:		name = "morning star";			break;
	case itPartisan:		name = "partisan";				break;
	case itPickFoot:		name = "pick, footman's";		break;
	case itPickHorse:		name = "pick, horseman's";		break;
	case itQuarterstaff:	name = "quarterstaff";			break;
	case itRansuer:			name = "ransuer";				break;
	case itScimitar:		name = "scimitar";				break;
	case itScourge:			name = "scourge";				break;
	case itShortSword:		name = "sword, short";			break;
	case itSickle:			name = "sickle";				break;
	case itSpectum:			name = "spectum";				break;
	case itSling:			name = "sling";					break;
	case itSpear:			name = "spear";					break;
	case itStaffSling:		name = "staff sling";			break;
	case itTrident:			name = "trident";				break;
	case itTwoHandedSword:	name = "two-handed sword";		break;
	case itVoulge:			name = "voulge";				break;
	case itWarhammer:		name = "war hammer";			break;
	case itWhip:			name = "whip";					break;
	};

	return name;
}