diff options
Diffstat (limited to 'include/cardeval.hpp')
-rw-r--r-- | include/cardeval.hpp | 57 |
1 files changed, 52 insertions, 5 deletions
diff --git a/include/cardeval.hpp b/include/cardeval.hpp index 5fc507e..832047b 100644 --- a/include/cardeval.hpp +++ b/include/cardeval.hpp @@ -13,6 +13,8 @@ #ifndef CARDEVAL_INCL #define CARDEVAL_INCL +#define MAX_MANA 10 + // necessary standard includes #include <cstdio> #include <cstdlib> @@ -26,6 +28,24 @@ // external libraries #include <tinyxml2.h> +namespace cardeval { + +struct atk_health { + double atk; + double health; + + atk_health() { + atk = 0; + health = 0; + } + + std::string prnt_str() { + std::stringstream ss; + ss << "(" << atk << ", " << health << ")"; + return ss.str(); + } +}; + // structure that stores card information struct card_struct { // booleans to be set to determine card @@ -41,6 +61,8 @@ struct card_struct { int health; int rarity; + double value; + // extra card abilities such as charge or battlecry std::string abilities; std::string card_name; @@ -60,15 +82,18 @@ struct card_struct { health = -1; rarity = -1; + value = -1; + // empty strings abilities = ""; card_name = ""; - class_name = ""; + class_name = "neutral"; } std::string card_print_format() { + std::stringstream ss; - ss << card_name << " (Rarity: " << rarity << "):\n\tCost: " << cost << ", Attack: " << attack << ", Health: " << health << ", Durability: " << durability << "\n\tClass: " << class_name << "\n\tAbilities: " << abilities << std::endl; + ss << card_name << " (Rarity: " << rarity << "):\n\tCost: " << cost << ", Attack: " << attack << ", Health: " << health << ", Durability: " << durability << ", Value: " << value << "\n\tClass: " << class_name << "\n\tAbilities: " << abilities << std::endl; return ss.str(); } }; @@ -83,9 +108,16 @@ public: // default deconstructor ~CardEval(); + void print_cards(std::string card_str); + void print_stat_average(); + void set_minions(std::vector<card_struct> &card_info); + void set_spells(std::vector<card_struct> &card_info); + void set_weapons(std::vector<card_struct> &card_info); + void set_avg_stats(std::vector<atk_health> &stat_avg); +protected: // gets the cards from the xml file and saves them in memory for easy usability inside the program with all the information in a struct void get_cards(); -protected: + void get_stat_average(); // exits the program with an error void exit_with_error(); // adds the card to a vector that it belongs to @@ -96,7 +128,7 @@ protected: // gets the class of the card and returns the class name std::string get_class(std::string class_str); // assigns the values to the card struct which can then be added to the vectors - card_struct set_card_info(tinyxml2::XMLElement* tag_it); + void set_card_info(tinyxml2::XMLElement* tag_it, card_struct &curr_card); private: // variable that holds the xml document in memory tinyxml2::XMLDocument card_doc; @@ -108,6 +140,21 @@ private: std::vector<card_struct> heroes; std::vector<card_struct> hero_powers; std::vector<card_struct> random; -}; + + // contains all the averages of the card stats + std::vector<atk_health> card_avg_stats; +}; // Cardeval + +class TextAnalysis { +public: + TextAnalysis(); + ~TextAnalysis(); + + void get_limited_text(std::string &lim_text, std::string &text_limiter, std::string &text_limiter_close); +protected: +private: +}; // TextAnalysis + +} // cardeval #endif |