xoreos  0.0.5
savedgame.h
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 #ifndef ENGINES_KOTOR_SAVEDGAME_H
26 #define ENGINES_KOTOR_SAVEDGAME_H
27 
28 #include "src/common/scopedptr.h"
29 #include "src/common/ustring.h"
30 
31 #include "src/aurora/erffile.h"
32 #include "src/aurora/gff3file.h"
33 
35 
36 namespace Engines {
37 
38 namespace KotOR {
39 
40 class SavedGame {
41 public:
47  static SavedGame *load(const Common::UString &dir, bool loadSav = false);
48 
49  SavedGame();
50  const Common::UString &getName() const;
51  const Common::UString &getModuleName() const;
52  uint32 getTimePlayed() const;
53  Creature *getPC();
54  bool isPCLoaded() const;
55 private:
56  static void fillFromNFO(const Aurora::GFF3File &gff, SavedGame *save);
57 
58  static void fillFromSAV(const Aurora::ERFFile &erf,
59  const Common::UString &moduleName, SavedGame *save);
60 
61  static void fillFromModuleSAV(const Aurora::ERFFile &erf, SavedGame *save);
62  static void fillFromModuleIFO(const Aurora::GFF3File &gff, SavedGame *save);
63 
68  float _pcPosition[3];
69  bool _pcLoaded;
71 };
72 
73 } // End of namespace KotOR
74 
75 } // End of namespace Engines
76 
77 #endif // ENGINES_KOTOR_SAVEDGAME_H
A creature in a Star Wars: Knights of the Old Republic area.
Handling version V3.2/V3.3 of BioWare&#39;s GFFs (generic file format).
A class holding an UTF-8 string.
Definition: ustring.h:48
static void fillFromSAV(const Aurora::ERFFile &erf, const Common::UString &moduleName, SavedGame *save)
Definition: savedgame.cpp:63
uint8_t uint8
Definition: types.h:200
uint32 getTimePlayed() const
Definition: savedgame.cpp:131
Common::UString _name
Definition: savedgame.h:64
A simple scoped smart pointer template.
Common::UString _moduleName
Definition: savedgame.h:65
static void fillFromModuleSAV(const Aurora::ERFFile &erf, SavedGame *save)
Definition: savedgame.cpp:84
A GFF (generic file format) V3.2/V3.3 file, found in all Aurora games except Sonic Chronicles: The Da...
Definition: gff3file.h:85
Handling BioWare&#39;s ERFs (encapsulated resource file).
const Common::UString & getName() const
Definition: savedgame.cpp:123
Unicode string handling.
Class to hold resource data of an ERF archive file.
Definition: erffile.h:105
uint32_t uint32
Definition: types.h:204
static SavedGame * load(const Common::UString &dir, bool loadSav=false)
Load saved game from a specified directory.
Definition: savedgame.cpp:38
const Common::UString & getModuleName() const
Definition: savedgame.cpp:127
static void fillFromNFO(const Aurora::GFF3File &gff, SavedGame *save)
Definition: savedgame.cpp:56
static void fillFromModuleIFO(const Aurora::GFF3File &gff, SavedGame *save)
Definition: savedgame.cpp:104