aboutsummaryrefslogtreecommitdiff
path: root/game/ai/action.h
diff options
context:
space:
mode:
authorjacopograndi <jacopo.grandi@outlook.it>2022-01-04 13:35:02 +0100
committerjacopograndi <jacopo.grandi@outlook.it>2022-01-04 13:35:02 +0100
commitbb16c32bde58cba70e4877aa2d3ebd04332eb575 (patch)
treede3d82cca043c26cbaa64837a3b2c18efc6ddb64 /game/ai/action.h
parent411d2f6d6a6e5370d33f0f54b2f2de7147a9d977 (diff)
linux compile and imgs
Diffstat (limited to 'game/ai/action.h')
-rw-r--r--game/ai/action.h102
1 files changed, 51 insertions, 51 deletions
diff --git a/game/ai/action.h b/game/ai/action.h
index 12da451..6b631ca 100644
--- a/game/ai/action.h
+++ b/game/ai/action.h
@@ -1,52 +1,52 @@
-#ifndef ACTION_H
-#define ACTION_H
-
-#include <string>
-#include <vector>
-
-namespace ai {
-
-enum actype {
- attack, heal, convert, build, train, trade, move, tech
-};
-
-class action {
- public:
- action (actype type, int v) :
- type(type), v(v) {}
- action (actype type, int x, int y, int v) :
- type(type), x(x), y(y), v(v) {}
- action (actype type, int x, int y, int mx, int my) :
- type(type), x(x), y(y), mx(mx), my(my) {}
- action (actype type, int x, int y, int mx, int my, int v) :
- type(type), x(x), y(y), mx(mx), my(my), v(v) {}
- action (actype type, int x, int y, int mx, int my, int tx, int ty) :
- type(type), x(x), y(y), mx(mx), my(my), tx(tx), ty(ty) {}
- action (actype type, int x, int y, int mx, int my, int tx, int ty, int v) :
- type(type), x(x), y(y), mx(mx), my(my), tx(tx), ty(ty), v(v) {}
-
- action (const action& rhs) {
- type = rhs.type; x = rhs.x; y = rhs.y; mx = rhs.mx; my = rhs.my;
- tx = rhs.tx; ty = rhs.ty; v = rhs.v;
- }
- action& operator=(const action& rhs) {
- type = rhs.type; x = rhs.x; y = rhs.y; mx = rhs.mx; my = rhs.my;
- tx = rhs.tx; ty = rhs.ty; v = rhs.v;
- }
-
- actype type;
- int x, y; // start
- int mx, my; // moved
- int tx, ty; // target
- int v; // value (id of trainee, building or f/g trade, or tech id)
-
- float heuristic { 0 };
-
- std::string to_string ();
-};
-
-bool compare_action(action a, action b);
-
-}
-
+#ifndef ACTION_H
+#define ACTION_H
+
+#include <string>
+#include <vector>
+
+namespace ai {
+
+enum actype {
+ attack, heal, convert, build, train, trade, move, tech
+};
+
+class action {
+ public:
+ action (actype type, int v) :
+ type(type), v(v) {}
+ action (actype type, int x, int y, int v) :
+ type(type), x(x), y(y), v(v) {}
+ action (actype type, int x, int y, int mx, int my) :
+ type(type), x(x), y(y), mx(mx), my(my) {}
+ action (actype type, int x, int y, int mx, int my, int v) :
+ type(type), x(x), y(y), mx(mx), my(my), v(v) {}
+ action (actype type, int x, int y, int mx, int my, int tx, int ty) :
+ type(type), x(x), y(y), mx(mx), my(my), tx(tx), ty(ty) {}
+ action (actype type, int x, int y, int mx, int my, int tx, int ty, int v) :
+ type(type), x(x), y(y), mx(mx), my(my), tx(tx), ty(ty), v(v) {}
+
+ action (const action& rhs) {
+ type = rhs.type; x = rhs.x; y = rhs.y; mx = rhs.mx; my = rhs.my;
+ tx = rhs.tx; ty = rhs.ty; v = rhs.v;
+ }
+ action& operator=(const action& rhs) {
+ type = rhs.type; x = rhs.x; y = rhs.y; mx = rhs.mx; my = rhs.my;
+ tx = rhs.tx; ty = rhs.ty; v = rhs.v;
+ }
+
+ actype type;
+ int x, y; // start
+ int mx, my; // moved
+ int tx, ty; // target
+ int v; // value (id of trainee, building or f/g trade, or tech id)
+
+ float heuristic { 0 };
+
+ std::string to_string ();
+};
+
+bool compare_action(action a, action b);
+
+}
+
#endif \ No newline at end of file