From f98698cb4efb774684a4dc772e16fd06a48103b5 Mon Sep 17 00:00:00 2001 From: Djeeberjr Date: Sun, 4 Jun 2023 20:24:36 +0200 Subject: [PATCH] getType has a multireturn of unkown size --- src/cc/Peripheral.hx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/cc/Peripheral.hx b/src/cc/Peripheral.hx index 53bd24e..31d6e19 100644 --- a/src/cc/Peripheral.hx +++ b/src/cc/Peripheral.hx @@ -1,5 +1,6 @@ package cc; +import lua.TableTools; import lua.Table; import haxe.Constraints; import haxe.extern.Rest; @@ -7,10 +8,16 @@ import haxe.extern.Rest; @:native("peripheral") extern class Peripheral { public static function isPresent(name:String):Bool; - public static function getType(name:String):String; public static function getMethods(name:String):Table; public static function call(name:String, method:String, args:Rest):T; public static function wrap(name:String):T; public static function find(type:String, ?filter:(String, T) -> Bool):Table; public static function getNames():Table; + + @:native("getType") private static function _getType(name:String): Dynamic; + + public static inline function getType(name:String): Table{ + return cast TableTools.pack(_getType(name)); + } + }