aboutsummaryrefslogtreecommitdiff
path: root/game/entity.h
diff options
context:
space:
mode:
Diffstat (limited to 'game/entity.h')
-rw-r--r--game/entity.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/game/entity.h b/game/entity.h
index 50c7acc..8f61cee 100644
--- a/game/entity.h
+++ b/game/entity.h
@@ -13,6 +13,9 @@ class EntityInfo {
public:
EntityInfo() { spritebounds = vec2 { 16*6, 16 }; }
+ enum Class { inf, cav, ran, sie, bld };
+ Class ent_class;
+
std::string name;
int id;
@@ -27,21 +30,23 @@ class EntityInfo {
int unit;
std::vector<int> abilities;
std::vector<int> build;
- std::vector<int> train;
+ std::vector<int> train_id;
+ std::vector<Class> train_class;
std::vector<float> prod { 0, 0 };
std::vector<float> cost { 0, 0 };
std::vector<int> adjacent;
-
+ float defence_bonus { 0 };
int upgrade { -1 };
- enum Class { inf, cav, ran, sie, bld };
- Class ent_class;
-
vec2 spritebounds;
};
+namespace EntityClass {
+ int from_string(std::string str);
+}
+
class Entity {
public:
Entity(int x, int y, EntityInfo *info, int owner)
@@ -58,6 +63,7 @@ class Entity {
bool done = false;
int moved;
EntityInfo *info;
+ int fights { 0 };
int owner;
};