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
28namespace 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
40class Group : public Object {
41public:
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 void makePartsInvisible();
57
60 Math::Vector3d _offset1;
61 Math::Vector3d _offset2;
63 Common::Array<uint16> _objectIds;
64 int _scale;
65 int _step;
66 bool _active;
67
68 ObjectType getType() override { return ObjectType::kGroupType; };
69 bool isDrawable() override { return true; }
70 void draw(Renderer *gfx, float offset = 0.0) override;
71 void scale(int scale_) override { _scale = scale_; };
72 bool isActive() { return !isDestroyed() && !isInvisible() && _step > 0 && _active; };
73 Object *duplicate() override;
74};
75
76} // End of namespace Freescape
77
78#endif // FREESCAPE_GLOBAL_H
Definition: str.h:59
Definition: group.h:40
Definition: object.h:56
Definition: gfx.h:63
Definition: area.h:36
Definition: group.h:30