diff options
author | jacopograndi <jak.sk8@hotmail.it> | 2021-08-29 13:57:41 +0200 |
---|---|---|
committer | jacopograndi <jak.sk8@hotmail.it> | 2021-08-29 13:57:41 +0200 |
commit | ace5c3f3093c50ff7fa6f8b281a377e3788abbd5 (patch) | |
tree | 8a52803dc2b777822e9b1cab148bec8798bfeadf /game/entity.h | |
parent | a8bcacc95045102e67f2feabbdddf79535837554 (diff) |
adding techs
Diffstat (limited to 'game/entity.h')
-rw-r--r-- | game/entity.h | 35 |
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; }; |