31 lines
550 B
C++
31 lines
550 B
C++
#ifndef TOWERS_H
|
|
#define TOWERS_H
|
|
|
|
#include <QObject>
|
|
|
|
#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);
|
|
void update();
|
|
int size() const {return gameData->curTowers.size();}
|
|
signals:
|
|
void shot(srcSplashType src, TowerType tw);
|
|
public slots:
|
|
|
|
private:
|
|
Game_Data * gameData;
|
|
};
|
|
|
|
inline uint qHash(const QPoint &pos)
|
|
{
|
|
return qHash(pos.x()) + (qHash(pos.y()) << 16);
|
|
}
|
|
|
|
#endif // TOWERS_H
|