Files
aliendefender/base_types.h
buull 7099e17901 added some tables, add upgrade
now not reading tables:
	morphs
	chains
	upgrades
	towersOnLevel
2010-08-22 08:57:31 +03:00

102 lines
1.7 KiB
C

#ifndef BASE_TYPES_H
#define BASE_TYPES_H
#include <QPointF>
#include <QList>
#include <QVector>
struct Alien
{
int Id; // uses for QHash
QString name;
int type;
QPointF pos;
float angle; // -180 .. 180
float speed; // cells per tick (speed=1 is 60cells by 1 sec for 60fps e.g.)
float health;
QPoint finish;
QVector <QPointF> path;
int pathIndex;
unsigned int prise;
};
struct Tower
{
QString name;
int type;
int AlienId; // aim alien
int PlayerId; // tower's owner
QPoint pos; // not QPointF because tower fixed on grid
float angle; // -180 .. 180
float range; // in cells
float reload; // time for reload in ticks
};
struct srcTrigger
{
enum triggerType
{
onDestination,
onTimer,
onAlienInRadius
};
int childId; // =-1 for non birth splash (e.q. only damage)
bool delParent;
float damage;
float radius;
triggerType type;
unsigned int timer;
int count;
float randomPosRadius;
};
struct srcSplash
{
QString name;
int imgType;
float speed; // in cells
bool autoControl;
QList <int> triggerIndexes;
};
struct srcTower
{
QString name;
int type;
int PlayerId; // tower's owner
float range; // in cells
float reload; // time for reload in ticks
QList <srcTrigger> triggers;
QList <srcSplash> splashes;
};
struct Splash
{
int Id;
QString name;
int type;
QPoint TowerId; // parent tower (-1;-1) for null parent
int AlienId; // aim alien (different from tower.AlienId)
int lifetime; // in ticks
float radius; // in cells
float angle; // -180 .. 180
QPointF pos;
};
struct Wave
{
int Id;
QList <int> types; // some types of aliens (e.g. 2 fly and 3 grount in one wave)
QList <int> counts; // count aliens of each type
int wait_time; // time in ticks
unsigned int gold;
};
#endif // BASE_TYPES_H