ScummVM API documentation
game_state.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 TITANIC_GAME_STATE_H
23#define TITANIC_GAME_STATE_H
24
25#include "titanic/core/list.h"
26#include "titanic/core/link_item.h"
27#include "titanic/support/simple_file.h"
28#include "titanic/game_location.h"
29#include "titanic/support/movie.h"
30
31namespace Titanic {
32
33class CGameManager;
34
35enum GameStateMode {
36 GSMODE_NONE = 0, GSMODE_INTERACTIVE = 1, GSMODE_CUTSCENE = 2,
37 GSMODE_3 = 3, GSMODE_4 = 4, GSMODE_INSERT_CD = 5, GSMODE_PENDING_LOAD = 6
38};
39
40enum Season {
41 SEASON_SUMMER = 0,
42 SEASON_AUTUMN = 1,
43 SEASON_WINTER = 2,
44 SEASON_SPRING = 3
45};
46
47class CGameStateMovieList : public Common::List<CMovie *> {
48public:
49 CViewItem *_destView;
50 CMovieClip *_movieClip;
51public:
52 CGameStateMovieList() : Common::List<CMovie *>(), _destView(nullptr), _movieClip(nullptr) {}
53
57 bool empty();
58};
59
61public:
62 CGameManager *_gameManager;
63 CGameLocation _gameLocation;
64 CGameStateMovieList _movieList;
65 PassengerClass _passengerClass;
66 PassengerClass _priorClass;
67 GameStateMode _mode;
68 Season _seasonNum;
69 bool _petActive;
70 bool _soundMakerAllowed;
71 bool _quitGame;
72 bool _parrotMet;
73 uint _nodeChangeCtr;
74 uint32 _nodeEnterTicks;
75 Point _mousePos;
76 int _parrotResponseIndex;
77public:
78 CGameState(CGameManager *gameManager);
79
83 void save(SimpleFile *file) const;
84
88 void load(SimpleFile *file);
89
93 void setMode(GameStateMode newMode);
94
98 void setMousePos(const Point &pt) { _mousePos = pt; }
99
103 Point getMousePos() const { return _mousePos; }
104
108 void enterNode();
109
113 void enterView();
114
119
123 void changeView(CViewItem *newView, CMovieClip *clip);
124
129
133 void addMovie(CMovie *movie);
134
139 _seasonNum = (Season)(((int)_seasonNum + 1) & 3);
140 }
141
145 void setParrotMet(bool flag) { _parrotMet = flag; }
146
150 bool getParrotMet() const { return _parrotMet; }
151
156 int getNodeChangedCtr() const { return _nodeChangeCtr; }
157
161 uint32 getNodeEnterTicks() const { return _nodeEnterTicks; }
162
166 void incParrotResponse() { ++_parrotResponseIndex; }
167};
168
169} // End of namespace Titanic
170
171#endif /* TITANIC_GAME_STATE_H */
Definition: list.h:44
Definition: game_location.h:39
Definition: game_manager.h:48
Definition: game_state.h:60
void triggerLink(CLinkItem *link)
void setMousePos(const Point &pt)
Definition: game_state.h:98
int getNodeChangedCtr() const
Definition: game_state.h:156
void addMovie(CMovie *movie)
void incParrotResponse()
Definition: game_state.h:166
void load(SimpleFile *file)
void setParrotMet(bool flag)
Definition: game_state.h:145
void setMode(GameStateMode newMode)
void changeSeason()
Definition: game_state.h:138
Point getMousePos() const
Definition: game_state.h:103
uint32 getNodeEnterTicks() const
Definition: game_state.h:161
bool getParrotMet() const
Definition: game_state.h:150
void save(SimpleFile *file) const
void changeView(CViewItem *newView, CMovieClip *clip)
Definition: game_state.h:47
Definition: movie_clip.h:41
Definition: movie.h:43
Definition: view_item.h:32
Definition: simple_file.h:49
Definition: rect.h:144