ScummVM API documentation
items.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 BLADERUNNER_ITEMS_H
23 #define BLADERUNNER_ITEMS_H
24 
25 #include "bladerunner/bladerunner.h"
26 #include "bladerunner/item.h"
27 
28 #include "common/array.h"
29 
30 namespace BladeRunner {
31 
32 class SaveFileReadStream;
33 class SaveFileWriteStream;
34 
35 class Items {
36  BladeRunnerEngine *_vm;
37 
38  Common::Array<Item *> _items;
39 
40 public:
42  ~Items();
43 
44  void reset();
45 
46  void getXYZ(int itemId, float *x, float *y, float *z) const;
47  void setXYZ(int itemId, Vector3 position);
48  void getWidthHeight(int itemId, int *width, int *height) const;
49  void getAnimationId(int itemId, int *animationId) const;
50 
51  void tick();
52  bool addToWorld(int itemId, int animationId, int setId, Vector3 position, int facing, int height, int width, bool isTargetFlag, bool isVisibleFlag, bool isPoliceMazeEnemyFlag, bool addToSetFlag);
53  bool addToSet(int itemId);
54 #if !BLADERUNNER_ORIGINAL_BUGS
55  bool removeFromCurrentSceneOnly(int itemId);
56 #endif // !BLADERUNNER_ORIGINAL_BUGS
57  bool remove(int itemId);
58 
59  void setIsTarget(int itemId, bool val);
60  bool isTarget(int itemId) const;
61  bool isSpinning(int itemId) const;
62  bool isPoliceMazeEnemy(int itemId) const;
63  void setPoliceMazeEnemy(int itemId, bool val);
64  void setIsObstacle(int itemId, bool val);
65  bool isVisible(int itemId) const;
66  int findTargetUnderMouse(int mouseX, int mouseY) const;
67 
68  const BoundingBox &getBoundingBox(int itemId);
69  const Common::Rect &getScreenRectangle(int itemId);
70  int getFacing(int itemId) const;
71  void setFacing(int itemId, int facing);
72 
73  void spinInWorld(int itemId);
74 
75  void save(SaveFileWriteStream &f);
76  void load(SaveFileReadStream &f);
77 
78 private:
79  int findItem(int itemId) const;
80 };
81 
82 } // End of namespace BladeRunner
83 
84 #endif
Definition: savefile.h:88
Definition: items.h:35
Definition: array.h:52
Definition: actor.h:31
Definition: savefile.h:113
Definition: rect.h:144
Definition: boundingbox.h:31
Definition: vector.h:47
Definition: bladerunner.h:113