【HSP3】HNBridgeEx.as

HNBridge 可変長引数サポート(16個まで)

HNBridge 可変長引数サポート(16個まで)

  • hk1v
  • 2014/8/14 21:07
  • タグ:
  • タグはありません
#module HNBridgeEx
#define global CreateInstance(%1=a@HNBridgeEx,%2=a@HNBridgeEx,%3=a@HNBridgeEx, \
	%4=a@HNBridgeEx,%5=a@HNBridgeEx,%6=a@HNBridgeEx,%7=a@HNBridgeEx,%8=a@HNBridgeEx, \
	%9=a@HNBridgeEx,%10=a@HNBridgeEx,%11=a@HNBridgeEx,%12=a@HNBridgeEx, \
	%13=a@HNBridgeEx,%14=a@HNBridgeEx,%15=a@HNBridgeEx,%16=a@HNBridgeEx) \
	p1@HNBridgeEx=%1:p2@HNBridgeEx=%2:p3@HNBridgeEx=%3:p4@HNBridgeEx=%4: \
	p5@HNBridgeEx=%5:p6@HNBridgeEx=%6:p7@HNBridgeEx=%7:p8@HNBridgeEx=%8: \
	p9@HNBridgeEx=%9:p10@HNBridgeEx=%10:p11@HNBridgeEx=%11: \
	p12@HNBridgeEx=%12:p13@HNBridgeEx=%13:p14@HNBridgeEx=%14: \
	p15@HNBridgeEx=%15:p16@HNBridgeEx=%16: \
	_CreateInstance p1@HNBridgeEx,p2@HNBridgeEx,p3@HNBridgeEx,p4@HNBridgeEx, \
	p5@HNBridgeEx,p6@HNBridgeEx,p7@HNBridgeEx,p8@HNBridgeEx,p9@HNBridgeEx, \
	p10@HNBridgeEx,p11@HNBridgeEx,p12@HNBridgeEx,p13@HNBridgeEx,p14@HNBridgeEx, \
	p15@HNBridgeEx,p16@HNBridgeEx
#deffunc _CreateInstance var p1, var p2, var p3, var p4, \
	var p5, var p6, var p7, var p8, var p9, var p10, var p11, \
	var p12, var p13, var p14, var p15, var p16
	if vartype(p1) = 1{
		CreateInstanceWithZeroArgs
	}else : if vartype(p2) = 1{
		CreateInstanceWithOneArg p1
	}else : if vartype(p3) = 1{
		CreateInstanceWithTwoArgs p1, p2
	}else : if vartype(p4) = 1{
		CreateInstanceWithThreeArgs p1, p2, p3
	}else : if vartype(p5) = 1{
		CreateInstanceWithFourArgs p1, p2, p3, p4
	}else : if vartype(p6) = 1{
		CreateInstanceWithFiveArgs p1, p2, p3, p4, p5
	}else : if vartype(p7) = 1{
		CreateInstanceWithSixArgs p1, p2, p3, p4, p5, p6
	}else : if vartype(p8) = 1{
		CreateInstanceWithSevenArgs p1, p2, p3, p4, p5, p6, p7
	}else : if vartype(p9) = 1{
		CreateInstanceWithEightArgs p1, p2, p3, p4, p5, p6, p7, p8
	}else : if vartype(p10) = 1{
		CreateInstanceWithNineArgs p1, p2, p3, p4, p5, p6, p7, p8, p9
	}else : if vartype(p11) = 1{
		CreateInstanceWithTenArgs p1, p2, p3, p4, p5, p6, p7, p8, p9, p10
	}else : if vartype(p12) = 1{
		CreateInstanceWithElevenArgs p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11
	}else : if vartype(p13) = 1{
		CreateInstanceWithTwelveArgs p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12
	}else : if vartype(p14) = 1{
		CreateInstanceWithThirteenArgs p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13
	}else : if vartype(p15) = 1{
		CreateInstanceWithFourteenArgs p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14
	}else : if vartype(p16) = 1{
		CreateInstanceWith15Args p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15
	}else{
		CreateInstanceWith16Args p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16
	}
return stat
#define global InvokeMethod(%1="",%2=a@HNBridgeEx,%3=a@HNBridgeEx,%4=a@HNBridgeEx, \
	%5=a@HNBridgeEx,%6=a@HNBridgeEx,%7=a@HNBridgeEx,%8=a@HNBridgeEx,%9=a@HNBridgeEx, \
	%10=a@HNBridgeEx,%11=a@HNBridgeEx,%12=a@HNBridgeEx,%13=a@HNBridgeEx, \
	%14=a@HNBridgeEx,%15=a@HNBridgeEx,%16=a@HNBridgeEx,%17=a@HNBridgeEx) \
	p1@HNBridgeEx=%2:p2@HNBridgeEx=%3:p3@HNBridgeEx=%4:p4@HNBridgeEx=%5: \
	p5@HNBridgeEx=%6:p6@HNBridgeEx=%7:p7@HNBridgeEx=%8:p8@HNBridgeEx=%9: \
	p9@HNBridgeEx=%10:p10@HNBridgeEx=%11:p11@HNBridgeEx=%12: \
	p12@HNBridgeEx=%13:p13@HNBridgeEx=%14:p14@HNBridgeEx=%15: \
	p15@HNBridgeEx=%16:p16@HNBridgeEx=%17: \
	_InvokeMethod %1,p1@HNBridgeEx,p2@HNBridgeEx,p3@HNBridgeEx,p4@HNBridgeEx, \
	p5@HNBridgeEx,p6@HNBridgeEx,p7@HNBridgeEx,p8@HNBridgeEx,p9@HNBridgeEx, \
	p10@HNBridgeEx,p11@HNBridgeEx,p12@HNBridgeEx,p13@HNBridgeEx,p14@HNBridgeEx, \
	p15@HNBridgeEx,p16@HNBridgeEx
#deffunc _InvokeMethod str name, var p1, var p2, var p3, var p4, \
	var p5, var p6, var p7, var p8, var p9, var p10, var p11, \
	var p12, var p13, var p14, var p15, var p16
	if vartype(p1) = 1{
		InvokeMethodWithZeroArgs name
	}else : if vartype(p2) = 1{
		InvokeMethodWithOneArg name, p1
	}else : if vartype(p3) = 1{
		InvokeMethodWithTwoArgs name, p1, p2
	}else : if vartype(p4) = 1{
		InvokeMethodWithThreeArgs name, p1, p2, p3
	}else : if vartype(p5) = 1{
		InvokeMethodWithFourArgs name, p1, p2, p3, p4
	}else : if vartype(p6) = 1{
		InvokeMethodWithFiveArgs name, p1, p2, p3, p4, p5
	}else : if vartype(p7) = 1{
		InvokeMethodWithSixArgs name, p1, p2, p3, p4, p5, p6
	}else : if vartype(p8) = 1{
		InvokeMethodWithSevenArgs name, p1, p2, p3, p4, p5, p6, p7
	}else : if vartype(p9) = 1{
		InvokeMethodWithEightArgs name, p1, p2, p3, p4, p5, p6, p7, p8
	}else : if vartype(p10) = 1{
		InvokeMethodWithNineArgs name, p1, p2, p3, p4, p5, p6, p7, p8, p9
	}else : if vartype(p11) = 1{
		InvokeMethodWithTenArgs name, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10
	}else : if vartype(p12) = 1{
		InvokeMethodWithElevenArgs name, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11
	}else : if vartype(p13) = 1{
		InvokeMethodWithTwelveArgs name, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12
	}else : if vartype(p14) = 1{
		InvokeMethodWithThirteenArgs name, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13
	}else : if vartype(p15) = 1{
		InvokeMethodWithFourteenArgs name, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14
	}else : if vartype(p16) = 1{
		InvokeMethodWith15Args name, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15
	}else{
		InvokeMethodWith16Args name, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16
	}
return stat
#deffunc local init
	dimtype a, vartype("label"), 1
return
#global
init@HNBridgeEx