aboutsummaryrefslogtreecommitdiff
path: root/game/entity.h
diff options
context:
space:
mode:
Diffstat (limited to 'game/entity.h')
-rw-r--r--game/entity.h35
1 files changed, 27 insertions, 8 deletions
diff --git a/game/entity.h b/game/entity.h
index 1fcf026..36c8198 100644
--- a/game/entity.h
+++ b/game/entity.h
@@ -4,12 +4,10 @@
#include <vector>
#include <string>
+#include <iostream>
+
#include "../umath/vec2.h"
-class Ability {
- public:
- Ability();
-};
class EntityInfo {
public:
@@ -17,25 +15,46 @@ class EntityInfo {
std::string name;
+ int id;
+
float hp;
float attack;
float defence;
int range;
float sight;
int move;
- std::vector<Ability> abilities;
+ int unit;
+ std::vector<int> abilities;
+ std::vector<int> build;
+ std::vector<int> train;
+
+ std::vector<int> prod { 0, 0 };
+ std::vector<int> cost { 0, 0 };
+
+ std::vector<int> adjacent;
+
+ enum Class { inf, cav, ran, sie, bld };
+ Class ent_class;
vec2 spritebounds;
};
class Entity {
public:
- Entity(int x, int y, EntityInfo &info, int owner)
- : x(x), y(y), info(info), owner(owner) {}
+ Entity(int x, int y, EntityInfo *info, int owner)
+ : x(x), y(y), info(info), owner(owner) { moved = 0; hp = 100; }
+
+
+ bool operator==(Entity oth) {
+ return x == oth.x && y == oth.y && info->unit == oth.info->unit;
+ }
+ int building = 0;
+ float hp; /**/
int x, y;
bool done = false;
- EntityInfo &info;
+ int moved;
+ EntityInfo *info;
int owner;
};