2015-09-15 18:26:46 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
2016-09-10 16:16:17 +00:00
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
2021-12-26 17:47:58 +00:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
2016-09-10 16:16:17 +00:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2021-12-26 17:47:58 +00:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2016-09-10 16:16:17 +00:00
|
|
|
*
|
|
|
|
*/
|
2015-09-15 18:26:46 +00:00
|
|
|
|
|
|
|
#ifndef BLADERUNNER_ITEMS_H
|
|
|
|
#define BLADERUNNER_ITEMS_H
|
|
|
|
|
|
|
|
#include "bladerunner/bladerunner.h"
|
|
|
|
#include "bladerunner/item.h"
|
|
|
|
|
|
|
|
#include "common/array.h"
|
|
|
|
|
2016-09-10 16:16:17 +00:00
|
|
|
namespace BladeRunner {
|
2015-09-15 18:26:46 +00:00
|
|
|
|
2018-03-24 16:20:27 +00:00
|
|
|
class SaveFileReadStream;
|
|
|
|
class SaveFileWriteStream;
|
2018-03-17 15:14:48 +00:00
|
|
|
|
2016-09-10 16:16:17 +00:00
|
|
|
class Items {
|
|
|
|
BladeRunnerEngine *_vm;
|
2015-09-15 18:26:46 +00:00
|
|
|
|
2018-01-14 11:12:06 +00:00
|
|
|
Common::Array<Item *> _items;
|
2015-09-15 18:26:46 +00:00
|
|
|
|
2016-09-10 16:16:17 +00:00
|
|
|
public:
|
|
|
|
Items(BladeRunnerEngine *vm);
|
|
|
|
~Items();
|
|
|
|
|
2018-11-21 22:16:15 +00:00
|
|
|
void reset();
|
|
|
|
|
2018-01-14 11:12:06 +00:00
|
|
|
void getXYZ(int itemId, float *x, float *y, float *z) const;
|
2018-03-24 09:46:45 +00:00
|
|
|
void setXYZ(int itemId, Vector3 position);
|
2018-01-14 11:12:06 +00:00
|
|
|
void getWidthHeight(int itemId, int *width, int *height) const;
|
2019-05-03 13:06:51 +00:00
|
|
|
void getAnimationId(int itemId, int *animationId) const;
|
2016-10-04 00:21:08 +00:00
|
|
|
|
2016-10-01 22:20:56 +00:00
|
|
|
void tick();
|
2018-03-25 13:05:21 +00:00
|
|
|
bool addToWorld(int itemId, int animationId, int setId, Vector3 position, int facing, int height, int width, bool isTargetFlag, bool isVisibleFlag, bool isPoliceMazeEnemyFlag, bool addToSetFlag);
|
2016-10-12 21:00:33 +00:00
|
|
|
bool addToSet(int itemId);
|
2020-12-20 14:07:11 +00:00
|
|
|
#if !BLADERUNNER_ORIGINAL_BUGS
|
|
|
|
bool removeFromCurrentSceneOnly(int itemId);
|
|
|
|
#endif // !BLADERUNNER_ORIGINAL_BUGS
|
2016-10-02 00:47:12 +00:00
|
|
|
bool remove(int itemId);
|
2016-10-12 21:00:33 +00:00
|
|
|
|
2018-03-24 16:37:09 +00:00
|
|
|
void setIsTarget(int itemId, bool val);
|
2018-02-18 21:18:41 +00:00
|
|
|
bool isTarget(int itemId) const;
|
2018-03-24 11:42:23 +00:00
|
|
|
bool isSpinning(int itemId) const;
|
2018-03-23 21:02:49 +00:00
|
|
|
bool isPoliceMazeEnemy(int itemId) const;
|
2018-03-24 09:46:45 +00:00
|
|
|
void setPoliceMazeEnemy(int itemId, bool val);
|
|
|
|
void setIsObstacle(int itemId, bool val);
|
2018-03-23 22:35:49 +00:00
|
|
|
bool isVisible(int itemId) const;
|
2018-02-18 21:18:41 +00:00
|
|
|
int findTargetUnderMouse(int mouseX, int mouseY) const;
|
|
|
|
|
2018-03-24 16:20:27 +00:00
|
|
|
const BoundingBox &getBoundingBox(int itemId);
|
|
|
|
const Common::Rect &getScreenRectangle(int itemId);
|
2018-03-24 09:46:45 +00:00
|
|
|
int getFacing(int itemId) const;
|
|
|
|
void setFacing(int itemId, int facing);
|
2018-03-23 22:35:49 +00:00
|
|
|
|
2018-03-23 21:02:49 +00:00
|
|
|
void spinInWorld(int itemId);
|
|
|
|
|
2018-03-24 16:20:27 +00:00
|
|
|
void save(SaveFileWriteStream &f);
|
|
|
|
void load(SaveFileReadStream &f);
|
|
|
|
|
2016-09-10 16:16:17 +00:00
|
|
|
private:
|
2018-01-14 11:12:06 +00:00
|
|
|
int findItem(int itemId) const;
|
2016-09-10 16:16:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace BladeRunner
|
2015-09-15 18:26:46 +00:00
|
|
|
|
|
|
|
#endif
|