#ifndef __MAPOBJECT_H__
#define __MAPOBJECT_H__

#include "gui.h"
#include "units.h"
#include "shop.h"

class MapObject
{
public:
	MapObject() {}
	~MapObject();
	void Init(int sx, int sy, std::string img, std::string fpk, float zzoom);
	void Display(int sx, int sy);
	void SetName(std::string n);
	void SetX(int sx);
	void SetY(int sy);
	void SetMMR(Uint8 sr);
	void SetMMG(Uint8 sg);
	void SetMMB(Uint8 sb);
	void SetZoom(float szoom);
	int GetWidth();
	int GetHeight();
	float GetZoom();
	Uint8 GetMMR();
	Uint8 GetMMG();
	Uint8 GetMMB();
	std::string GetName();
	int GetX();
	int GetY();
	int GetNegX();
	int GetNegY();
	void FreeImage();
	void LoadImage();
	int GetSectorX();
	int GetSectorY();
	bool MapObject::IsLoaded();
private:
	std::string imgload;
	SDL_Surface *image;
	std::string name;
	std::string fpk;
	int x;
	int y;
	Uint8 mmr;
	Uint8 mmg;
	Uint8 mmb;
	bool loaded;
	float zoom;
};

class Station : public MapObject
{
public:
	Station();
	~Station();
	void AddItemToBuyShop(__shopitem item);
	void AddSellableCargo(__cargo cargo);
	void AllowHullRepairs(unsigned int hullRepairCost);
	void AllowShieldRepairs(unsigned int shieldRepairCost);
	void AddShipToShipyard(FPKShip *ship);
	void InitShipyardShop();
	void Dock(Unit *ship);
	void ChangeSupply();
	void AddToWaitTime(Uint32 time);
	Uint32 GetTicks();
private:
	bool HRepairsAllowed;
	bool SRepairsAllowed;
	bool hasShipyard;
	unsigned int hrepairCost;
	unsigned int srepairCost;
	__shop shop;
	__cargo cargosell[30];
	int cargonext;
	Uint32 ticks;
	unsigned int pm;
	bool sell;
	bool buy;
	FPKShip *ships[100];
	int fpkshipnext;
	ShipyardShop *shipyardshop;
};

#endif /* __MAPOBJECT_H__ */

