some improve game ui and bugfixes
This commit is contained in:
13
towers.h
13
towers.h
@@ -5,21 +5,26 @@
|
||||
|
||||
class Towers : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
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;}
|
||||
bool canMorph(QPoint id, int index)
|
||||
{
|
||||
TowerType * t = &(gameData->curTowers[id]);
|
||||
return gameData->players[t->PlayerId]->money >= t->src->morphs[index].cost &&
|
||||
t->experience >= t->src->morphs[index].expRequired &&
|
||||
!t->isBilding;
|
||||
}
|
||||
void update();
|
||||
void setScene(QGraphicsScene * scene_) {scene = scene_;}
|
||||
|
||||
signals:
|
||||
void shot(const TowerType &tow);
|
||||
// void tower_killed(QPoint id);
|
||||
// void tower_killed(QPoint id);
|
||||
|
||||
public slots:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user