]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Account.h
console commands works again.
[lugaru.git] / Source / Account.h
index acd285061266b722d939bd3146425f65a36b21d8..7d550e81e7534597a6f0161a349aa1739a0fe187 100644 (file)
@@ -28,13 +28,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include <map>
 #include <fstream>
 
-typedef struct {
+struct CampaignProgress {
        float highscore;
        float fasttime;
        float score;
        float time;
        std::vector<int> choices;
-} campaign_progress_t;
+       CampaignProgress() {
+               highscore = 0;
+               fasttime = 0;
+               score = 0;
+               time = 0;
+       }
+};
 
 class Account {
        public:
@@ -73,6 +79,8 @@ class Account {
                float getHighScore(int i) { return highscore[i]; };
                float getFastTime(int i) { return fasttime[i]; };
                int getProgress() { return progress; };
+               std::string getCurrentCampaign() { return currentCampaign; };
+               void setCurrentCampaign(std::string name);
                
                static int getNbAccounts() { return accounts.size(); };
        private:
@@ -86,7 +94,7 @@ class Account {
                std::string name;
                
                std::string currentCampaign;
-               std::map<std::string,campaign_progress_t> campaignProgress;
+               std::map<std::string,CampaignProgress> campaignProgress;
        
        //statics
                static std::vector<Account*> accounts;