X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FUser%2FAccount.hpp;h=0b52531567babd8efa78dcb49b4dce4eab92154c;hb=217da32c9ec772214e6cdbf238224aa930f819df;hp=3c9e2e2f03b176ffa28966f3777ef7ae06204d7b;hpb=ed3662c0852c4312a612b4fc35bd03aba8d13db7;p=lugaru.git diff --git a/Source/User/Account.hpp b/Source/User/Account.hpp index 3c9e2e2..0b52531 100644 --- a/Source/User/Account.hpp +++ b/Source/User/Account.hpp @@ -1,6 +1,6 @@ /* Copyright (C) 2003, 2010 - Wolfire Games -Copyright (C) 2010-2016 - Lugaru contributors (see AUTHORS file) +Copyright (C) 2010-2017 - Lugaru contributors (see AUTHORS file) This file is part of Lugaru. @@ -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;