ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

game.h

Go to the documentation of this file.
00001 /* ScummVM - Graphic Adventure Engine
00002  *
00003  * ScummVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the COPYRIGHT
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #ifndef ENGINES_GAME_H
00024 #define ENGINES_GAME_H
00025 
00026 #include "common/array.h"
00027 #include "common/hash-str.h"
00028 #include "common/str.h"
00029 #include "common/str-array.h"
00030 #include "common/language.h"
00031 #include "common/platform.h"
00032 
00039 struct PlainGameDescriptor {
00040     const char *gameId;
00041     const char *description;
00042 
00043     static PlainGameDescriptor empty();
00044     static PlainGameDescriptor of(const char *gameId, const char *description);
00045 };
00046 
00052 const PlainGameDescriptor *findPlainGameDescriptor(const char *gameid, const PlainGameDescriptor *list);
00053 
00054 class PlainGameList : public Common::Array<PlainGameDescriptor> {
00055 public:
00056     PlainGameList() {}
00057     PlainGameList(const PlainGameList &list) : Common::Array<PlainGameDescriptor>(list) {}
00058     PlainGameList(const PlainGameDescriptor *g) {
00059         while (g->gameId) {
00060             push_back(*g);
00061             g++;
00062         }
00063     }
00064 };
00065 
00069 struct QualifiedGameDescriptor {
00070     Common::String engineId;
00071     Common::String gameId;
00072     Common::String description;
00073 
00074     QualifiedGameDescriptor() {}
00075     QualifiedGameDescriptor(const char *engine, const PlainGameDescriptor &pgd);
00076 };
00077 
00078 typedef Common::Array<QualifiedGameDescriptor> QualifiedGameList;
00079 
00083 enum GameSupportLevel {
00084     kStableGame = 0, // the game is fully supported
00085     kTestingGame, // the game is not supposed to end up in releases yet but is ready for public testing
00086     kUnstableGame // the game is not even ready for public testing yet
00087 };
00088 
00089 
00094 struct FileProperties {
00095     int32 size;
00096     Common::String md5;
00097 
00098     FileProperties() : size(-1) {}
00099 };
00100 
00104 typedef Common::HashMap<Common::String, FileProperties, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> FilePropertiesMap;
00105 
00113 struct DetectedGame {
00114     DetectedGame();
00115     DetectedGame(const Common::String &engine, const PlainGameDescriptor &pgd);
00116     DetectedGame(const Common::String &engine, const Common::String &id,
00117                    const Common::String &description,
00118                    Common::Language language = Common::UNK_LANG,
00119                    Common::Platform platform = Common::kPlatformUnknown,
00120                    const Common::String &extra = Common::String());
00121 
00122     void setGUIOptions(const Common::String &options);
00123     void appendGUIOptions(const Common::String &str);
00124     const Common::String &getGUIOptions() const { return _guiOptions; }
00125 
00126     Common::String engineId;
00127 
00136     bool hasUnknownFiles;
00137 
00141     FilePropertiesMap matchedFiles;
00142 
00148     bool canBeAdded;
00149 
00150     Common::String gameId;
00151     Common::String preferredTarget;
00152     Common::String description;
00153     Common::Language language;
00154     Common::Platform platform;
00155     Common::String path;
00156     Common::String shortPath;
00157     Common::String extra;
00158 
00162     GameSupportLevel gameSupportLevel;
00163 
00167     Common::StringMap _extraConfigEntries;
00168 
00176     void addExtraEntry(const Common::String &key, const Common::String &value) {
00177         _extraConfigEntries[key] = value;
00178     }
00179 private:
00185     Common::String updateDesc() const;
00186 
00187     Common::String _guiOptions;
00188 };
00189 
00191 typedef Common::Array<DetectedGame> DetectedGames;
00192 
00205 class DetectionResults {
00206 public:
00207     explicit DetectionResults(const DetectedGames &detectedGames);
00208 
00214     DetectedGames listRecognizedGames() const;
00215 
00222     DetectedGames listDetectedGames() const;
00223 
00229     bool foundUnknownGames() const;
00230 
00236     Common::String generateUnknownGameReport(bool translate, uint32 wordwrapAt = 0) const;
00237 
00238 private:
00239     DetectedGames _detectedGames;
00240 };
00241 
00251 Common::String generateUnknownGameReport(const DetectedGames &detectedGames, bool translate, bool fullPath, uint32 wordwrapAt = 0);
00252 Common::String generateUnknownGameReport(const DetectedGame &detectedGame, bool translate, bool fullPath, uint32 wordwrapAt = 0);
00253 
00254 #endif


Generated on Sat May 23 2020 05:00:31 for ResidualVM by doxygen 1.7.1
curved edge   curved edge