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 enum GameSupportLevel {
00070     kStableGame = 0, // the game is fully supported
00071     kTestingGame, // the game is not supposed to end up in releases yet but is ready for public testing
00072     kUnstableGame // the game is not even ready for public testing yet
00073 };
00074 
00075 
00080 struct FileProperties {
00081     int32 size;
00082     Common::String md5;
00083 
00084     FileProperties() : size(-1) {}
00085 };
00086 
00090 typedef Common::HashMap<Common::String, FileProperties, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> FilePropertiesMap;
00091 
00099 struct DetectedGame {
00100     DetectedGame();
00101     explicit DetectedGame(const PlainGameDescriptor &pgd);
00102     DetectedGame(const Common::String &id,
00103                    const Common::String &description,
00104                    Common::Language language = Common::UNK_LANG,
00105                    Common::Platform platform = Common::kPlatformUnknown,
00106                    const Common::String &extra = Common::String());
00107 
00108     void setGUIOptions(const Common::String &options);
00109     void appendGUIOptions(const Common::String &str);
00110     Common::String getGUIOptions() const { return _guiOptions; }
00111 
00115     const char *engineName;
00116 
00125     bool hasUnknownFiles;
00126 
00130     FilePropertiesMap matchedFiles;
00131 
00137     bool canBeAdded;
00138 
00139     Common::String gameId;
00140     Common::String preferredTarget;
00141     Common::String description;
00142     Common::Language language;
00143     Common::Platform platform;
00144     Common::String path;
00145     Common::String shortPath;
00146     Common::String extra;
00147 
00151     GameSupportLevel gameSupportLevel;
00152 
00156     Common::StringMap _extraConfigEntries;
00157 
00165     void addExtraEntry(const Common::String &key, const Common::String &value) {
00166         _extraConfigEntries[key] = value;
00167     }
00168 private:
00174     Common::String updateDesc() const;
00175 
00176     Common::String _guiOptions;
00177 };
00178 
00180 typedef Common::Array<DetectedGame> DetectedGames;
00181 
00194 class DetectionResults {
00195 public:
00196     explicit DetectionResults(const DetectedGames &detectedGames);
00197 
00203     DetectedGames listRecognizedGames() const;
00204 
00211     DetectedGames listDetectedGames() const;
00212 
00218     bool foundUnknownGames() const;
00219 
00225     Common::String generateUnknownGameReport(bool translate, uint32 wordwrapAt = 0) const;
00226 
00227 private:
00228     DetectedGames _detectedGames;
00229 };
00230 
00240 Common::String generateUnknownGameReport(const DetectedGames &detectedGames, bool translate, bool fullPath, uint32 wordwrapAt = 0);
00241 Common::String generateUnknownGameReport(const DetectedGame &detectedGame, bool translate, bool fullPath, uint32 wordwrapAt = 0);
00242 
00243 #endif


Generated on Sat Aug 24 2019 05:00:53 for ResidualVM by doxygen 1.7.1
curved edge   curved edge