#include "nwps.h"

nwps::nwps()
{
}
nwps::~nwps()
{
}
void nwps::SetID(int ID)
{
	nwpID = ID;
}
int nwps::GetID() const
{
	return nwpID;
}
void nwps::SetNumSlots(int slots)
{
	numSlots = slots;
}
int nwps::GetNumSlots() const
{
	return numSlots;
}
void nwps::SetXP(int xpTotal)
{
	xp = xpTotal;
}
int	nwps::GetXP() const
{
	return xp;
}
void nwps::SetLevel(int lvl)
{
	level = lvl;
}
int nwps::GetLevel() const
{
	return level;
}
void nwps::ModXP(int plusMinusVal)
{
	int tmpInt;

	//First determine if value is positive or negative...
	if(plusMinusVal > 0)
	{
		//We'll modify experience up by the number of slots assigned...
		tmpInt = plusMinusVal + int(plusMinusVal * ((numSlots - 1) * 10) / 100);
	}
	else
	{
		//Avatar might have more than one slot assigned, giving a
		//bonus to experience. If the avatar is losing xp, we feel
		//it is unjust to remove a percentage based upon multiple
		//slots because usually the event is due to some 'magic'.
		tmpInt = plusMinusVal;
	}

	//plusMinusVal is 'added'...
	//a negative number added works to cause a reduction
	xp += tmpInt;
}
string nwps::getAssignedNWP() const
{
	return getNWPName(nwpID);
}
string nwps::getNWPName(int which) const
{
	string tmp;

	switch(which)
	{
	case nwpAlchemy:				tmp = "Alchemy";				break;
	case nwpAlertness:				tmp = "Alertness";				break;
	case nwpAnimalTraining:			tmp = "Animal Training";		break;
	case nwpAppraising:				tmp = "Appraising";				break;
	case nwpBalance:				tmp = "Balance";				break;
	case nwpBargain:				tmp = "Bargain";				break;
	case nwpBeeKeeping:				tmp = "Bee Keeping";			break;
	case nwpBegging:				tmp = "Begging";				break;
	case nwpBlacksmithing:			tmp = "Blacksmithing";			break;
	case nwpBlindFighting:			tmp = "Blind Fighting";			break;
	case nwpBoasting:				tmp = "Boasting";				break;
	case nwpBoating:				tmp = "Boating";				break;
	case nwpBoatwright:				tmp = "Boatwright";				break;
	case nwpBodyLang:				tmp = "Body Language";			break;
	case nwpBowyer:					tmp = "Bowyer";					break;
	case nwpBrewing:				tmp = "Brewing";				break;
	case nwpBribery:				tmp = "Bribery";				break;
	case nwpBureaucracy:			tmp = "Bureaucracy";			break;
	case nwpButcher:				tmp = "Butcher";				break;
	case nwpCamouflage:				tmp = "Camouflage";				break;
	case nwpCarpentry:				tmp = "Carpentry";				break;
	case nwpCandleMaker:			tmp = "Candle Making";			break;
	case nwpCartography:			tmp = "Cartography";			break;
	case nwpCartwright:				tmp = "Cartwright";				break;
	case nwpChanting:				tmp = "Chanting";				break;
	case nwpCharioteering:			tmp = "Charioteering";			break;
	case nwpCheeseMaking:			tmp = "CheeseMaking";			break;
	case nwpClayWorking:			tmp = "Clay Working";			break;
	case nwpClimbing:				tmp = "Climbing";				break;
	case nwpCloseQuarterFighting:	tmp = "Close Qtr Fight'";		break;
	case nwpCobbling:				tmp = "Cobbling";				break;
	case nwpCommerce:				tmp = "Commerce";				break;
	case nwpConcealment:			tmp = "Concealment";			break;
	case nwpCooking:				tmp = "Cooking";				break;
	case nwpDairyman:				tmp = "Dairyman";				break;
	case nwpDancing:				tmp = "Dancing";				break;
	case nwpDangerSense:			tmp = "Danger Sense";			break;
	case nwpDiagnostics:			tmp = "Diagnostics";			break;
	case nwpDiplomacy:				tmp = "Diplomacy";				break;
	case nwpDirectionSense:			tmp = "Direction Sense";		break;
	case nwpDisguise:				tmp = "Disguise";				break;
	case nwpDistanceSense:			tmp = "Distance Sense";			break;
	case nwpEavesdropping:			tmp = "Eaves Dropping";			break;
	case nwpEndurance:				tmp = "Endurance";				break;
	case nwpEngineering:			tmp = "Engineering";			break;
	case nwpEtiquette:				tmp = "Etiquette";				break;
	case nwpEvasion:				tmp = "Evasion";				break;
	case nwpFarming:				tmp = "Farming";				break;
	case nwpFieldOfStudy:			tmp = "Field Of Study";			break;
	case nwpFireBuilding:			tmp = "Fire Building";			break;
	case nwpFishing:				tmp = "Fishing";				break;
	case nwpFletcher:				tmp = "Fletcher";				break;
	case nwpForaging:				tmp = "Foraging";				break;
	case nwpForgery:				tmp = "Forgery";				break;
	case nwpGaming:					tmp = "Gaming";					break;
	case nwpGemCutting:				tmp = "Gem Cutting";			break;
	case nwpHerbalism:				tmp = "Herbalism";				break;
	case nwpHiding:					tmp = "Hiding";					break;
	case nwpHunting:				tmp = "Hunting";				break;
	case nwpIntimidation:			tmp = "Intimidation";			break;
	case nwpJumping:				tmp = "Jumping";				break;
	case nwpLangAncient:			tmp = "Language - Ancient";		break;
	case nwpLangModern:				tmp = "Language - Modern";		break;
	case nwpLeadership:				tmp = "Leadership";				break;
	case nwpLeatherworking:			tmp = "Leatherworking";			break;
	case nwpLockPicking:			tmp = "Lock Picking";			break;
	case nwpLocksmithing:			tmp = "Locksmithing";			break;
	case nwpManipulation:			tmp = "Manipulation";			break;
	case nwpMiller:					tmp = "Miller";					break;
	case nwpMining:					tmp = "Mining";					break;
	case nwpMusicalInstrument:		tmp = "Musical Instrument";		break;
	case nwpNavigation:				tmp = "Navigation";				break;
	case nwpNightsight:				tmp = "Nightsight";				break;
	case nwpObservation:			tmp = "Observation";			break;
	case nwpOrienteering:			tmp = "Orienteering";			break;
	case nwpPickPockets:			tmp = "Pick Pockets";			break;
	case nwpReadWrite:				tmp = "Reading/Writing";		break;
	case nwpRiding:					tmp = "Riding";					break;
	case nwpRopeNetMaking:			tmp = "Rope & Net Making";		break;
	case nwpRunning:				tmp = "Running";				break;
	case nwpSeamanship:				tmp = "Seamanship";				break;
	case nwpSeamstressTailor:		tmp = "Seamstress/Tailor";		break;
	case nwpSetSnaresAndTraps:		tmp = "Set Snares & Traps";		break;
	case nwpShadowing:				tmp = "Shadowing";				break;
	case nwpShepherd:				tmp = "Shepherd";				break;
	case nwpShipwright:				tmp = "Shipwright";				break;
	case nwpSignaling:				tmp = "Signaling";				break;
	case nwpSinging:				tmp = "Singing";				break;
	case nwpSoundAnalysis:			tmp = "Sound Analysis";			break;
	case nwpSpeedCasting:			tmp = "Speed Casting";			break;
	case nwpSpellcraft:				tmp = "Spellcraft";				break;
	case nwpStealth:				tmp = "Stealth";				break;
	case nwpStonemasonry:			tmp = "Stonemasonry";			break;
	case nwpStreetSense:			tmp = "Street Sense";			break;
	case nwpSurvival:				tmp = "Survival";				break;
	case nwpSwimming:				tmp = "Swimming";				break;
	case nwpTeaching:				tmp = "Teaching";				break;
	case nwpTightropeWalking:		tmp = "Tightrope Walking";		break;
	case nwpTrapDetect:				tmp = "Trap Detection";			break;
	case nwpTumbling:				tmp = "Tumbling";				break;
	case nwpVetHealing:				tmp = "Veteranarian Healing";	break;
	case nwpVentriloquism:			tmp = "Ventriloquism";			break;
	case nwpWaterDivine:			tmp = "Water Divining";			break;
	case nwpWeaving:				tmp = "Weaving";				break;
	case nwpWineMaking:				tmp = "Wine Making";			break;
	default:						tmp = "NWP Name Error";			break;
	}
	return tmp;
}
void nwps::Reset()
{
	nwpID		= -1;
	numSlots	= 0;
	xp			= -1000;
	level		= 0;
}
const nwps& nwps::operator= (const nwps &other)
{
	if(this != &other)
	{
		nwpID		= other.nwpID;
		numSlots	= other.numSlots;
		xp			= other.xp;
		level		= other.level;
	}
	return *this;
}
const nwps* nwps::operator= (const nwps *other)
{
	if(this != other)
	{
		nwpID		= other->nwpID;
		numSlots	= other->numSlots;
		xp			= other->xp;
		level		= other->level;
	}
	return this;
}
/*

	nwpAlchemy = 0, nwpAlertness, nwpAnimalTraining, nwpAppraising,
	nwpBalance, nwpBargain, nwpBeeKeeping, nwpBegging, nwpBlacksmithing, nwpBlindFighting,
	nwpBoasting, nwpBoating, nwpBoatwright, nwpBodyLang, nwpBowyer, nwpBrewing, nwpBribery, 
	nwpBureaucracy, nwpButcher,
	//WP 'Canon' (large guns)
	nwpCamouflage, nwpCarpentry, nwpCandleMaker, nwpCartography, nwpCartwright, nwpChanting, 
	nwpCharioteering, nwpCheeseMaking, nwpClayWorking, nwpClimbing, nwpCloseQuarterFighting, 
	nwpCobbling, nwpCommerce, nwpConcealment, nwpCooking,
	nwpDairyman, nwpDancing, nwpDangerSense, nwpDiagnostics, nwpDiplomacy, nwpDirectionSense,
	nwpDisguise, nwpDistanceSense, 
	nwpEavesdropping, nwpEndurance, nwpEngineering, nwpEtiquette, nwpEvasion,
	nwpFarming, nwpFieldOfStudy, nwpFireBuilding, nwpFishing, nwpFletcher, nwpForaging, nwpForgery,
	nwpGaming, nwpGemCutting, nwpHerbalism, nwpHiding, nwpHunting, 
	nwpIntimidation,
	nwpJumping,
	nwpLangAncient, nwpLangModern, nwpLeadership, nwpLeatherworking, nwpLockPicking, nwpLocksmithing,
	nwpManipulation, nwpMiller, nwpMining, nwpMusicalInstrument, 
	nwpNavigation, nwpNightsight,
	nwpObservation, nwpOrienteering,
	nwpPickPockets,
	nwpReadWrite, nwpRiding, nwpRopeNetMaking, nwpRunning,
	nwpSeamanship, nwpSeamstressTailor, nwpSetSnaresAndTraps, nwpShadowing, nwpnwpShepherd, 
	nwpShipwright, nwpSignaling, nwpSinging, nwpSoundAnalysis, nwpSpeedCasting, nwpSpellcraft, 
	nwpStealth, nwpStonemasonry, nwpStreetSense, nwpSurvival, nwpSwimming, 
	nwpTeaching, nwpTightropeWalking, nwpTrapDetect, nwpTumbling,
	nwpVetHealing, nwpVentriloquism, 
	nwpWaterDivine, nwpWeaving, nwpWineMaking,
	MAX_NWPs
*/