]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Account.h
Stopped using Account pointers, and removed general difficulty setting (difficulty...
[lugaru.git] / Source / Account.h
index dcaba951469fc03afdbacd556d1792775b31a8a1..385c6fa5fb42aea59e9015a82a691c8518be53b5 100644 (file)
@@ -46,7 +46,7 @@ public:
     static void destroyActive();
     static void setActive(int i);
     static void add(const std::string& name);
-    static Account* get(int i);
+    static Account& get(int i);
     static void loadFile(std::string filename);
     static void saveFile(std::string filename);
     static int getNbAccounts();
@@ -54,6 +54,9 @@ public:
     static bool hasActive();
     static Account& active();
 
+    Account(const std::string& name = "");
+    Account(FILE* tfile);
+
     void endGame();
     void winCampaignLevel(int choice, float score, float time);
     void winLevel(int level, float score, float time);
@@ -110,10 +113,11 @@ public:
 
 private:
     //statics
-    static std::vector<Account*> accounts;
+    static std::vector<Account> accounts;
     static int i_active;
 
-    Account(const std::string& name = "");
+    void save(FILE* tfile);
+
     int difficulty;
     int progress; // progress in challenge levels
     float points;