#pragma once
#include <iostream>
#include <string>
using namespace std;
using std::string;

#include "C:\L\Avatars\Item.h"
enum MarketCommands
{
	mrktFail, mrktSuccess, mrktCantAfford, mrktNoMoreShelfSpace, mrktNotProperCoins,
	mrktInvetoryShort, mrktYourCoinsWerentSufficient, mrktPlayerNoRoom
};
#define MarketMaxStockLevel 99
#define MrktStockMulti		20
#define HomeMarketTotal		10
#define GuildMarketTotal	12
#define AlcheMarketTotal	84
#define BlackMarketTotal	78
#define CandlMarketTotal	35
#define CarpeMarketTotal	10
#define CartwMarketTotal	9
#define CartoMarketTotal	3
#define CheesMarketTotal	10
#define ChurcMarketTotal	3
#define DocksMarketTotal	11
#define FarmeMarketTotal	10
#define GuardMarketTotal	14
#define Inn_MarketTotal		39
#define JewelMarketTotal	7
#define LeathMarketTotal	61
#define LiverMarketTotal	10
#define LocksMarketTotal	10
#define MarkeMarketTotal	13
#define MasonMarketTotal	10
#define MinorMarketTotal	10
#define PotteMarketTotal	10
#define RopeMMarketTotal	10
#define SchooMarketTotal	3
#define TailoMarketTotal	80
#define TheatMarketTotal	3
#define ThievMarketTotal	8
#define WeapoMarketTotal	43
#define WinerMarketTotal	10
#define WizarMarketTotal	120

class Market
{
public:
			Market				();
			~Market				() { };
	void	Reset				();

	void	setCashLB			(int index, int amount);
	void	addCashLB			(int index, int amount);
	void	adjustCashOnHand	(int amount);
	int		getTotal			();
	int		getPlat				();
	int		getGold				();
	int		getSilv				();
	int		getCopp				();
	void	handOverCash		(int howMuch, int &Plat, int &Gold, int &Silv, int &Copp);

private:
	Item	LockBox[4];	//Where to hold cash
	int		TotalCash;	//total running value of cash
};
//class TreasuryDepartment : public Market
//{
//
//}
class HomeMarket : public Market
{
public:
	HomeMarket();
	~HomeMarket() { };

	void	Reset			();
	void	setShelf		(int index, int what, int quant);
	int		getShelfItem	(int index);
	void	setQuant		(int index, int data);
	int		getShelfQuan	(int index);
	int		getNumSlots		();
private:
	Item	Stock[HomeMarketTotal];
	int		numSlots;
};
class GuildMarket : public Market
{
public:
	GuildMarket();
	~GuildMarket() { };

	void	Reset			();
	void	setShelf		(int index, int what, int quant);
	int		getShelfItem	(int index);
	void	setQuant		(int index, int data);
	int		getShelfQuan	(int index);
	int		getNumSlots		() { return numSlots; }
private:
	Item	Stock[GuildMarketTotal];
	int		numSlots;
};
class AlcheMarket : public Market
{
public:
	AlcheMarket();
	~AlcheMarket() { };

	void	Reset			();
	void	setShelf		(int index, int what, int quant);
	int		getShelfItem	(int index);
	void	setQuant		(int index, int data);
	int		getShelfQuan	(int index);
	int		getNumSlots		()	{ return numSlots; }
private:
	Item	Stock[AlcheMarketTotal];
	int		numSlots;
};
class BlackMarket : public Market
{
public:
	BlackMarket();
	~BlackMarket() { };

	void	Reset			();
	void	setShelf		(int index, int what, int quant);
	int		getShelfItem	(int index);
	void	setQuant		(int index, int data);
	int		getShelfQuan	(int index);
	int		getNumSlots		()	{ return numSlots; }
private:
	Item	Stock[BlackMarketTotal];
	int		numSlots;
};
class CandlMarket : public Market
{
public:
	CandlMarket();
	~CandlMarket() { };

	void	Reset			();
	void	setShelf		(int index, int what, int quant);
	int		getShelfItem	(int index);
	void	setQuant		(int index, int data);
	int		getShelfQuan	(int index);
	int		getNumSlots		()	{ return numSlots; }
private:
	Item	Stock[CandlMarketTotal];
	int		numSlots;
};
class CarpeMarket : public Market
{
public:
	CarpeMarket();
	~CarpeMarket() { };

	void	Reset			();
	void	setShelf		(int index, int what, int quant);
	int		getShelfItem	(int index);
	void	setQuant		(int index, int data);
	int		getShelfQuan	(int index);
	int		getNumSlots		()	{ return numSlots; }
private:
	Item	Stock[CarpeMarketTotal];
	int		numSlots;
};
class CartwMarket : public Market
{
public:
	CartwMarket();
	~CartwMarket() { };

	void	Reset			();
	void	setShelf		(int index, int what, int quant);
	int		getShelfItem	(int index);
	void	setQuant		(int index, int data);
	int		getShelfQuan	(int index);
	int		getNumSlots		()	{ return numSlots; }
private:
	Item	Stock[CartwMarketTotal];
	int		numSlots;
};
class CartoMarket : public Market
{
public:
	CartoMarket();
	~CartoMarket() { };

	void	Reset			();
	void	setShelf		(int index, int what, int quant);
	int		getShelfItem	(int index);
	void	setQuant		(int index, int data);
	int		getShelfQuan	(int index);
	int		getNumSlots		()	{ return numSlots; }
private:
	Item	Stock[CartoMarketTotal];
	int		numSlots;
};
class CheesMarket : public Market
{
public:
	CheesMarket();
	~CheesMarket() { };

	void	Reset			();
	void	setShelf		(int index, int what, int quant);
	int		getShelfItem	(int index);
	void	setQuant		(int index, int data);
	int		getShelfQuan	(int index);
	int		getNumSlots		()	{ return numSlots; }
private:
	Item	Stock[CheesMarketTotal];
	int		numSlots;
};
class ChurcMarket : public Market
{
public:
	ChurcMarket();
	~ChurcMarket() { };

	void	Reset			();
	void	setShelf		(int index, int what, int quant);
	int		getShelfItem	(int index);
	void	setQuant		(int index, int data);
	int		getShelfQuan	(int index);
	int		getNumSlots		()	{ return numSlots; }
private:
	Item	Stock[ChurcMarketTotal];
	int		numSlots;
};
class DocksMarket : public Market
{
public:
	DocksMarket();
	~DocksMarket() { };

	void	Reset			();
	void	setShelf		(int index, int what, int quant);
	int		getShelfItem	(int index);
	void	setQuant		(int index, int data);
	int		getShelfQuan	(int index);
	int		getNumSlots		()	{ return numSlots; }
private:
	Item	Stock[DocksMarketTotal];
	int		numSlots;
};
class FarmeMarket : public Market
{
public:
	FarmeMarket();
	~FarmeMarket() { };

	void	Reset			();
	void	setShelf		(int index, int what, int quant);
	int		getShelfItem	(int index);
	void	setQuant		(int index, int data);
	int		getShelfQuan	(int index);
	int		getNumSlots		()	{ return numSlots; }
private:
	Item	Stock[FarmeMarketTotal];
	int		numSlots;
};
class GuardMarket : public Market
{
public:
	GuardMarket();
	~GuardMarket() { };

	void	Reset			();
	void	setShelf		(int index, int what, int quant);
	int		getShelfItem	(int index);
	void	setQuant		(int index, int data);
	int		getShelfQuan	(int index);
	int		getNumSlots		()	{ return numSlots; }
private:
	Item	Stock[GuardMarketTotal];
	int		numSlots;
};
class Inn_Market : public Market
{
public:
	Inn_Market();
	~Inn_Market() { };

	void	Reset			();
	void	setShelf		(int index, int what, int quant);
	int		getShelfItem	(int index);
	void	setQuant		(int index, int data);
	int		getShelfQuan	(int index);
	int		getNumSlots		()	{ return numSlots; }
private:
	Item	Stock[Inn_MarketTotal];
	int		numSlots;
};
class JewelMarket : public Market
{
public:
	JewelMarket();
	~JewelMarket() { };

	void	Reset			();
	void	setShelf		(int index, int what, int quant);
	int		getShelfItem	(int index);
	void	setQuant		(int index, int data);
	int		getShelfQuan	(int index);
	int		getNumSlots		()	{ return numSlots; }
private:
	Item	Stock[JewelMarketTotal];
	int		numSlots;
};
class LeathMarket : public Market
{
public:
	LeathMarket();
	~LeathMarket() { };

	void	Reset			();
	void	setShelf		(int index, int what, int quant);
	int		getShelfItem	(int index);
	void	setQuant		(int index, int data);
	int		getShelfQuan	(int index);
	int		getNumSlots		()	{ return numSlots; }
private:
	Item	Stock[LeathMarketTotal];
	int		numSlots;
};
class LiverMarket : public Market
{
public:
	LiverMarket();
	~LiverMarket() { };

	void	Reset			();
	void	setShelf		(int index, int what, int quant);
	int		getShelfItem	(int index);
	void	setQuant		(int index, int data);
	int		getShelfQuan	(int index);
	int		getNumSlots		()	{ return numSlots; }
private:
	Item	Stock[LiverMarketTotal];
	int		numSlots;
};
class LocksMarket : public Market
{
public:
	LocksMarket();
	~LocksMarket() { };

	void	Reset			();
	void	setShelf		(int index, int what, int quant);
	int		getShelfItem	(int index);
	void	setQuant		(int index, int data);
	int		getShelfQuan	(int index);
	int		getNumSlots		()	{ return numSlots; }
private:
	Item	Stock[LocksMarketTotal];
	int		numSlots;
};
class MarkeMarket : public Market
{
public:
	MarkeMarket();
	~MarkeMarket() { };

	void	Reset			();
	void	setShelf		(int index, int what, int quant);
	int		getShelfItem	(int index);
	void	setQuant		(int index, int data);
	int		getShelfQuan	(int index);
	int		getNumSlots		()	{ return numSlots; }
private:
	Item	Stock[MarkeMarketTotal];
	int		numSlots;
};
class MasonMarket : public Market
{
public:
	MasonMarket();
	~MasonMarket() { };

	void	Reset			();
	void	setShelf		(int index, int what, int quant);
	int		getShelfItem	(int index);
	void	setQuant		(int index, int data);
	int		getShelfQuan	(int index);
	int		getNumSlots		()	{ return numSlots; }
private:
	Item	Stock[MasonMarketTotal];
	int		numSlots;
};
class MinorMarket : public Market
{
public:
	MinorMarket();
	~MinorMarket() { };

	void	Reset			();
	void	setShelf		(int index, int what, int quant);
	int		getShelfItem	(int index);
	void	setQuant		(int index, int data);
	int		getShelfQuan	(int index);
	int		getNumSlots		()	{ return numSlots; }
private:
	Item	Stock[MinorMarketTotal];
	int		numSlots;
};
class PotteMarket : public Market
{
public:
	PotteMarket();
	~PotteMarket() { };

	void	Reset			();
	void	setShelf		(int index, int what, int quant);
	int		getShelfItem	(int index);
	void	setQuant		(int index, int data);
	int		getShelfQuan	(int index);
	int		getNumSlots		()	{ return numSlots; }
private:
	Item	Stock[PotteMarketTotal];
	int		numSlots;
};
class RopeMMarket : public Market
{
public:
	RopeMMarket();
	~RopeMMarket() { };

	void	Reset			();
	void	setShelf		(int index, int what, int quant);
	int		getShelfItem	(int index);
	void	setQuant		(int index, int data);
	int		getShelfQuan	(int index);
	int		getNumSlots		()	{ return numSlots; }
private:
	Item	Stock[RopeMMarketTotal];
	int		numSlots;
};
class SchooMarket : public Market
{
public:
	SchooMarket();
	~SchooMarket() { };

	void	Reset			();
	void	setShelf		(int index, int what, int quant);
	int		getShelfItem	(int index);
	void	setQuant		(int index, int data);
	int		getShelfQuan	(int index);
	int		getNumSlots		()	{ return numSlots; }
private:
	Item	Stock[SchooMarketTotal];
	int		numSlots;
};
class TailoMarket : public Market
{
public:
	TailoMarket();
	~TailoMarket() { };

	void	Reset			();
	void	setShelf		(int index, int what, int quant);
	int		getShelfItem	(int index);
	void	setQuant		(int index, int data);
	int		getShelfQuan	(int index);
	int		getNumSlots		()	{ return numSlots; }
private:
	Item	Stock[TailoMarketTotal];
	int		numSlots;
};
class TheatMarket : public Market
{
public:
	TheatMarket();
	~TheatMarket() { };

	void	Reset			();
	void	setShelf		(int index, int what, int quant);
	int		getShelfItem	(int index);
	void	setQuant		(int index, int data);
	int		getShelfQuan	(int index);
	int		getNumSlots		()	{ return numSlots; }
private:
	Item	Stock[TheatMarketTotal];
	int		numSlots;
};
class ThievMarket : public Market
{
public:
	ThievMarket();
	~ThievMarket() { };

	void	Reset			();
	void	setShelf		(int index, int what, int quant);
	int		getShelfItem	(int index);
	void	setQuant		(int index, int data);
	int		getShelfQuan	(int index);
	int		getNumSlots		()	{ return numSlots; }
private:
	Item	Stock[ThievMarketTotal];
	int		numSlots;
};
class WeapoMarket : public Market
{
public:
	WeapoMarket();
	~WeapoMarket() { };

	void	Reset			();
	void	setShelf		(int index, int what, int quant);
	int		getShelfItem	(int index);
	void	setQuant		(int index, int data);
	int		getShelfQuan	(int index);
	int		getNumSlots		()	{ return numSlots; }
private:
	Item	Stock[WeapoMarketTotal];
	int		numSlots;
};
class WinerMarket : public Market
{
public:
	WinerMarket();
	~WinerMarket() { };

	void	Reset			();
	void	setShelf		(int index, int what, int quant);
	int		getShelfItem	(int index);
	void	setQuant		(int index, int data);
	int		getShelfQuan	(int index);
	int		getNumSlots		()	{ return numSlots; }
private:
	Item	Stock[WinerMarketTotal];
	int		numSlots;
};
class WizarMarket : public Market
{
public:
	WizarMarket();
	~WizarMarket() { };

	void	Reset			();
	void	setShelf		(int index, int what, int quant);
	int		getShelfItem	(int index);
	void	setQuant		(int index, int data);
	int		getShelfQuan	(int index);
	int		getNumSlots		()	{ return numSlots; }
private:
	Item	Stock[WizarMarketTotal];
	int		numSlots;
};