diff options
author | jacopograndi <jak.sk8@hotmail.it> | 2021-09-06 20:11:36 +0200 |
---|---|---|
committer | jacopograndi <jak.sk8@hotmail.it> | 2021-09-06 20:11:36 +0200 |
commit | 411d2f6d6a6e5370d33f0f54b2f2de7147a9d977 (patch) | |
tree | 82b631079a3d7226ce6384f695f2e3b213a2c635 /game/gst.h | |
parent | 522a43d16e812e10ff69747ee916918b4bd29f2f (diff) |
started ai
Diffstat (limited to 'game/gst.h')
-rw-r--r-- | game/gst.h | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -68,11 +68,20 @@ class Gst { public: Gst(Inv *inv) : inv(inv) { } + // copy constructor + Gst (const Gst& rhs) { + inv = rhs.inv; entities = rhs.entities; players = rhs.players; + turn = rhs.turn; day = rhs.day; + } + Gst& operator=(const Gst& rhs) { + inv = rhs.inv; entities = rhs.entities; players = rhs.players; + turn = rhs.turn; day = rhs.day; + }; + Inv *inv; std::vector<Entity> entities; std::vector<Player> players; - int turn { 0 }; int day { 0 }; @@ -97,6 +106,8 @@ class Gst { void heal (Entity &atk, Entity &def); void convert (Entity &atk, Entity &def); + int get_nearest_enemy (Entity &ent, int &mindist); + std::vector<int> get_possible_trains (Entity &ent); std::vector<int> get_possible_builds (Entity &ent); |