X-Git-Url: https://git.jsancho.org/?p=lugaru.git;a=blobdiff_plain;f=Source%2FUser%2FAccount.hpp;h=f75a1838ddfcbb419d224601640a23f6579dd82a;hp=3c9e2e2f03b176ffa28966f3777ef7ae06204d7b;hb=380d8141271d6fa12954f6fe46e736315cffd594;hpb=3316a497b6dd2305f36099a92ae9a0a5e6a2cf7e
diff --git a/Source/User/Account.hpp b/Source/User/Account.hpp
index 3c9e2e2..f75a183 100644
--- a/Source/User/Account.hpp
+++ b/Source/User/Account.hpp
@@ -27,9 +27,9 @@ along with Lugaru. If not, see .
#include
struct CampaignProgress {
- float highscore;
+ int highscore;
float fasttime;
- float score;
+ int score;
float time;
std::vector choices;
CampaignProgress() {
@@ -58,8 +58,8 @@ public:
Account(FILE* tfile);
void endGame();
- void winCampaignLevel(int choice, float score, float time);
- void winLevel(int level, float score, float time);
+ void winCampaignLevel(int choice, int score, float time);
+ void winLevel(int level, int score, float time);
// getter and setters
int getDifficulty();
@@ -69,7 +69,7 @@ public:
const std::string& getName() {
return name;
};
- float getCampaignScore() {
+ int getCampaignScore() {
return campaignProgress[currentCampaign].score;
};
int getCampaignChoicesMade() {
@@ -80,13 +80,15 @@ public:
};
void setCampaignScore(int s) {
campaignProgress[currentCampaign].score = s;
- if (s > campaignProgress[currentCampaign].highscore)
+ if (s > campaignProgress[currentCampaign].highscore) {
campaignProgress[currentCampaign].highscore = s;
+ }
};
void setCampaignFinalTime(float t) {
campaignProgress[currentCampaign].time = t;
- if ((t < campaignProgress[currentCampaign].fasttime) || ((campaignProgress[currentCampaign].fasttime == 0) && (t != 0)))
+ if ((t < campaignProgress[currentCampaign].fasttime) || ((campaignProgress[currentCampaign].fasttime == 0) && (t != 0))) {
campaignProgress[currentCampaign].fasttime = t;
+ }
};
float getCampaignFasttime() {
return campaignProgress[currentCampaign].fasttime;
@@ -94,10 +96,10 @@ public:
void resetFasttime() {
campaignProgress[currentCampaign].fasttime = 0;
};
- float getCampaignHighScore() {
+ int getCampaignHighScore() {
return campaignProgress[currentCampaign].highscore;
};
- float getHighScore(int i) {
+ int getHighScore(int i) {
return highscore[i];
};
float getFastTime(int i) {
@@ -121,7 +123,7 @@ private:
int difficulty;
int progress; // progress in challenge levels
float points;
- float highscore[50];
+ int highscore[50];
float fasttime[50];
bool unlocked[60];
std::string name;