1// SuperTux
2// Copyright (C) 2016 Ingo Ruhnke <grumbel@gmail.com>
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17#include "scripting/scripted_object.hpp"
18
19#include "object/scripted_object.hpp"
20
21namespace scripting {
22
23void
24ScriptedObject::set_action(const std::string& animation)
25{
26 SCRIPT_GUARD_VOID;
27 object.set_action(animation);
28}
29
30std::string
31ScriptedObject::get_action() const
32{
33 SCRIPT_GUARD_DEFAULT;
34 return object.get_action();
35}
36
37void
38ScriptedObject::move(float x, float y)
39{
40 SCRIPT_GUARD_VOID;
41 object.move(x, y);
42}
43
44void
45ScriptedObject::set_pos(float x, float y)
46{
47 SCRIPT_GUARD_VOID;
48 object.set_pos(Vector(x, y));
49}
50
51float
52ScriptedObject::get_pos_x() const
53{
54 SCRIPT_GUARD_DEFAULT;
55 return object.get_pos_x();
56}
57
58float
59ScriptedObject::get_pos_y() const
60{
61 SCRIPT_GUARD_DEFAULT;
62 return object.get_pos_y();
63}
64
65void
66ScriptedObject::set_velocity(float x, float y)
67{
68 SCRIPT_GUARD_VOID;
69 object.set_velocity(x, y);
70}
71
72float
73ScriptedObject::get_velocity_x() const
74{
75 SCRIPT_GUARD_DEFAULT;
76 return object.get_velocity_x();
77}
78
79float
80ScriptedObject::get_velocity_y() const
81{
82 SCRIPT_GUARD_DEFAULT;
83 return object.get_velocity_y();
84}
85
86void
87ScriptedObject::enable_gravity(bool f)
88{
89 SCRIPT_GUARD_VOID;
90 object.enable_gravity(f);
91}
92
93bool
94ScriptedObject::gravity_enabled() const
95{
96 SCRIPT_GUARD_DEFAULT;
97 return object.gravity_enabled();
98}
99
100void
101ScriptedObject::set_visible(bool visible)
102{
103 SCRIPT_GUARD_VOID;
104 object.set_visible(visible);
105}
106
107bool
108ScriptedObject::is_visible() const
109{
110 SCRIPT_GUARD_DEFAULT;
111 return object.is_visible();
112}
113
114void
115ScriptedObject::set_solid(bool solid)
116{
117 SCRIPT_GUARD_VOID;
118 return object.set_solid(solid);
119}
120
121bool
122ScriptedObject::is_solid() const
123{
124 SCRIPT_GUARD_DEFAULT;
125 return object.is_solid();
126}
127
128std::string
129ScriptedObject::get_name() const
130{
131 SCRIPT_GUARD_DEFAULT;
132 return object.get_name();
133}
134
135} // namespace scripting
136
137/* EOF */
138