ScummVM API documentation
cursor_actor.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 PINK_CURSOR_ACTOR_H
23#define PINK_CURSOR_ACTOR_H
24
25#include "common/debug.h"
26
27#include "pink/pink.h"
28#include "pink/objects/actions/action_cel.h"
29#include "pink/objects/actors/actor.h"
30
31namespace Pink {
32
33class CursorActor : public Actor {
34public:
35 void toConsole() const override {
36 debugC(6, kPinkDebugLoadingObjects, "CursorActor: _name = %s", _name.c_str());
37 for (uint i = 0; i < _actions.size(); ++i) {
38 _actions[i]->toConsole();
39 }
40 }
41
42 bool isCursor() const override {
43 return true;
44 }
45
46 void setCursorItem(const Common::String &name, Common::Point point) {
47 if (!_action || _action->getName() != name)
48 setAction(name);
49 static_cast<ActionCEL*>(_action)->setCenter(point);
50 }
51};
52
53} // End of namespace Pink
54
55#endif
size_type size() const
Definition: array.h:316
Definition: str.h:59
Definition: action_cel.h:32
Definition: actor.h:39
Definition: cursor_actor.h:33
void void void void void debugC(int level, uint32 debugChannel, MSVC_PRINTF const char *s,...) GCC_PRINTF(3
Definition: rect.h:144