ScummVM API documentation
police_maze.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_SCRIPT_POLICE_MAZE_H
23 #define BLADERUNNER_SCRIPT_POLICE_MAZE_H
24 
25 #include "bladerunner/script/script.h"
26 #include "bladerunner/vector.h"
27 
28 namespace BladeRunner {
29 
30 enum {
31  kNumMazeTracks = 64,
32  kNumTrackPoints = 100
33 };
34 
35 class BladeRunnerEngine;
36 class SaveFileReadStream;
37 class SaveFileWriteStream;
38 
40  friend class PoliceMaze;
41  uint32 _time;
42  bool _isPresent;
43  int _itemId;
44  int _pointCount;
45  Vector3 _points[kNumTrackPoints];
46  const int *_data;
47  int _dataIndex;
48  int32 _timeLeftUpdate;
49  int32 _timeLeftWait;
50  bool _isWaiting;
51  int _isMoving;
52  int _pointIndex;
53  int _pointTarget;
54  bool _isRotating;
55  int _angleTarget;
56  int _angleDelta;
57  bool _isPaused;
58 
59 public:
61  ~PoliceMazeTargetTrack() override;
62 
63  void reset();
64  void clear(bool isLoadingGame);
65  void add(int trackId, float startX, float startY, float startZ, float endX, float endY, float endZ, int steps, const int *instructions, bool isActive);
66 
67  bool tick();
68  bool isPresent() const { return _isPresent; }
69  void setPaused() { _isPaused = true; }
70  void resetPaused() { _isPaused = false; }
71  bool isPaused() const { return _isPaused; }
72  void setTime(uint32 t) { _time = t; }
73 
74  void readdObject(int itemId);
75 
76  void save(SaveFileWriteStream &f);
77  void load(SaveFileReadStream &f);
78 };
79 
81  bool _isPaused;
82  bool _isActive;
83  bool _isEnding;
84  int _pm_var1;
85  int _pm_var2;
86 
87 public:
88  PoliceMazeTargetTrack *_tracks[kNumMazeTracks];
89 
90 public:
92  ~PoliceMaze() override;
93 
94  void tick();
95  void clear(bool isLoadingGame);
96  void setPauseState(bool state);
97  void activate();
98 
99  void save(SaveFileWriteStream &f);
100  void load(SaveFileReadStream &f);
101 };
102 
103 } // End of namespace BladeRunner
104 
105 #endif
Definition: savefile.h:88
Definition: police_maze.h:80
Definition: actor.h:31
Definition: savefile.h:113
Definition: vector.h:47
Definition: script.h:34
Definition: bladerunner.h:113
Definition: police_maze.h:39