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 | |
21 | namespace scripting { |
22 | |
23 | void |
24 | ScriptedObject::set_action(const std::string& animation) |
25 | { |
26 | SCRIPT_GUARD_VOID; |
27 | object.set_action(animation); |
28 | } |
29 | |
30 | std::string |
31 | ScriptedObject::get_action() const |
32 | { |
33 | SCRIPT_GUARD_DEFAULT; |
34 | return object.get_action(); |
35 | } |
36 | |
37 | void |
38 | ScriptedObject::move(float x, float y) |
39 | { |
40 | SCRIPT_GUARD_VOID; |
41 | object.move(x, y); |
42 | } |
43 | |
44 | void |
45 | ScriptedObject::set_pos(float x, float y) |
46 | { |
47 | SCRIPT_GUARD_VOID; |
48 | object.set_pos(Vector(x, y)); |
49 | } |
50 | |
51 | float |
52 | ScriptedObject::get_pos_x() const |
53 | { |
54 | SCRIPT_GUARD_DEFAULT; |
55 | return object.get_pos_x(); |
56 | } |
57 | |
58 | float |
59 | ScriptedObject::get_pos_y() const |
60 | { |
61 | SCRIPT_GUARD_DEFAULT; |
62 | return object.get_pos_y(); |
63 | } |
64 | |
65 | void |
66 | ScriptedObject::set_velocity(float x, float y) |
67 | { |
68 | SCRIPT_GUARD_VOID; |
69 | object.set_velocity(x, y); |
70 | } |
71 | |
72 | float |
73 | ScriptedObject::get_velocity_x() const |
74 | { |
75 | SCRIPT_GUARD_DEFAULT; |
76 | return object.get_velocity_x(); |
77 | } |
78 | |
79 | float |
80 | ScriptedObject::get_velocity_y() const |
81 | { |
82 | SCRIPT_GUARD_DEFAULT; |
83 | return object.get_velocity_y(); |
84 | } |
85 | |
86 | void |
87 | ScriptedObject::enable_gravity(bool f) |
88 | { |
89 | SCRIPT_GUARD_VOID; |
90 | object.enable_gravity(f); |
91 | } |
92 | |
93 | bool |
94 | ScriptedObject::gravity_enabled() const |
95 | { |
96 | SCRIPT_GUARD_DEFAULT; |
97 | return object.gravity_enabled(); |
98 | } |
99 | |
100 | void |
101 | ScriptedObject::set_visible(bool visible) |
102 | { |
103 | SCRIPT_GUARD_VOID; |
104 | object.set_visible(visible); |
105 | } |
106 | |
107 | bool |
108 | ScriptedObject::is_visible() const |
109 | { |
110 | SCRIPT_GUARD_DEFAULT; |
111 | return object.is_visible(); |
112 | } |
113 | |
114 | void |
115 | ScriptedObject::set_solid(bool solid) |
116 | { |
117 | SCRIPT_GUARD_VOID; |
118 | return object.set_solid(solid); |
119 | } |
120 | |
121 | bool |
122 | ScriptedObject::is_solid() const |
123 | { |
124 | SCRIPT_GUARD_DEFAULT; |
125 | return object.is_solid(); |
126 | } |
127 | |
128 | std::string |
129 | ScriptedObject::get_name() const |
130 | { |
131 | SCRIPT_GUARD_DEFAULT; |
132 | return object.get_name(); |
133 | } |
134 | |
135 | } // namespace scripting |
136 | |
137 | /* EOF */ |
138 | |