ScummVM API documentation
gameeventmanager.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/*
23 * This code is based on the CRAB engine
24 *
25 * Copyright (c) Arvind Raja Yadav
26 *
27 * Licensed under MIT
28 *
29 */
30
31#ifndef CRAB_GAMEEVENTMANAGER_H
32#define CRAB_GAMEEVENTMANAGER_H
33
34#include "crab/event/EventSeqGroup.h"
35#include "crab/ui/ChapterIntro.h"
36#include "crab/ui/hud.h"
37#include "crab/ui/journal.h"
38#include "crab/ui/PersonHandler.h"
39#include "crab/ui/PersonScreen.h"
40#include "crab/ui/ReplyMenu.h"
41#include "crab/ui/textarea.h"
42
43namespace Crab {
44
45namespace pyrodactyl {
46namespace event {
47class Manager {
48protected:
49 // All the events in the game
51
52 // The currently happening or active sequence
53 uint _activeSeq;
54
55 // THIS IS NOT THE DEFINITIVE LIST OF ENDED SEQUENCES
56 // JUST A TEMPORARY LIST OF EVENT SEQUENCES TO PASS AROUND
58
59 // The objects used to draw the dialog box and opinion bars
61
62 // The _reply menu and the colors and font of the text
64
65 // The field for text input
67
68 // The info for intro events
70
71 // Store the current event data temporarily
72 GameEvent *_curEvent;
73 bool _player;
75
76 void updateDialogBox(Info &info, pyrodactyl::level::Level &level);
77
78public:
79 // The object used to draw the character screen
81
82 // A flag used to stop drawing the game for a better fade in/fade out experience
83 bool _drawGame;
84
85 Manager() {
86 init();
87 }
88
89 ~Manager() {}
90
91 void init();
92 void load(rapidxml::xml_node<char> *node, pyrodactyl::ui::ParagraphData &popup);
93
94 void draw(Info &info, pyrodactyl::ui::HUD &hud, pyrodactyl::level::Level &level);
95
96 // cur_per is also updated here
97 void internalEvents(Info &info, pyrodactyl::level::Level &level, Common::Array<EventResult> &result);
98
99 void handleEvents(Info &info, const Common::String &playerId, Common::Event &event,
101
102 void calcActiveSeq(Info &info, pyrodactyl::level::Level &level, const Rect &camera);
103
104 void endSequence(const Common::String &curloc);
105 bool eventInProgress();
106
107 void saveState(rapidxml::xml_document<> &doc, rapidxml::xml_node<char> *root);
108 void loadState(rapidxml::xml_node<char> *node);
109
110 void setUI();
111};
112} // End of namespace event
113} // End of namespace pyrodactyl
114
115} // End of namespace Crab
116
117#endif // CRAB_GAMEEVENTMANAGER_H
Definition: array.h:52
Definition: hashmap.h:85
Definition: str.h:59
Definition: sprite.h:49
Definition: GameEventInfo.h:44
Definition: gameeventmanager.h:47
Definition: level.h:45
Definition: ChapterIntro.h:46
Definition: hud.h:59
Definition: ParagraphData.h:40
Definition: PersonHandler.h:48
Definition: PersonScreen.h:48
Definition: ReplyMenu.h:47
Definition: textarea.h:45
Definition: events.h:218
Definition: Rectangle.h:42
Definition: gameevent.h:58