LoadAgentHandle can use to load agent value from hashtable
LoadHandle
JASS:
library HashtableTool
/*
Function list:
function LoadAgentHandle takes hashtable table, integer parentKey, integer childKey returns agent
--------------------------------------------------------------------
You can add agent support to Table by comment
| private struct agents extends array
| method operator []= takes integer key, agent value returns nothing
| call SaveAgentHandle(ht, this, key, value)
| endmethod
| endstruct
and add uses HashtableTool and add this line
| //! runtextmacro NEW_ARRAY("Agent", "agent")
--------------------------------------------------------------------
Note: This disable SaveInteger if you use SaveXXXHandle
*/
globals
private agent array HandleIDData
endglobals
private function SaveHandleID takes hashtable table,integer parentKey,integer childKey,agent value returns nothing
if (value==null) then
call RemoveSavedHandle(table,parentKey,childKey)
endif
call SaveInteger(table,parentKey,childKey,GetHandleId(value))
set HandleIDData[GetHandleId(value)-0x100000]=value
endfunction
function LoadAgentHandle takes hashtable table,integer parentKey,integer childKey returns agent
local integer hid=LoadInteger(table,parentKey,childKey)
return HandleIDData[hid-0x100000]
endfunction
hook SaveAgentHandle SaveHandleID
hook SavePlayerHandle SaveHandleID
hook SaveWidgetHandle SaveHandleID
hook SaveDestructableHandle SaveHandleID
hook SaveItemHandle SaveHandleID
hook SaveUnitHandle SaveHandleID
hook SaveAbilityHandle SaveHandleID
hook SaveTimerHandle SaveHandleID
hook SaveTriggerHandle SaveHandleID
hook SaveTriggerConditionHandle SaveHandleID
hook SaveTriggerEventHandle SaveHandleID
hook SaveForceHandle SaveHandleID
hook SaveGroupHandle SaveHandleID
hook SaveLocationHandle SaveHandleID
hook SaveRectHandle SaveHandleID
hook SaveBooleanExprHandle SaveHandleID
hook SaveSoundHandle SaveHandleID
hook SaveEffectHandle SaveHandleID
hook SaveQuestHandle SaveHandleID
hook SaveQuestItemHandle SaveHandleID
hook SaveDefeatConditionHandle SaveHandleID
hook SaveTimerDialogHandle SaveHandleID
hook SaveLeaderboardHandle SaveHandleID
hook SaveMultiboardHandle SaveHandleID
hook SaveMultiboardItemHandle SaveHandleID
hook SaveTrackableHandle SaveHandleID
hook SaveDialogHandle SaveHandleID
hook SaveButtonHandle SaveHandleID
hook SaveRegionHandle SaveHandleID
hook SaveFogModifierHandle SaveHandleID
hook SaveHashtableHandle SaveHandleID
endlibrary
LoadHandle
JASS:
function LoadHandle takes hashtable table, integer parentKey, integer childKey returns handle
return LoadFogStateHandle(table, parentKey, childKey)
endfunction
Last edited: