Files
aliendefender/base_types.h
buull 191e5ed1a1 I think finished structures
and some changes in loading
and changes in map class
we have 2 TODO now
2010-08-22 21:55:29 +03:00

123 lines
2.0 KiB
C

#ifndef BASE_TYPES_H
#define BASE_TYPES_H
#include <QPointF>
#include <QList>
#include <QVector>
struct AlienType
{
int Id; // uses for QHash
int src;
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;
int imgType;
};
struct srcAlienType
{
QString name;
float speed;
float health;
float armor;
float regeneration;
bool isFlying;
unsigned int score;
int imgType;
unsigned int prise;
};
struct TowerType
{
int src;
int aim; // aim alien Id
int oldAim;
int PlayerId; // tower's owner
int imgType;
QPoint pos; // not QPointF because tower fixed on grid
float angle; // -180 .. 180
unsigned int reload; // time for reload in ticks
unsigned int build;
};
struct srcTriggerType
{
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 srcSplashType
{
QString name;
int imgType;
float speed; // in cells
int lifetime;
bool autoControl;
QList <int> triggerIndexes;
};
struct srcTowerType
{
QString name;
int imgType;
int PlayerId; // tower's owner
unsigned int cost;
unsigned int reload;
unsigned int buildTime;
float radius; // in cells
float expByShot;
float expByKill;
float expByDamage;
QList <srcTriggerType> triggers;
QList <srcSplashType> splashes;
};
struct SplashType
{
int Id;
int imgType;
int src;
QPoint TowerId; // parent tower (-1;-1) for null parent
int AlienId; // aim alien (different from tower.AlienId)
QPointF destination;
int life; // in ticks
float angle; // -180 .. 180
QPointF pos;
};
struct WaveType
{
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
unsigned int timeout; // time in ticks
unsigned int prise;
};
#endif // BASE_TYPES_H