ScummVM API documentation
base_enhancements_autoplay.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 HOPKINS_BASE_ENHANCEMENTS_AUTOPLAY_H
23#define HOPKINS_BASE_ENHANCEMENTS_AUTOPLAY_H
24
25#include "common/array.h"
26#include "common/scummsys.h"
27
28namespace Hopkins {
29
30class BaseData;
31class BaseEngine;
32struct BaseInputState;
33
36public:
38
39 void reset();
40 bool active() const { return _active; }
41
42 void clearMenuPointer();
43 void selectPrevious();
44 void selectNext();
45 void updateMenuPointer(int x, int y);
46 bool selectMenuPointer(int x, int y);
47 bool startSelected(const BaseEngine &engine);
48 bool startDestination(const BaseEngine &engine, int destination);
49 void cancel();
50
52 int update(const BaseEngine &engine, BaseInputState &input);
53 void renderMenu(const BaseData &data, int returnRoomId, byte *framebuffer,
54 bool forcedMode) const;
55 void renderStatus(const BaseData &data, byte *framebuffer, bool forcedMode) const;
56
57 static int destinationCount();
58 static int destinationRoomId(int index);
59 static int destinationExitMapPos(int index);
60 static const char *destinationLabel(int index);
61 static const char *destinationMapLabel(int index);
62 static int destinationIndexForExitMapPos(int mapPos);
63
64private:
65 bool rebuildRoute(const BaseEngine &engine, bool avoidBlockingObjects);
66 int findVisibleGuard(const BaseEngine &engine) const;
67 bool aimAt(const BaseEngine &engine, int targetX, int targetY, BaseInputState &input) const;
68 void updateStuckState(const BaseEngine &engine, bool triedToMove);
69 void beginRecovery();
70 void updateRecovery(const BaseEngine &engine, BaseInputState &input);
71
72 bool _active;
73 int _selectedDestination;
74 int _hoveredDestination;
75 int _destination;
76 Common::Array<int> _route;
77 uint _routeIndex;
78 int _lastPlayerX;
79 int _lastPlayerY;
80 int _stuckTicks;
81 bool _routeInvalidated;
82 int _blockedRouteCell;
83 int _routeBlocker;
84 int _movementBlocker;
85 int _activeTicks;
86 int _recoveryPhase;
87 int _recoveryTicks;
88 int _recoveryAttempts;
89 bool _recoveryTurnRight;
90};
91
92} // End of namespace Hopkins
93
94#endif // HOPKINS_BASE_ENHANCEMENTS_AUTOPLAY_H
Definition: base_data.h:35
Definition: base_engine.h:57
Definition: base_enhancements_autoplay.h:35
int update(const BaseEngine &engine, BaseInputState &input)
Definition: anim.h:30
Definition: base_engine.h:35