]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Account.h
Oops, committed by mistake a temporary commenting of code
[lugaru.git] / Source / Account.h
index 53d3c945cdcff93f76eff527b773ac1a85235a5f..f5b91f1e869cbc2d43566b4d5e7f30c21d6ca54c 100644 (file)
@@ -1,6 +1,6 @@
 /*
 Copyright (C) 2003, 2010 - Wolfire Games
-Copyright (C) 2010 - Côme <MCMic> BERNIGAUD
+Copyright (C) 2010-2016 - Lugaru contributors (see AUTHORS file)
 
 This file is part of Lugaru.
 
@@ -45,7 +45,7 @@ class Account
 public:
     static void destroy(int i);
     static Account* destroy(Account* a);
-    static Account* add(std::string name);
+    static Account* add(const std::string& name);
     static Account* get(int i);
     static Account* loadFile(std::string filename);
     static void saveFile(std::string filename, Account* accountactive);
@@ -60,8 +60,8 @@ public:
     void setDifficulty(int i) {
         difficulty = i;
     };
-    const char* getName() {
-        return name.c_str();
+    const std::string& getName() {
+        return name;
     };
     float getCampaignScore() {
         return campaignProgress[currentCampaign].score;
@@ -103,13 +103,13 @@ public:
     std::string getCurrentCampaign() {
         return currentCampaign;
     };
-    void setCurrentCampaign(std::string name);
+    void setCurrentCampaign(const std::string& name);
 
     static int getNbAccounts() {
         return accounts.size();
     };
 private:
-    Account(std::string n = "");
+    Account(const std::string& name = "");
     int difficulty;
     int progress; // progress in challenge levels
     float points;