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/language.h"
00030 #include "common/platform.h"
00031 
00038 struct PlainGameDescriptor {
00039     const char *gameId;
00040     const char *description;
00041 
00042     static PlainGameDescriptor empty();
00043     static PlainGameDescriptor of(const char *gameId, const char *description);
00044 };
00045 
00051 const PlainGameDescriptor *findPlainGameDescriptor(const char *gameid, const PlainGameDescriptor *list);
00052 
00053 class PlainGameList : public Common::Array<PlainGameDescriptor> {
00054 public:
00055     PlainGameList() {}
00056     PlainGameList(const PlainGameList &list) : Common::Array<PlainGameDescriptor>(list) {}
00057     PlainGameList(const PlainGameDescriptor *g) {
00058         while (g->gameId) {
00059             push_back(*g);
00060             g++;
00061         }
00062     }
00063 };
00064 
00068 enum GameSupportLevel {
00069     kStableGame = 0, // the game is fully supported
00070     kTestingGame, // the game is not supposed to end up in releases yet but is ready for public testing
00071     kUnstableGame // the game is not even ready for public testing yet
00072 };
00073 
00074 
00079 struct FileProperties {
00080     int32 size;
00081     Common::String md5;
00082 
00083     FileProperties() : size(-1) {}
00084 };
00085 
00089 typedef Common::HashMap<Common::String, FileProperties, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> FilePropertiesMap;
00090 
00098 struct DetectedGame {
00099     DetectedGame();
00100     explicit DetectedGame(const PlainGameDescriptor &pgd);
00101     DetectedGame(const Common::String &id,
00102                    const Common::String &description,
00103                    Common::Language language = Common::UNK_LANG,
00104                    Common::Platform platform = Common::kPlatformUnknown,
00105                    const Common::String &extra = Common::String());
00106 
00107     void setGUIOptions(const Common::String &options);
00108     void appendGUIOptions(const Common::String &str);
00109     Common::String getGUIOptions() const { return _guiOptions; }
00110 
00114     const char *engineName;
00115 
00124     bool hasUnknownFiles;
00125 
00129     FilePropertiesMap matchedFiles;
00130 
00136     bool canBeAdded;
00137 
00138     Common::String gameId;
00139     Common::String preferredTarget;
00140     Common::String description;
00141     Common::Language language;
00142     Common::Platform platform;
00143     Common::String path;
00144     Common::String extra;
00145 
00149     GameSupportLevel gameSupportLevel;
00150 
00154     Common::StringMap _extraConfigEntries;
00155 
00163     void addExtraEntry(const Common::String &key, const Common::String &value) {
00164         _extraConfigEntries[key] = value;
00165     }
00166 private:
00172     Common::String updateDesc() const;
00173 
00174     Common::String _guiOptions;
00175 };
00176 
00178 typedef Common::Array<DetectedGame> DetectedGames;
00179 
00192 class DetectionResults {
00193 public:
00194     explicit DetectionResults(const DetectedGames &detectedGames);
00195 
00201     DetectedGames listRecognizedGames();
00202 
00208     bool foundUnknownGames() const;
00209 
00217     Common::String generateUnknownGameReport(bool translate, uint32 wordwrapAt = 0) const;
00218 
00219 private:
00220     DetectedGames _detectedGames;
00221 };
00222 
00223 #endif


Generated on Sat Feb 23 2019 05:01:04 for ResidualVM by doxygen 1.7.1
curved edge   curved edge