17 #ifndef HEADER_SUPERTUX_SCRIPTING_GAME_OBJECT_HPP 18 #define HEADER_SUPERTUX_SCRIPTING_GAME_OBJECT_HPP 20 #include "supertux/game_object_manager.hpp" 21 #include "util/log.hpp" 22 #include "util/uid.hpp" 26 #define SCRIPT_GUARD_VOID \ 27 auto object_ptr = get_object_ptr(); \ 28 if (object_ptr == nullptr) { \ 29 log_fatal << "error: script is accessing a dead object: " \ 30 << m_uid << std::endl; \ 33 auto& object = *object_ptr 35 #define SCRIPT_GUARD_DEFAULT \ 36 auto object_ptr = get_object_ptr(); \ 37 if (object_ptr == nullptr) { \ 38 log_fatal << "error: script is accessing a dead object: " \ 39 << m_uid << std::endl; \ 42 auto& object = *object_ptr 44 #define SCRIPT_GUARD_RETURN(x) \ 45 auto object_ptr = get_object_ptr(); \ 46 if (object_ptr == nullptr) { \ 47 log_fatal << "error: script is accessing a dead object: " \ 48 << m_uid << std::endl; \ 51 auto& object __attribute__((unused)) = *object_ptr 71 T* get_object_ptr()
const 73 return get_game_object_manager().get_object_by_uid<T>(m_uid);
WARNING: This file is automatically generated from: 'src/scripting/wrapper.interface.hpp' DO NOT CHANGE.
Definition: ambient_sound.cpp:21
Definition: game_object.hpp:60
Definition: game_object_manager.hpp:34