#ifndef FIGHT_WIDGET_ROW_WIDGET_H
#define FIGHT_WIDGET_ROW_WIDGET_H

#include <QtGui>
#include <list>
#include <cassert>
#include "ui_fightWidgetRowWidget.h"
#include "softProj\clientServer\structs.h"
#include "fightWidgetRow.h"

class FightWidgetRowWidget : public QWidget {
	Q_OBJECT

private:
	Ui::FightWidgetRowWidget ui_;
	id_t itemId_;

	QIcon buildIcon;
	QIcon notokIcon;
	QIcon shipIcon;
	QIcon baseIcon;
	QIcon shellIcon;
	QIcon weaponIcon;
	QIcon shieldIcon;
	QIcon weaponShieldIcon;
	QIcon attackOnMeIcon;
	QIcon attackOnMeShieldIcon;

	QString backgroundProperty_;

	void initIcons();
signals:
	void clickedSignal(id_t itemId);
	void doubleClickedSignal(id_t itemId);
private slots:
	void itemClickedSlot(bool checked);

	void itemDoubleClickedSlot();
public:
	FightWidgetRowWidget(QWidget * parent, EFortressType itemType);

	void setItemName(const QString & itemName);

	void setItemId(id_t id);

	id_t getItemId();

	void setAsGreen();

	void setAsBlue();

	void setAsBuildShell(bool isShell);

	void setAsFight(bool isAttacking, bool isAttackingOnSelf, bool isUnderAttack);

	void refreshBackground();

	void setAsCanBuild(bool canBuild);

	void setAsClicked(bool clicked);

protected:
	virtual void mouseDoubleClickEvent(QMouseEvent * mouseEvent);
};

#endif