ScummVM API documentation
group.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 FREESCAPE_GROUP_H
23 #define FREESCAPE_GROUP_H
24 
25 #include "freescape/gfx.h"
26 #include "freescape/objects/object.h"
27 
28 namespace Freescape {
29 
31  AnimationOpcode(uint16 opcode_) {
32  opcode = opcode_;
33  }
34  uint16 opcode;
35  Math::Vector3d position;
36  Common::String conditionSource;
37  FCLInstructionVector condition;
38 };
39 
40 class Group : public Object {
41 public:
42  Group(uint16 objectID_, uint16 flags_,
43  const Common::Array<uint16> objectIds_,
44  const Math::Vector3d offset1_,
45  const Math::Vector3d offset2_,
46  const Common::Array<AnimationOpcode *> operations);
47  ~Group();
48  void linkObject(Object *obj);
49  void assemble(int index);
50  void step();
51  void run();
52  void run(int index);
53  void reset();
54  void start();
55  bool collides(const Math::AABB &aabb);
56 
57  Common::Array<Object *> _objects;
59  Math::Vector3d _offset1;
60  Math::Vector3d _offset2;
62  Common::Array<uint16> _objectIds;
63  int _scale;
64  int _step;
65  bool _active;
66 
67  ObjectType getType() override { return ObjectType::kGroupType; };
68  bool isDrawable() override { return true; }
69  void draw(Renderer *gfx, float offset = 0.0) override;
70  void scale(int scale_) override { _scale = scale_; };
71  bool isActive() { return !isDestroyed() && !isInvisible() && _step > 0 && _active; };
72  Object *duplicate() override;
73 };
74 
75 } // End of namespace Freescape
76 
77 #endif // FREESCAPE_GLOBAL_H
Definition: group.h:40
Definition: str.h:59
Definition: area.h:36
Definition: group.h:30
Definition: gfx.h:60
Graphics::Surface * scale(const Graphics::Surface &srcImage, int xSize, int ySize)
Definition: object.h:56