32 lines
995 B
C++
32 lines
995 B
C++
#ifndef TOWERS_H
|
|
#define TOWERS_H
|
|
|
|
#include "game_data.h"
|
|
|
|
class Towers : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit Towers(Game_Data * gd, QObject *parent = 0);
|
|
bool addTower(int playerId, int srcId, QPoint pos);
|
|
void delTower(QPoint pos);
|
|
bool morphTower(QPoint id, int index);
|
|
bool canBuild(int id, int player) {return gameData->players[player]->money >= gameData->players[player]->srcTowers[id].cost;}
|
|
bool canMorph(QPoint id, int index) {return gameData->players[gameData->curTowers[id].PlayerId]->money >= gameData->curTowers[id].src->morphs[index].cost &&
|
|
gameData->curTowers[id].experience >= gameData->curTowers[id].src->morphs[index].expRequired;}
|
|
void update();
|
|
void setScene(QGraphicsScene * scene_) {scene = scene_;}
|
|
|
|
signals:
|
|
void shot(const TowerType &tow);
|
|
// void tower_killed(QPoint id);
|
|
|
|
public slots:
|
|
|
|
private:
|
|
Game_Data * gameData;
|
|
QGraphicsScene * scene;
|
|
};
|
|
|
|
#endif // TOWERS_H
|