| 250 | } |
| 251 | |
| 252 | void Register(sol::state* state, sol::table& parent) |
| 253 | { |
| 254 | auto tableUtil = sol::table(state->lua_state(), sol::create); |
| 255 | parent.set(ScriptReserved_Util, tableUtil); |
| 256 | |
| 257 | tableUtil.set_function(ScriptReserved_HasLineOfSight, &HasLineOfSight); |
| 258 | tableUtil.set_function(ScriptReserved_CalculateHorizontalDistance, &CalculateHorizontalDistance); |
| 259 | tableUtil.set_function(ScriptReserved_GetDisplayPosition, &GetDisplayPosition); |
| 260 | tableUtil.set_function(ScriptReserved_PickMoveable, &PickMoveable); |
| 261 | tableUtil.set_function(ScriptReserved_PickStatic, &PickStatic); |
| 262 | tableUtil.set_function(ScriptReserved_PercentToScreen, |
| 263 | sol::overload( |
| 264 | static_cast<std::tuple<int, int>(*)(float, float)>(&PercentToScreen), |
| 265 | static_cast<Vec2(*)(const Vec2&)>(&PercentToScreen) |
| 266 | ) |
| 267 | ); |
| 268 | tableUtil.set_function(ScriptReserved_ScreenToPercent, |
| 269 | sol::overload( |
| 270 | static_cast<std::tuple<float, float>(*)(int, int)>(&ScreenToPercent), |
| 271 | static_cast<Vec2(*)(const Vec2&)>(&ScreenToPercent) |
| 272 | ) |
| 273 | ); |
| 274 | tableUtil.set_function(ScriptReserved_PrintLog, &PrintLog); |
| 275 | |
| 276 | // COMPATIBILITY |
| 277 | tableUtil.set_function("CalculateDistance", &CalculateDistance); |
| 278 | |
| 279 | auto handler = LuaHandler(state); |
| 280 | handler.MakeReadOnlyTable(tableUtil, ScriptReserved_LogLevel, LOG_LEVEL_IDS); |
| 281 | } |
| 282 | } |
no test coverage detected