diff options
author | jacopograndi <jacopo.grandi@outlook.it> | 2022-01-04 13:35:02 +0100 |
---|---|---|
committer | jacopograndi <jacopo.grandi@outlook.it> | 2022-01-04 13:35:02 +0100 |
commit | bb16c32bde58cba70e4877aa2d3ebd04332eb575 (patch) | |
tree | de3d82cca043c26cbaa64837a3b2c18efc6ddb64 /game/ai/evaluator.h | |
parent | 411d2f6d6a6e5370d33f0f54b2f2de7147a9d977 (diff) |
linux compile and imgs
Diffstat (limited to 'game/ai/evaluator.h')
-rw-r--r-- | game/ai/evaluator.h | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/game/ai/evaluator.h b/game/ai/evaluator.h index 75684de..b288076 100644 --- a/game/ai/evaluator.h +++ b/game/ai/evaluator.h @@ -1,30 +1,30 @@ -#ifndef EVALUATOR_H -#define EVALUATOR_H - -#include <iostream> - -#include <string> -#include <vector> - -#include "../ground.h" -#include "../gst.h" - -namespace ai { - -class evaluator { - public: - evaluator (Gst gst) : gst(gst) {} - Gst gst; - - float eval (int player) { - float val = 0; - for (Entity &ent : gst.entities) { - int own = (int)(ent.owner != player)*2-1; - val += own*(ent.info->cost[0] + ent.info->cost[1])*(ent.hp/100.0f); - } - return val; - } -}; - -} +#ifndef EVALUATOR_H
+#define EVALUATOR_H
+
+#include <iostream>
+
+#include <string>
+#include <vector>
+
+#include "../ground.h"
+#include "../gst.h"
+
+namespace ai {
+
+class evaluator {
+ public:
+ evaluator (Gst gst) : gst(gst) {}
+ Gst gst;
+
+ float eval (int player) {
+ float val = 0;
+ for (Entity &ent : gst.entities) {
+ int own = (int)(ent.owner != player)*2-1;
+ val += own*(ent.info->cost[0] + ent.info->cost[1])*(ent.hp/100.0f);
+ }
+ return val;
+ }
+};
+
+}
#endif
\ No newline at end of file |