ScummVM API documentation
game.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef ULTIMA8_GAMES_GAME_H
23 #define ULTIMA8_GAMES_GAME_H
24 
25 #include "ultima/ultima8/games/game_info.h"
26 #include "ultima/ultima8/misc/common_types.h"
27 #include "ultima/ultima8/usecode/intrinsics.h"
28 
29 namespace Ultima {
30 namespace Ultima8 {
31 
32 class Game {
33 public:
34  Game();
35  virtual ~Game();
36 
37  static Game *get_instance() {
38  return _game;
39  }
40 
42  virtual bool loadFiles() = 0;
43 
45  virtual bool startGame() = 0;
46 
48  virtual bool startInitialUsecode(int saveSlot = -1) = 0;
49 
51  virtual void writeSaveInfo(Common::WriteStream *ws) = 0;
52 
53  virtual ProcId playIntroMovie(bool fade) = 0;
54  virtual ProcId playEndgameMovie(bool fade) = 0;
55  virtual void playCredits() = 0;
56  virtual void playQuotes() = 0;
57  virtual void playDemoScreen() = 0;
58 
59  static Game *createGame(const GameInfo *info);
60 
61  INTRINSIC(I_playEndgame);
62  INTRINSIC(I_playCredits);
63  INTRINSIC(I_playDemoScreen);
64 
65 protected:
66  static Game *_game;
67 };
68 
69 } // End of namespace Ultima8
70 } // End of namespace Ultima
71 
72 #endif
virtual bool startGame()=0
initialize new game
Definition: stream.h:77
virtual void writeSaveInfo(Common::WriteStream *ws)=0
write game-specific savegame info (avatar stats, equipment, ...)
Definition: detection.h:27
virtual bool startInitialUsecode(int saveSlot=-1)=0
start initial usecode
Definition: game.h:32
virtual bool loadFiles()=0
load/init game&#39;s data files
GameInfo contains detailed information about the game.
Definition: game_info.h:38