X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FAccount.h;h=599384cea8a8718faaf9b4a97ee16537c1403ee0;hb=710fa624080c2f2db7923832e2fd9945f4dd8254;hp=24b856fbfb2c513b13df1a11964bd1f882ae43f4;hpb=54cbb28b51da68b2280068a41e7964f78dec6858;p=lugaru.git diff --git a/Source/Account.h b/Source/Account.h index 24b856f..599384c 100644 --- a/Source/Account.h +++ b/Source/Account.h @@ -25,8 +25,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include +#include #include +typedef struct { + float highscore; + float fasttime; + float score; + float time; + std::vector choices; +} campaign_progress_t; class Account { public: @@ -46,41 +54,41 @@ class Account { int getDifficulty(); void setDifficulty(int i) { difficulty = i; }; const char* getName() { return name.c_str(); }; - float getCampaignScore() { return campaignscore; }; - int getCampaignChoicesMade() { return campaignchoices.size(); }; - int getCampaignChoice(int i) { return campaignchoices[i]; }; + float getCampaignScore() { return campaignProgress[currentCampaign].score; }; + int getCampaignChoicesMade() { return campaignProgress[currentCampaign].choices.size(); }; + int getCampaignChoice(int i) { return campaignProgress[currentCampaign].choices[i]; }; void setCampaignScore(int s) { - campaignscore=s; - if(s>campaignhighscore) - campaignhighscore=s; + campaignProgress[currentCampaign].score=s; + if(s>campaignProgress[currentCampaign].highscore) + campaignProgress[currentCampaign].highscore=s; }; void setCampaignFinalTime(float t) { - campaigntime = t; - if((t campaignchoices; + + std::string currentCampaign; + std::map campaignProgress; //statics static std::vector accounts;