//===========================================================================
// Easy Configuration
//===========================================================================
// Use the functions/textmacros defined here to change the behaviour of the system by changing
// what data is stored in a snapshot. You could, for example, store the unit's flying height as
// well by simply adding the commented out lines at the end of each function.
//! novjass
function StoreSnapshotData takes integer snapshot, unit whichUnit returns nothing
//! endnovjass
//! textmacro StoreSnapshotData
//Whenever a new snapshot of a unit is created, this code is run to store data.
//You can alter this function(JASS)/textmacro(vJASS) to store whatever values you need.
call SaveReal(udg_Wayback_Hashtable, snapshot, 0, GetUnitState(whichUnit, UNIT_STATE_LIFE))
call SaveReal(udg_Wayback_Hashtable, snapshot, 1, GetUnitState(whichUnit, UNIT_STATE_MANA))
call SaveReal(udg_Wayback_Hashtable, snapshot, 2, GetUnitX(whichUnit))
call SaveReal(udg_Wayback_Hashtable, snapshot, 3, GetUnitY(whichUnit))
// Example of user-defined data:
//call SaveReal(udg_Wayback_Hashtable, snapshot, 4, GetUnitFlyHeight(whichUnit))
//! endtextmacro
//! novjass
endfunction
//! endnovjass
//! novjass
function UnitLoadSnapshot takes integer snapshot, unit whichUnit returns nothing
//! endnovjass
//! textmacro UnitLoadSnapshot
//Whenever a new snapshot of a unit is created, this code is to restore the unit.
//You can alter this function(JASS)/textmacro(vJASS) to use any custom data you have added.
call SetUnitState(whichUnit, UNIT_STATE_LIFE, LoadReal(udg_Wayback_Hashtable, snapshot, 0))
call SetUnitState(whichUnit, UNIT_STATE_MANA, LoadReal(udg_Wayback_Hashtable, snapshot, 1))
call SetUnitX(whichUnit, LoadReal(udg_Wayback_Hashtable, snapshot, 2))
call SetUnitY(whichUnit, LoadReal(udg_Wayback_Hashtable, snapshot, 3))
// Example of user-defined data:
//call SetUnitFlyHeight(whichUnit, LoadReal(udg_Wayback_Hashtable, snapshot, 4))
//! endtextmacro
//! novjass
endfunction
//! endnovjass