ScummVM API documentation
item.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_ITEM_H
23#define BLADERUNNER_ITEM_H
24
25#include "bladerunner/boundingbox.h"
26#include "bladerunner/vector.h"
27
28#include "common/rect.h"
29
30namespace BladeRunner {
31
32class BladeRunnerEngine;
33class Items;
34class SaveFileReadStream;
35class SaveFileWriteStream;
36
37class Item {
38 friend class Items;
39
41
42 int _itemId;
43 int _setId;
44
45 BoundingBox _boundingBox;
46 Common::Rect _screenRectangle;
47 int _animationId;
48 Vector3 _position;
49 int _facing;
50 float _angle;
51 int _width;
52 int _height;
53 int _screenX;
54 int _screenY;
55 float _depth;
56 bool _isTarget;
57 bool _isSpinning;
58 int _facingChange;
59 bool _isVisible;
60 bool _isPoliceMazeEnemy;
61
62public:
64
65 void getXYZ(float *x, float *y, float *z) const;
66 void setXYZ(Vector3 position);
67 void getWidthHeight(int *width, int *height) const;
68 void getAnimationId(int *animationId) const;
69
70 const BoundingBox &getBoundingBox() { return _boundingBox; }
71 const Common::Rect &getScreenRectangle() { return _screenRectangle; }
72
73 int getFacing() const { return _facing; }
74 void setFacing(int facing);
75
76 bool isTarget() const { return _isTarget; }
77 void setIsTarget(bool val) { _isTarget = val; }
78
79 bool isSpinning() const { return _isSpinning; }
80 void spinInWorld();
81
82 bool isVisible() const { return _isVisible; }
83 void setVisible(bool val) { _isVisible = val; }
84
85 bool isPoliceMazeEnemy() const { return _isPoliceMazeEnemy; }
86 void setPoliceMazeEnemy(bool val) { _isPoliceMazeEnemy = val; }
87
88 bool tick(Common::Rect *screenRect, bool special);
89
90 void setup(int itemId, int setId, int animationId, Vector3 position, int facing, int height, int width, bool isTargetFlag, bool isVisibleFlag, bool isPoliceMazeEnemyFlag);
91
92 bool isUnderMouse(int mouseX, int mouseY) const;
93
94 void save(SaveFileWriteStream &f);
95 void load(SaveFileReadStream &f);
96};
97
98}
99
100#endif
Definition: bladerunner.h:113
Definition: boundingbox.h:31
Definition: item.h:37
Definition: items.h:35
Definition: savefile.h:113
Definition: savefile.h:88
Definition: vector.h:47
Definition: rect.h:536