axmol/tools/bindings-generator/targets/lua/templates/apidoc_function_overload.sc...

62 lines
2.4 KiB
Plaintext
Raw Normal View History

2020-10-08 22:32:07 +08:00
--------------------------------
#set $max_arg_count = 0
#set $func_count = 0
#set $func_index = 0
#set $max_arg_func = 0
#for func in $implementations
#if len($func.arguments) >= $max_arg_count
#set $max_arg_count = len($func.arguments)
#set $max_arg_func = func
#end if
#set $func_tip = "@overload self"
#if len($func.arguments) >= $func.min_args
#set $arg_count = len($func.arguments)
#if $arg_count >0
#set $func_tip = $func_tip + ", "
#set $arg_index = 0
#for $arg in func.arguments
#if $arg_index < $arg_count - 1
#if $arg.is_enum
#set $func_tip = $func_tip + "int" + ", "
#else
#set $func_tip = $func_tip + $generator.lua_typename_from_natve($arg.namespaced_name) + ", "
#end if
#else
#if $arg.is_enum
#set $func_tip = $func_tip + "int"
#else
#set $func_tip = $func_tip + $generator.lua_typename_from_natve($arg.namespaced_name)
#end if
#end if
#set $arg_index = arg_index + 1
#end for
#end if
#end if
#set $func_tip = $func_tip
-- $func_tip
#set $func_index = $func_index + 1
#end for
-- @function [parent=#${class_name}] ${func_name}
-- @param self
#if $max_arg_count > 0
#set $arg_index = 0
#for $arg in $max_arg_func.arguments
#if $arg.is_enum
-- @param #int $max_arg_func.argumtntTips[$arg_index]
#else
-- @param #$generator.lua_typename_from_natve($arg.namespaced_name) $max_arg_func.argumtntTips[$arg_index]
#end if
#set $arg_index = $arg_index + 1
#end for
#end if
#if str($max_arg_func.ret_type) != "void"
#if $max_arg_func.ret_type.is_enum
-- @return int#int ret (return value: int)
#else
-- @return $generator.lua_typename_from_natve(max_arg_func.ret_type.namespaced_name, True)#$generator.lua_typename_from_natve(max_arg_func.ret_type.namespaced_name, True) ret (return value: $generator.lua_typename_from_natve(max_arg_func.ret_type.namespaced_name))
#end if
#else
-- @return $generator.lua_typename_from_natve($namespaced_class_name, True)#$generator.lua_typename_from_natve($namespaced_class_name, True) self (return value: $generator.lua_typename_from_natve($namespaced_class_name))
#end if