From bb16c32bde58cba70e4877aa2d3ebd04332eb575 Mon Sep 17 00:00:00 2001 From: jacopograndi Date: Tue, 4 Jan 2022 13:35:02 +0100 Subject: linux compile and imgs --- game/tech.h | 262 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 131 insertions(+), 131 deletions(-) (limited to 'game/tech.h') diff --git a/game/tech.h b/game/tech.h index b22b173..d5a9e24 100644 --- a/game/tech.h +++ b/game/tech.h @@ -1,132 +1,132 @@ -#ifndef TECH_H -#define TECH_H - -#include -#include -#include - -#include - -#include - -#include "../umath/vec2.h" - -class TechBonus { - public: - float attack { 0 }; - float defence { 0 }; - int sight { 0 }; - int range { 0 }; - int move { 0 }; - std::vector cost { 0, 0 }; - std::vector cost_abs { 0, 0 }; - std::vector prod { 0, 0 }; - int trade { 0 } ; - int improved_heal { 0 }; - int improved_convert { 0 }; - int req_range { 999 }; - - std::vector aff_id; - std::vector aff_class; - int aff_level { -1 }; - int aff_all { 0 }; - - TechBonus operator+(const TechBonus &rhs) { - TechBonus b; - b.attack = attack + rhs.attack; - b.defence = defence + rhs.defence; - b.sight = sight + rhs.sight; - b.move = move + rhs.move; - for (int i=0; i 0) { - str += "of entitiy "; - for (int id : aff_id) str += std::to_string(id) + " "; - str += "\n"; - } - if (aff_class.size() > 0) { - str += "of class "; - for (int c : aff_class) str += std::to_string(c) + " "; - str += "\n"; - } - if (aff_level != -1) { - str += "of level " + std::to_string(aff_level) + "\n"; - } - return str; - } -}; - -class TechLookup { - public: - TechLookup() {} - - TechBonus id (int i) { return map_id[i]; } - - std::unordered_map map_id; -}; - -class Tech { - public: - Tech() {} - - std::string name; - int id; - int level; - int req_id; - std::vector cost { 0, 0 }; - - TechBonus bonus; - - vec2 spritebounds { 0, 0 }; -}; - +#ifndef TECH_H +#define TECH_H + +#include +#include +#include + +#include + +#include + +#include "../umath/vec2.h" + +class TechBonus { + public: + float attack { 0 }; + float defence { 0 }; + int sight { 0 }; + int range { 0 }; + int move { 0 }; + std::vector cost { 0, 0 }; + std::vector cost_abs { 0, 0 }; + std::vector prod { 0, 0 }; + int trade { 0 } ; + int improved_heal { 0 }; + int improved_convert { 0 }; + int req_range { 999 }; + + std::vector aff_id; + std::vector aff_class; + int aff_level { -1 }; + int aff_all { 0 }; + + TechBonus operator+(const TechBonus &rhs) { + TechBonus b; + b.attack = attack + rhs.attack; + b.defence = defence + rhs.defence; + b.sight = sight + rhs.sight; + b.move = move + rhs.move; + for (int i=0; i 0) { + str += "of entitiy "; + for (int id : aff_id) str += std::to_string(id) + " "; + str += "\n"; + } + if (aff_class.size() > 0) { + str += "of class "; + for (int c : aff_class) str += std::to_string(c) + " "; + str += "\n"; + } + if (aff_level != -1) { + str += "of level " + std::to_string(aff_level) + "\n"; + } + return str; + } +}; + +class TechLookup { + public: + TechLookup() {} + + TechBonus id (int i) { return map_id[i]; } + + std::unordered_map map_id; +}; + +class Tech { + public: + Tech() {} + + std::string name; + int id; + int level; + int req_id; + std::vector cost { 0, 0 }; + + TechBonus bonus; + + vec2 spritebounds { 0, 0 }; +}; + #endif \ No newline at end of file -- cgit v1.2.3-54-g00ecf