globals
hashtable HT = null
endglobals
function Init takes nothing returns nothing
call FlushParentHashtable( HT )
set HT = InitHashtable()
endfunction
function CreateArray3 takes integer index, integer size1, integer size2, integer size3 returns nothing
local integer i = 0
local integer j = 0
loop
exitwhen i >= size1
call SaveHashtableHandle( HT, index, i, InitHashtable() ) 这里好像是在哈希列表里保存一个哈希列表
set i = i + 1
endloop
endfunction
function SaveArray3 takes integer index, integer index1, integer index2, integer index3, integer value returns nothing
local hashtable child = LoadHashtableHandle( HT, index, index1 )
call SaveInteger( child, index2, index3, value ) 在child保存一个整数
set child = null 删除child,那么保存的整数还存在么??不知道怎么回事,是错误么??
endfunction
function LoadArray3 takes integer index, integer index1, integer index2, integer index3 returns integer
local hashtable child = LoadHashtableHandle( HT, index, index1 )
local integer value = LoadInteger( child, index2, index3 )
set child = null
return value 从保存在哈希列表里的哈希列表提取整数,没什么问题
endfunction
function DestroyArray3 takes integer index, integer size1, integer size2, integer size3 returns nothing
local integer i = 0
local integer j = 0
loop
exitwhen i >= size1
call FlushParentHashtable( LoadHashtableHandle( HT, index, i ) )
set i = i + 1
endloop
call FlushChildHashtable( HT, index )
endfunction |