ScummVM API documentation
logic.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 LASTEXPRESS_LOGIC_H
23 #define LASTEXPRESS_LOGIC_H
24 
25 #include "lastexpress/shared.h"
26 
27 #include "lastexpress/eventhandler.h"
28 
29 #include "common/events.h"
30 
31 namespace LastExpress {
32 
33 class LastExpressEngine;
34 
35 class Action;
36 class Beetle;
37 class Debugger;
38 class Entities;
39 class Fight;
40 class SaveLoad;
41 class State;
42 
43 class Logic : public EventHandler {
44 public:
45  Logic(LastExpressEngine *engine);
46  ~Logic() override;
47 
48  void eventMouse(const Common::Event &ev) override;
49  void eventTick(const Common::Event &ev) override;
50 
51  void resetState();
52  void gameOver(SavegameType type, uint32 value, SceneIndex sceneIndex, bool showScene) const;
53  void playFinalSequence() const;
54  void updateCursor(bool redraw = true) const;
55 
56  Action *getGameAction() { return _action; }
57  Beetle *getGameBeetle() { return _beetle; }
58  Entities *getGameEntities() { return _entities; }
59  Fight *getGameFight() { return _fight; }
60  SaveLoad *getGameSaveLoad() { return _saveload; }
61  State *getGameState() { return _state; }
62 
63 private:
64  LastExpressEngine *_engine;
65 
66  Action *_action;
67  Beetle *_beetle;
68  Entities *_entities;
69  Fight *_fight;
70  SaveLoad *_saveload;
71  State *_state;
72 
73  void switchChapter() const;
74  void showCredits() const;
75  void redrawCursor() const;
76 
77  // Flags & Members
78  bool _flagActionPerformed;
79  bool _ignoreFrameInterval;
80  int _ticksSinceLastSavegame;
81 
82  friend class Debugger;
83 };
84 
85 } // End of namespace LastExpress
86 
87 #endif // LASTEXPRESS_LOGIC_H
Definition: lastexpress.h:69
Definition: eventhandler.h:36
Definition: beetle.h:36
Definition: entities.h:45
Definition: animation.h:45
Definition: state.h:40
Definition: logic.h:43
Definition: fight.h:67
Definition: savegame.h:149
Definition: events.h:199
Definition: action.h:46
Definition: debug.h:47