46 lines
1.3 KiB
C++
46 lines
1.3 KiB
C++
#ifndef SPLASHES_H
|
|
#define SPLASHES_H
|
|
|
|
#include "game_data.h"
|
|
|
|
class Splashes : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit Splashes(Game_Data * gd, QObject *parent = 0);
|
|
void delSplash(int Id);
|
|
void update();
|
|
void setScene(QGraphicsScene * scene_) {scene = scene_;}
|
|
|
|
signals:
|
|
/// TODO : fix killalien - new function for adding alien in kill list and del aliens in finish update
|
|
void killAlien(int playerId, int alienId);
|
|
|
|
public slots:
|
|
void addSplash(int player, srcSplashType * src, QPointF pos, QPointF dest, int aim = -1);
|
|
void addSplash(const TowerType &tower);
|
|
void addSplash(srcTowerType * srctower, int id, QPointF pos, QPointF dest, int aim = -1, QPoint towerId = QPoint(-1,-1));
|
|
void addSplash(SplashType *spl);
|
|
|
|
private:
|
|
|
|
QGraphicsScene * scene;
|
|
Game_Data *gameData;
|
|
int nextId;
|
|
struct DeadAlienIndex
|
|
{
|
|
DeadAlienIndex(int i, int p) {id = i; player = p;}
|
|
int player;
|
|
int id;
|
|
};
|
|
QHash <int, DeadAlienIndex> dead;
|
|
|
|
void doTriggerOnDest(QHash<int, SplashType>::iterator
|
|
spl, QHash<int,int> * deadIndexes,
|
|
bool badAl);
|
|
void doTriggerOnTimer(QHash<int, SplashType>::iterator
|
|
spl, QHash<int,int> * deadIndexes);
|
|
};
|
|
|
|
#endif // SPLASHES_H
|