#ifndef BASE_TYPES_H #define BASE_TYPES_H #include #include #include #include #include #include #include #include #include #include #include #include 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 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 TriggerType { int src; unsigned int timer; }; 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 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 triggers; QList 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; QList triggers; }; struct WaveType { int Id; QList types; // some types of aliens (e.g. 2 fly and 3 grount in one wave) QList counts; // count aliens of each type unsigned int timeout; // time in ticks unsigned int prise; }; inline uint qHash(const QPoint &pos) { return qHash(pos.x()) + (qHash(pos.y()) << 16); } #endif // BASE_TYPES_H