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/player.h | |
parent | 411d2f6d6a6e5370d33f0f54b2f2de7147a9d977 (diff) |
linux compile and imgs
Diffstat (limited to 'game/player.h')
-rw-r--r-- | game/player.h | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/game/player.h b/game/player.h index cf4146f..c29ea7e 100644 --- a/game/player.h +++ b/game/player.h @@ -1,46 +1,46 @@ -#ifndef PLAYER_H -#define PLAYER_H - -#include <vector> - -#include "tech.h" - - -class Player { - public: - Player (int r, int g, int b, int id) : r(r), g(g), b(b), id(id) { } - - void pay (std::vector<float> cost) { - for (int i=0; i<res.size(); i++) { - res[i] -= cost[i]; - } - } - void gain (std::vector<float> gain) { - for (int i=0; i<res.size(); i++) { - res[i] += gain[i]; - } - } - - bool has_tech (int id) { - if (std::find(techs.begin(), techs.end(), id) != techs.end()) - return true; - return false; - } - - bool operator== (Player &oth) { return id == oth.id; } - - int id; - - std::vector<float> res { 0, 0 }; - std::vector<int> techs; - - TechLookup tech_lookup; - - int researching { -1 }; - int leveling_up { -1 }; - int level { 0 }; - - int r, g, b; -}; - +#ifndef PLAYER_H
+#define PLAYER_H
+
+#include <vector>
+
+#include "tech.h"
+
+
+class Player {
+ public:
+ Player (int r, int g, int b, int id) : r(r), g(g), b(b), id(id) { }
+
+ void pay (std::vector<float> cost) {
+ for (int i=0; i<res.size(); i++) {
+ res[i] -= cost[i];
+ }
+ }
+ void gain (std::vector<float> gain) {
+ for (int i=0; i<res.size(); i++) {
+ res[i] += gain[i];
+ }
+ }
+
+ bool has_tech (int id) {
+ if (std::find(techs.begin(), techs.end(), id) != techs.end())
+ return true;
+ return false;
+ }
+
+ bool operator== (Player &oth) { return id == oth.id; }
+
+ int id;
+
+ std::vector<float> res { 0, 0 };
+ std::vector<int> techs;
+
+ TechLookup tech_lookup;
+
+ int researching { -1 };
+ int leveling_up { -1 };
+ int level { 0 };
+
+ int r, g, b;
+};
+
#endif
\ No newline at end of file |