1 // SuperTux 2 // Copyright (C) 2006 Matthias Braun <matze@braunis.de> 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 #ifndef HEADER_SUPERTUX_SCRIPTING_SCRIPTED_OBJECT_HPP 18 #define HEADER_SUPERTUX_SCRIPTING_SCRIPTED_OBJECT_HPP 19 20 #ifndef SCRIPTING_API 21 #include <string> 22 #include "scripting/game_object.hpp" 23 24 class ScriptedObject; 25 #endif 26 27 namespace scripting { 28 29 class ScriptedObject final 30 #ifndef SCRIPTING_API 31 : public GameObject<::ScriptedObject> 32 #endif 33 { 34 #ifndef SCRIPTING_API 35 public: 36 using GameObject::GameObject; 37 38 private: 39 ScriptedObject(const ScriptedObject&) = delete; 40 ScriptedObject& operator=(const ScriptedObject&) = delete; 41 #endif 42 43 public: 44 void set_action(const std::string& animation); 45 std::string get_action() const; 46 47 void move(float x, float y); 48 void set_pos(float x, float y); 49 float get_pos_x() const; 50 float get_pos_y() const; 51 52 void set_velocity(float x, float y); 53 float get_velocity_x() const; 54 float get_velocity_y() const; 55 56 void enable_gravity(bool f); 57 bool gravity_enabled() const; 58 59 void set_visible(bool visible); 60 bool is_visible() const; 61 62 void set_solid(bool solid); 63 bool is_solid() const; 64 65 std::string get_name() const; 66 }; 67 68 } // namespace scripting 69 70 #endif 71 72 /* EOF */ 73