56 lines
992 B
C
56 lines
992 B
C
#ifndef BASE_TYPES_H
|
|
#define BASE_TYPES_H
|
|
|
|
#include <QPointF>
|
|
#include <QVector>
|
|
|
|
struct Alien
|
|
{
|
|
int Id;
|
|
int type;
|
|
QPointF pos;
|
|
float angle; // -180 .. 180
|
|
float speed; // cells per thick (speed=1 is 60cells by 1 sec for 60fps e.g.)
|
|
float health;
|
|
QPoint finish;
|
|
QVector <QPointF> path;
|
|
unsigned int gold;
|
|
};
|
|
|
|
|
|
struct Tower
|
|
{
|
|
int Id;
|
|
int type;
|
|
int AlienId; // aim alien
|
|
QPoint pos; // not QPointF because tower fixed on grid
|
|
float angle; // -180 .. 180
|
|
float range;
|
|
float speed; // shots per thick (e.g. speed=1 is 60 shots by 1sec for 60fps e.g. )
|
|
};
|
|
|
|
|
|
struct Splash
|
|
{
|
|
int Id;
|
|
int type;
|
|
int TowerId; // parent tower
|
|
int AlienId; // aim alien (different from tower.AlienId)
|
|
int lifetime; // in msec
|
|
float radius;
|
|
QPointF pos;
|
|
};
|
|
|
|
|
|
struct wave
|
|
{
|
|
int Id;
|
|
QVector <int> types; // some types of aliens (e.g. 2 fly and 3 grount in one wave)
|
|
QVector <int> counts; // count aliens of each type
|
|
int wait_time; // time in sec
|
|
unsigned int gold;
|
|
};
|
|
|
|
|
|
#endif // BASE_TYPES_H
|