ScummVM API documentation
room_interaction.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 HARVESTER_ROOM_INTERACTION_H
23 #define HARVESTER_ROOM_INTERACTION_H
24 
25 #include "common/error.h"
26 #include "harvester/room_support.h"
27 #include "harvester/saveload.h"
28 
29 namespace Harvester {
30 
31 class Flow;
32 class HarvesterEngine;
33 struct IndexedBitmap;
34 
35 extern const char *const kExitCloseupPendingRoomChange;
36 
38 public:
39  virtual ~RoomInteractionCallbacks() {}
40 
41  virtual bool refreshCurrentScene(bool preservePlayerPlacement) = 0;
42  virtual bool applyCurrentRoomRuntimeMutationsInPlace(bool preservePaletteState) = 0;
43  virtual void syncGlobalTimerEntities(const Common::Array<TimerRecord> &previousTimerRecords) = 0;
44  virtual bool captureDialogueBackdrop(IndexedBitmap &dialogueBackdrop) = 0;
45  virtual Common::Error showCdChangePrompt(int discNumber) = 0;
46  virtual Common::Error runRoomExitCommands() = 0;
47  virtual Common::Error applyLightingCommand(StartupLightingCommand lightingCommand) = 0;
48  virtual void applyPlayerGotoXZ(int x, int z) = 0;
49  virtual Common::Error runModalShowText(const ResolvedText &modalText) = 0;
50  virtual void resetIdleState() = 0;
51  virtual void stopPlayerRegionInteraction() = 0;
52  virtual void startPlayerDefeatSequence(const char *reason, const Common::String &sourceName,
53  int damageType) = 0;
54 };
55 
57 public:
59  RoomPlayerState &playerState, Common::String &pendingRegionName,
60  Common::String &pendingRoomChange, bool &pendingRoomChangeIsRoomName,
61  bool &pendingRoomChangeUsesSavedRoomState, SaveRoomState &pendingRoomChangeSavedRoomState,
62  bool canExitCloseupToParent, RoomInteractionCallbacks &callbacks);
63 
64  Common::Error handleInteractionResult(const InteractionResult &interaction,
65  bool &didTransition, const Common::String &usedItemName);
66  Common::Error runScriptedDialogue(const Common::String &npcName, const Common::String &usedItemName,
67  const Common::String &continuationTag, bool &didTransition);
68 
69 private:
70  HarvesterEngine &_engine;
71  Flow &_flow;
72  RoomSceneResources &_scene;
73  RoomPlayerState &_playerState;
74  Common::String &_pendingRegionName;
75  Common::String &_pendingRoomChange;
76  bool &_pendingRoomChangeIsRoomName;
77  bool &_pendingRoomChangeUsesSavedRoomState;
78  SaveRoomState &_pendingRoomChangeSavedRoomState;
79  bool _canExitCloseupToParent;
80  RoomInteractionCallbacks &_callbacks;
81 };
82 
83 bool hasRoomEntryInteraction(const InteractionResult &interaction);
84 
85 } // End of namespace Harvester
86 
87 #endif // HARVESTER_ROOM_INTERACTION_H
Definition: flow.h:46
Definition: str.h:59
Definition: art.h:31
Definition: saveload.h:29
Definition: room_interaction.h:56
Definition: room_support.h:45
Definition: error.h:81
Definition: art.h:35
Definition: array.h:52
Definition: room_support.h:54
Definition: room_interaction.h:37
Definition: script.h:283
Definition: harvester.h:47
Definition: script.h:288