X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FAccount.h;h=acd285061266b722d939bd3146425f65a36b21d8;hb=2cd28eb24fc1b4011511b6c3ed8c025bfc74de4d;hp=24b856fbfb2c513b13df1a11964bd1f882ae43f4;hpb=8dc129dea5d2e07366cbec76752ab32154fd06b4;p=lugaru.git diff --git a/Source/Account.h b/Source/Account.h index 24b856f..acd2850 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,22 +54,22 @@ 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;