|
发表于 2011-12-30 05:49:08
|
显示全部楼层
不规范的生要改的话可以参照一下这个套路
[jass]//124
hashtable CF_I2H=InitHashtable()
function H2I takes handle h returns integer
return GetHandleId(h)
endfunction
function I2U takes integer i returns unit
return LoadUnitHandle(CF_I2H,0,i)
endfunction
function I2T takes integer i returns timer
return LoadTimerHandle(CF_I2H,0,i)
endfunction
function I2TD takes integer i returns timerdialog
return LoadTimerDialogHandle(CF_I2H,0,i)
endfunction
function CF_SaveUnit takes gamecache cache, string missionKey, string key, unit value returns nothing
call StoreInteger(cache,missionKey,key,H2I(value))
call SaveUnitHandle(CF_I2H,0,H2I(value),value)
endfunction
function CF_SaveTimer takes gamecache cache, string missionKey, string key, timer value returns nothing
call StoreInteger(cache,missionKey,key,H2I(value))
call SaveTimerHandle(CF_I2H,0,H2I(value),value)
endfunction
function CF_SaveTimerDialog takes gamecache cache, string missionKey, string key, timerdialog value returns nothing
call StoreInteger(cache,missionKey,key,H2I(value))
call SaveTimerDialogHandle(CF_I2H,0,H2I(value),value)
endfunction
//120
function H2I takes handle h returns integer
return h
return 0
endfunction
function I2U takes integer i returns unit
return i
return null
endfunction
function I2T takes integer i returns timer
return i
return null
endfunction
function I2TD takes integer i returns timerdialog
return i
return null
endfunction
function CF_SaveUnit takes gamecache cache, string missionKey, string key, unit value returns nothing
call StoreInteger(cache,missionKey,key,H2I(value))
//call SaveUnitHandle(CF_I2H,0,H2I(value),value)
endfunction
function CF_SaveTimer takes gamecache cache, string missionKey, string key, timer value returns nothing
call StoreInteger(cache,missionKey,key,H2I(value))
//call SaveTimerHandle(CF_I2H,0,H2I(value),value)
endfunction
function CF_SaveTimerDialog takes gamecache cache, string missionKey, string key, timerdialog value returns nothing
call StoreInteger(cache,missionKey,key,H2I(value))
//call SaveTimerDialogHandle(CF_I2H,0,H2I(value),value)
endfunction[/jass]
只需要做几次全文替换就可以用了 |
|