ScummVM API documentation
movement_track.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_MOVEMENT_TRACK_H
23 #define BLADERUNNER_MOVEMENT_TRACK_H
24 
25 #include "bladerunner/bladerunner.h"
26 
27 namespace BladeRunner {
28 
29 class BladeRunnerEngine;
30 class BoundingBox;
31 class SaveFileReadStream;
32 class SaveFileWriteStream;
33 
35  static const int kSize = 100;
36 
37  struct Entry {
38  int waypointId;
39  // delay specifies how long (in milliseconds) to stay at the target waypoint (when reached)
40  int32 delay;
41  int angle;
42  bool run;
43  };
44 
45  int _currentIndex;
46  int _lastIndex;
47  bool _hasNext;
48  bool _paused;
49  Entry _entries[kSize];
50 
51 public:
52  MovementTrack();
53  ~MovementTrack();
54  int append(int waypointId, int32 delayMillis, bool run);
55  int append(int waypointId, int32 delayMillis, int angle, bool run);
56  void flush();
57  void repeat();
58  void pause();
59  void unpause();
60  bool isPaused() const;
61  bool hasNext() const;
62  bool next(int *waypointId, int32 *delayMillis, int *angle, bool *run);
63 
64  void save(SaveFileWriteStream &f);
65  void load(SaveFileReadStream &f);
66 
67 private:
68  void reset();
69 };
70 
71 } // End of namespace BladeRunner
72 
73 #endif
Definition: savefile.h:88
Definition: actor.h:31
Definition: savefile.h:113
Definition: movement_track.h:34