BWAPI
BTHAI/SCProjects/BTHAIModule/Source/UpgradesFileReader.h
Go to the documentation of this file.
00001 #ifndef __UPGRADESFILEREADER_H__
00002 #define __UPGRADESFILEREADER_H__
00003 
00004 #include <BWAPI.h>
00005 
00006 using namespace BWAPI;
00007 using namespace std;
00008 
00009 struct Tokens {
00010         string key;
00011         string value;
00012 };
00013 
00019 class UpgradesFileReader {
00020 
00021 private:
00022         bool fileExists(string filename);
00023         string getFilename();
00024         void addUpgrade(string line);
00025         void replace(string &line);
00026         int toInt(string &str);
00027         Tokens split(string line, string delimiter);
00028 
00029         vector<UpgradeType> upgradesP1;
00030         vector<UpgradeType> upgradesP2;
00031         vector<UpgradeType> upgradesP3;
00032         vector<TechType> techsP1;
00033         vector<TechType> techsP2;
00034         vector<TechType> techsP3;
00035 
00036 public:
00038         UpgradesFileReader();
00039 
00041         void readUpgrades();
00042 
00044         vector<UpgradeType> getUpgradesP1();
00046         vector<UpgradeType> getUpgradesP2();
00048         vector<UpgradeType> getUpgradesP3();
00050         vector<TechType> getTechsP1();
00052         vector<TechType> getTechsP2();
00054         vector<TechType> getTechsP3();
00055 };
00056 
00057 #endif
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Defines