X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FAccount.h;h=7d550e81e7534597a6f0161a349aa1739a0fe187;hb=8afdcba610cded0e54b85069ba051268b29669a6;hp=3cf94dd0879178fa425fe922a42c0697fa79ccc8;hpb=e31b70325214fa5bdd433c1fd2aa96a1eb6c6684;p=lugaru.git diff --git a/Source/Account.h b/Source/Account.h index 3cf94dd..7d550e8 100644 --- a/Source/Account.h +++ b/Source/Account.h @@ -1,6 +1,6 @@ /* Copyright (C) 2003, 2010 - Wolfire Games -Copyright (C) 2010 - MCMic +Copyright (C) 2010 - Côme BERNIGAUD This file is part of Lugaru. @@ -25,8 +25,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include +#include #include +struct CampaignProgress { + float highscore; + float fasttime; + float score; + float time; + std::vector choices; + CampaignProgress() { + highscore = 0; + fasttime = 0; + score = 0; + time = 0; + } +}; class Account { public: @@ -46,42 +60,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 campaignchoicesmade; }; - 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 campaignProgress; //statics static std::vector accounts;