supertux
profile.hpp
1 // SuperTux
2 // Copyright (C) 2023 Vankata453
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 
17 #ifndef HEADER_SUPERTUX_SUPERTUX_PROFILE_HPP
18 #define HEADER_SUPERTUX_SUPERTUX_PROFILE_HPP
19 
20 #include <memory>
21 #include <string>
22 
23 class ReaderMapping;
24 
26 class Profile final
27 {
28 public:
29  Profile(int id);
30 
31 public:
32  void save();
33  void reset();
34 
35  void create_basedir();
36  std::string get_basedir() const;
37 
38  int get_id() const { return m_id; }
39  const std::string& get_name() const { return m_name; }
40  const std::string& get_last_world() const { return m_last_world; }
41 
42  void set_name(const std::string& name) { m_name = name; }
43  void set_last_world(const std::string& world) { m_last_world = world; }
44 
45 private:
46  const int m_id;
47 
48  std::string m_name;
49  std::string m_last_world;
50 
51 private:
52  Profile(const Profile&) = delete;
53  Profile& operator=(const Profile&) = delete;
54 };
55 
56 #endif
57 
58 /* EOF */
Contains general data about a profile, which preserves savegames.
Definition: profile.hpp:26
Definition: reader_mapping.hpp:32