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 Common::Array<AnimationOpcode *> operations);
45  ~Group();
46  void linkObject(Object *obj);
47  void assemble(int index);
48  void step();
49  void run();
50  void run(int index);
51  void reset();
52 
53  Common::Array<Object *> _objects;
56  Common::Array<uint16> _objectIds;
57  int _scale;
58  int _step;
59  bool _active;
60 
61  ObjectType getType() override { return ObjectType::kGroupType; };
62  bool isDrawable() override { return true; }
63  void draw(Renderer *gfx, float offset = 0.0) override;
64  void scale(int scale_) override { _scale = scale_; };
65  bool isActive() { return !isDestroyed() && !isInvisible() && _step > 0 && _active; };
66  Object *duplicate() override;
67 };
68 
69 } // End of namespace Freescape
70 
71 #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