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/ustr.h"
00030 #include "common/str-array.h"
00031 #include "common/language.h"
00032 #include "common/platform.h"
00033 
00040 struct PlainGameDescriptor {
00041     const char *gameId;
00042     const char *description;
00043 
00044     static PlainGameDescriptor empty();
00045     static PlainGameDescriptor of(const char *gameId, const char *description);
00046 };
00047 
00053 const PlainGameDescriptor *findPlainGameDescriptor(const char *gameid, const PlainGameDescriptor *list);
00054 
00055 class PlainGameList : public Common::Array<PlainGameDescriptor> {
00056 public:
00057     PlainGameList() {}
00058     PlainGameList(const PlainGameList &list) : Common::Array<PlainGameDescriptor>(list) {}
00059     PlainGameList(const PlainGameDescriptor *g) {
00060         while (g->gameId) {
00061             push_back(*g);
00062             g++;
00063         }
00064     }
00065 };
00066 
00070 struct QualifiedGameDescriptor {
00071     Common::String engineId;
00072     Common::String gameId;
00073     Common::String description;
00074 
00075     QualifiedGameDescriptor() {}
00076     QualifiedGameDescriptor(const char *engine, const PlainGameDescriptor &pgd);
00077 };
00078 
00079 typedef Common::Array<QualifiedGameDescriptor> QualifiedGameList;
00080 
00084 enum GameSupportLevel {
00085     kStableGame = 0, // the game is fully supported
00086     kTestingGame, // the game is not supposed to end up in releases yet but is ready for public testing
00087     kUnstableGame // the game is not even ready for public testing yet
00088 };
00089 
00090 
00095 struct FileProperties {
00096     int32 size;
00097     Common::String md5;
00098 
00099     FileProperties() : size(-1) {}
00100 };
00101 
00105 typedef Common::HashMap<Common::String, FileProperties, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> FilePropertiesMap;
00106 
00114 struct DetectedGame {
00115     DetectedGame();
00116     DetectedGame(const Common::String &engine, const PlainGameDescriptor &pgd);
00117     DetectedGame(const Common::String &engine, const Common::String &id,
00118                    const Common::String &description,
00119                    Common::Language language = Common::UNK_LANG,
00120                    Common::Platform platform = Common::kPlatformUnknown,
00121                    const Common::String &extra = Common::String());
00122 
00123     void setGUIOptions(const Common::String &options);
00124     void appendGUIOptions(const Common::String &str);
00125     const Common::String &getGUIOptions() const { return _guiOptions; }
00126 
00127     Common::String engineId;
00128 
00137     bool hasUnknownFiles;
00138 
00142     FilePropertiesMap matchedFiles;
00143 
00149     bool canBeAdded;
00150 
00151     Common::String gameId;
00152     Common::String preferredTarget;
00153     Common::String description;
00154     Common::Language language;
00155     Common::Platform platform;
00156     Common::String path;
00157     Common::String shortPath;
00158     Common::String extra;
00159 
00163     GameSupportLevel gameSupportLevel;
00164 
00168     Common::StringMap _extraConfigEntries;
00169 
00177     void addExtraEntry(const Common::String &key, const Common::String &value) {
00178         _extraConfigEntries[key] = value;
00179     }
00180 private:
00186     Common::String updateDesc() const;
00187 
00188     Common::String _guiOptions;
00189 };
00190 
00192 typedef Common::Array<DetectedGame> DetectedGames;
00193 
00206 class DetectionResults {
00207 public:
00208     explicit DetectionResults(const DetectedGames &detectedGames);
00209 
00215     DetectedGames listRecognizedGames() const;
00216 
00223     DetectedGames listDetectedGames() const;
00224 
00230     bool foundUnknownGames() const;
00231 
00237     Common::U32String generateUnknownGameReport(bool translate, uint32 wordwrapAt = 0) const;
00238 
00239 private:
00240     DetectedGames _detectedGames;
00241 };
00242 
00252 Common::U32String generateUnknownGameReport(const DetectedGames &detectedGames, bool translate, bool fullPath, uint32 wordwrapAt = 0);
00253 Common::U32String generateUnknownGameReport(const DetectedGame &detectedGame, bool translate, bool fullPath, uint32 wordwrapAt = 0);
00254 
00255 #endif


Generated on Sat Sep 12 2020 05:01:02 for ResidualVM by doxygen 1.7.1
curved edge   curved edge