xoreos  0.0.5
probes.cpp
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 #include "src/common/ustring.h"
26 #include "src/common/filelist.h"
27 
28 #include "src/aurora/ndsrom.h"
29 
31 
34 
35 namespace Engines {
36 
37 namespace Sonic {
38 
40 private:
41  static const Common::UString kGameName;
42 
43 public:
46 
48  return Aurora::kGameIDSonic;
49  }
50 
51  const Common::UString &getGameName() const {
52  return kGameName;
53  }
54 
56  return Aurora::kPlatformNDS;
57  }
58 
60  return new SonicEngine;
61  }
62 
63  bool probe(const Common::UString &UNUSED(directory), const Common::FileList &UNUSED(rootFiles)) const {
64  return false;
65  }
66 
67  bool probe(Common::SeekableReadStream &stream) const {
68  Common::UString title, code, maker;
69  if (!Aurora::NDSFile::isNDS(stream, title, code, maker))
70  return false;
71 
72  return title == "SONICCHRON";
73  }
74 
75 };
76 
77 const Common::UString EngineProbe::kGameName = "Sonic Chronicles: The Dark Brotherhood";
78 
79 
80 void createEngineProbes(std::list<const ::Engines::EngineProbe *> &probes) {
81  probes.push_back(new EngineProbe);
82 }
83 
84 } // End of namespace Sonic
85 
86 } // End of namespace Engines
GameID
Definition: types.h:393
A class holding an UTF-8 string.
Definition: ustring.h:48
bool probe(const Common::UString &directory, const Common::FileList &rootFiles) const
Check for the game in that directory, containing these files.
Definition: probes.cpp:63
A probe that checks if an engine can handle game data found in a specific directory and creates an in...
Engine class handling Sonic Chronicles: The Dark Brotherhood.
Engines::Engine * createEngine() const
Create the respective engine for the GameID.
Definition: probes.cpp:59
#define UNUSED(x)
Definition: system.h:170
static const Common::UString kGameName
Definition: probes.cpp:41
Aurora::Platform getPlatform() const
Get the Platform that the probe is able to detect.
Definition: probes.cpp:55
const Common::UString & getGameName() const
Return a string of the full game name.
Definition: probes.cpp:51
Nintendo DS ROM parsing.
Unicode string handling.
bool probe(Common::SeekableReadStream &stream) const
Check for the game in that file.
Definition: probes.cpp:67
void createEngineProbes(std::list< const ::Engines::EngineProbe *> &probes)
Definition: probes.cpp:80
The base class for an engine within BioWare&#39;s Aurora family.
Definition: engine.h:49
A probe able to detect one specific game.
Definition: engineprobe.h:44
A list of files.
Definition: filelist.h:35
Probing for an installation of Sonic Chronicles: The Dark Brotherhood.
Nintendo DS.
Definition: types.h:436
A list of files.
static bool isNDS(Common::SeekableReadStream &stream, Common::UString &title, Common::UString &code, Common::UString &maker)
Check if a stream is a valid Nintendo DS ROM and read its title, code and maker strings.
Definition: ndsrom.cpp:122
Interface for a seekable & readable data stream.
Definition: readstream.h:265
Platform
Definition: types.h:429
Sonic Chronicles: The Dark Brotherhood.
Definition: types.h:401
Aurora::GameID getGameID() const
Get the GameID that the probe is able to detect.
Definition: probes.cpp:47