#ifndef CLIENT_STATE_H
#define CLIENT_STATE_H

#include "softProj\commonTypes.h"
#include "softProj\DetailsWidget\SimpleItem.h"

struct ShipSectionState {	
	SimpleItem currentShip;
	EShipSectionState state;
	bool isWaiting;

	ShipSectionState();

	bool hasCurrentShip();

	id_t getCurrentShipId();

	SimpleItem getCurrentShip();

	void setCurrentShip(const SimpleItem & ship);

	bool isInState(EShipSectionState state);

	void changeState(EShipSectionState state);
};

struct BaseSectionState {	
	SimpleItem currentBase;
	EBaseSectionState state;

	BaseSectionState();
	bool hasCurrentBase();

	id_t getCurrentBaseId();

	SimpleItem getCurrentBase();

	void setCurrentBase(const SimpleItem & base);

	bool isInState(EBaseSectionState state);

	void changeState(EBaseSectionState state);
};

class ClientState {
public:
	unsigned long activeShipIdSpaceMap;

	EMainState mainState;

	ShipSectionState shipSectionState;
	BaseSectionState baseSectionState;

	SimpleItem invalidFortress;

	ClientState();

	void changeMainState(EMainState mainState);

	bool isInState(EMainState mainState);

	bool hasCurrentFortress();

	const SimpleItem & getCurrentFortress();

	bool isInState(EMainState mainState, EShipSectionState shipState);

	bool isInState(EMainState mainState, EBaseSectionState baseState);
};

#endif