ScummVM API documentation
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 NGI_INTERACTION_H
23 #define NGI_INTERACTION_H
24 
25 #include "ngi/utils.h"
26 
27 namespace NGI {
28 
29 class GameObject;
30 class MessageQueue;
31 class StaticANIObject;
32 
33 int handleObjectInteraction(StaticANIObject *subject, GameObject *object, int invId);
34 bool canInteractAny(GameObject *obj1, GameObject *obj2, int invId);
35 
36 
37 class Interaction : public CObject {
38  public:
39  int16 _objectId1;
40  int16 _objectId2;
41  int16 _objectId3;
42  int16 _staticsId1;
43  int16 _staticsId2;
44  int _objectState1;
45  int _objectState2;
46  int _xOffs;
47  int _yOffs;
48  MessageQueue *_messageQueue;
49  int _sceneId;
50  int _field_28;
51  uint _flags;
52  Common::String _actionName;
53 
54  public:
55  Interaction();
56  ~Interaction() override;
57 
58  bool load(MfcArchive &file) override;
59  bool canInteract(GameObject *obj1, GameObject *obj2, int invId);
60  bool isOverlapping(StaticANIObject *subj, GameObject *obj);
61 };
62 
64  friend bool canInteractAny(GameObject *obj1, GameObject *obj2, int invId);
65 
66 public:
68  bool _flag24;
69 
70  private:
71  InteractionList _interactions;
72  static bool compareInteractions(const Interaction *i1, const Interaction *i2);
73 
74  public:
75  InteractionController() : _flag24(true) {}
76  ~InteractionController() override;
77 
78  bool load(MfcArchive &file) override;
79 
80  void enableFlag24() { _flag24 = true; }
81  void disableFlag24() { _flag24 = false; }
82 
83  void sortInteractions(int sceneId);
84 
85  bool handleInteraction(StaticANIObject *subj, GameObject *obj, int invId);
86 
87  Interaction *getInteractionByObjectIds(int obId, int obId2, int obId3);
88 };
89 
90 struct EntranceInfo {
91  int32 _sceneId;
92  int32 _field_4;
93  int32 _messageQueueId;
94  int32 _field_130;
95 
96  bool load(MfcArchive &file);
97 };
98 
99 } // End of namespace NGI
100 
101 #endif /* NGI_INTERACTION_H */
Definition: gfx.h:137
Definition: str.h:59
Definition: utils.h:39
Definition: interaction.h:90
Definition: messages.h:108
Definition: interaction.h:37
Definition: interaction.h:63
Definition: statics.h:172
Definition: anihandler.h:25
Definition: utils.h:106