]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Account.h
Replaced all uses of Account::active outside of Account by call to active() method
[lugaru.git] / Source / Account.h
index f5b91f1e869cbc2d43566b4d5e7f30c21d6ca54c..f9bc5e1654940c614acfa9cda7b40309dee66534 100644 (file)
@@ -43,14 +43,18 @@ struct CampaignProgress {
 class Account
 {
 public:
-    static void destroy(int i);
-    static Account* destroy(Account* a);
-    static Account* add(const std::string& name);
+    static void destroyActive();
+    static void setActive(int i);
+    static void add(const std::string& name);
     static Account* get(int i);
-    static Account* loadFile(std::string filename);
-    static void saveFile(std::string filename, Account* accountactive);
+    static void loadFile(std::string filename);
+    static void saveFile(std::string filename);
     static int indice(Account* a);
 
+    static bool hasActive() { return (_active != nullptr); }
+    static Account& active() { return *_active; }
+    static Account* _active;
+
     void endGame();
     void winCampaignLevel(int choice, float score, float time);
     void winLevel(int level, float score, float time);