//***************************************************************************
//*
//*     <lib> Hash(priv) v1    by AppleSheep
//*
//***************************************************************************

    #if Hash != null
        private hashtable Hash = InitHashtable()
    #endif

    #define {
        private SaveIndex(x,y,v)                 = Save##Integer(Hash,x,y,v)
        private SaveInteger(x,y,v)               = Save##Integer(Hash,x,y,v)
        private SaveReal(x,y,v)                  = Save##Real(Hash,x,y,v)
        private SaveBoolean(x,y,v)               = Save##Boolean(Hash,x,y,v)
        private SaveString(x,y,v)                = SaveStr(Hash,x,y,v)
        private SaveAgent(x,y,v)                 = SaveAgentHandle(Hash,x,y,v)
        private SaveWidget(x,y,v)                = SaveWidgetHandle(Hash,x,y,v)
        private SaveHashtable(x,y,v)             = SaveHashtableHandle(Hash,x,y,v)
        private SavePlayer(x,y,v)                = SavePlayerHandle(Hash,x,y,v)
        private SaveDestructable(x,y,v)          = SaveDestructableHandle(Hash,x,y,v)
        private SaveItem(x,y,v)                  = SaveItemHandle(Hash,x,y,v)
        private SaveUnit(x,y,v)                  = SaveUnitHandle(Hash,x,y,v)
        private SaveAbility(x,y,v)               = SaveAbilityHandle(Hash,x,y,v)
        private SaveTimer(x,y,v)                 = SaveTimerHandle(Hash,x,y,v)
        private SaveTrigger(x,y,v)               = SaveTriggerHandle(Hash,x,y,v)
        private SaveTriggerEvent(x,y,v)          = SaveTriggerEventHandle(Hash,x,y,v)
        private SaveTriggerCondition(x,y,v)      = SaveTriggerConditionHandle(Hash,x,y,v)
        private SaveTriggerAction(x,y,v)         = SaveTriggerActionHandle(Hash,x,y,v)
        private SaveForce(x,y,v)                 = SaveForceHandle(Hash,x,y,v)
        private SaveGroup(x,y,v)                 = SaveGroupHandle(Hash,x,y,v)
        private SaveLocation(x,y,v)              = SaveLocationHandle(Hash,x,y,v)
        private SaveRect(x,y,v)                  = SaveRectHandle(Hash,x,y,v)
        private SaveBooleanExpr(x,y,v)           = SaveBooleanExprHandle(Hash,x,y,v)
        private SaveSound(x,y,v)                 = SaveSoundHandle(Hash,x,y,v)
        private SaveEffect(x,y,v)                = SaveEffectHandle(Hash,x,y,v)
        private SaveUnitPool(x,y,v)              = SaveUnitPoolHandle(Hash,x,y,v)
        private SaveItemPool(x,y,v)              = SaveItemPoolHandle(Hash,x,y,v)
        private SaveQuest(x,y,v)                 = SaveQuestHandle(Hash,x,y,v)
        private SaveQuestItem(x,y,v)             = SaveQuestItemHandle(Hash,x,y,v)
        private SaveDefeatCondition(x,y,v)       = SaveDefeatConditionHandle(Hash,x,y,v)
        private SaveTimerDialog(x,y,v)           = SaveTimerDialogHandle(Hash,x,y,v)
        private SaveLeaderboard(x,y,v)           = SaveLeaderboardHandle(Hash,x,y,v)
        private SaveMultiboard(x,y,v)            = SaveMultiboardHandle(Hash,x,y,v)
        private SaveMultiboardItem(x,y,v)        = SaveMultiboardItemHandle(Hash,x,y,v)
        private SaveTrackable(x,y,v)             = SaveTrackableHandle(Hash,x,y,v)
        private SaveDialog(x,y,v)                = SaveDialogHandle(Hash,x,y,v)
        private SaveButton(x,y,v)                = SaveButtonHandle(Hash,x,y,v)
        private SaveTextTag(x,y,v)               = SaveTextTagHandle(Hash,x,y,v)
        private SaveLightning(x,y,v)             = SaveLightningHandle(Hash,x,y,v)
        private SaveImage(x,y,v)                 = SaveImageHandle(Hash,x,y,v)
        private SaveUbersplat(x,y,v)             = SaveUbersplatHandle(Hash,x,y,v)
        private SaveRegion(x,y,v)                = SaveRegionHandle(Hash,x,y,v)
        private SaveFogState(x,y,v)              = SaveFogStateHandle(Hash,x,y,v)
        private SaveFogModifier(x,y,v)           = SaveFogModifierHandle(Hash,x,y,v)
        private SaveIndex(Hash,x,y,v)            = Save##Integer(Hash,x,y,v)
        private SaveInteger(Hash,x,y,v)          = Save##Integer(Hash,x,y,v)
        private SaveReal(Hash,x,y,v)             = Save##Real(Hash,x,y,v)
        private SaveBoolean(Hash,x,y,v)          = Save##Boolean(Hash,x,y,v)
        private SaveString(Hash,x,y,v)           = SaveStr(Hash,x,y,v)
        private SaveAgent(Hash,x,y,v)            = SaveAgentHandle(Hash,x,y,v)
        private SaveWidget(Hash,x,y,v)           = SaveWidgetHandle(Hash,x,y,v)
        private SaveHashtable(Hash,x,y,v)        = SaveHashtableHandle(Hash,x,y,v)
        private SavePlayer(Hash,x,y,v)           = SavePlayerHandle(Hash,x,y,v)
        private SaveDestructable(Hash,x,y,v)     = SaveDestructableHandle(Hash,x,y,v)
        private SaveItem(Hash,x,y,v)             = SaveItemHandle(Hash,x,y,v)
        private SaveUnit(Hash,x,y,v)             = SaveUnitHandle(Hash,x,y,v)
        private SaveAbility(Hash,x,y,v)          = SaveAbilityHandle(Hash,x,y,v)
        private SaveTimer(Hash,x,y,v)            = SaveTimerHandle(Hash,x,y,v)
        private SaveTrigger(Hash,x,y,v)          = SaveTriggerHandle(Hash,x,y,v)
        private SaveTriggerEvent(Hash,x,y,v)     = SaveTriggerEventHandle(Hash,x,y,v)
        private SaveTriggerCondition(Hash,x,y,v) = SaveTriggerConditionHandle(Hash,x,y,v)
        private SaveTriggerAction(Hash,x,y,v)    = SaveTriggerActionHandle(Hash,x,y,v)
        private SaveForce(Hash,x,y,v)            = SaveForceHandle(Hash,x,y,v)
        private SaveGroup(Hash,x,y,v)            = SaveGroupHandle(Hash,x,y,v)
        private SaveLocation(Hash,x,y,v)         = SaveLocationHandle(Hash,x,y,v)
        private SaveRect(Hash,x,y,v)             = SaveRectHandle(Hash,x,y,v)
        private SaveBooleanExpr(Hash,x,y,v)      = SaveBooleanExprHandle(Hash,x,y,v)
        private SaveSound(Hash,x,y,v)            = SaveSoundHandle(Hash,x,y,v)
        private SaveEffect(Hash,x,y,v)           = SaveEffectHandle(Hash,x,y,v)
        private SaveUnitPool(Hash,x,y,v)         = SaveUnitPoolHandle(Hash,x,y,v)
        private SaveItemPool(Hash,x,y,v)         = SaveItemPoolHandle(Hash,x,y,v)
        private SaveQuest(Hash,x,y,v)            = SaveQuestHandle(Hash,x,y,v)
        private SaveQuestItem(Hash,x,y,v)        = SaveQuestItemHandle(Hash,x,y,v)
        private SaveDefeatCondition(Hash,x,y,v)  = SaveDefeatConditionHandle(Hash,x,y,v)
        private SaveTimerDialog(Hash,x,y,v)      = SaveTimerDialogHandle(Hash,x,y,v)
        private SaveLeaderboard(Hash,x,y,v)      = SaveLeaderboardHandle(Hash,x,y,v)
        private SaveMultiboard(Hash,x,y,v)       = SaveMultiboardHandle(Hash,x,y,v)
        private SaveMultiboardItem(Hash,x,y,v)   = SaveMultiboardItemHandle(Hash,x,y,v)
        private SaveTrackable(Hash,x,y,v)        = SaveTrackableHandle(Hash,x,y,v)
        private SaveDialog(Hash,x,y,v)           = SaveDialogHandle(Hash,x,y,v)
        private SaveButton(Hash,x,y,v)           = SaveButtonHandle(Hash,x,y,v)
        private SaveTextTag(Hash,x,y,v)          = SaveTextTagHandle(Hash,x,y,v)
        private SaveLightning(Hash,x,y,v)        = SaveLightningHandle(Hash,x,y,v)
        private SaveImage(Hash,x,y,v)            = SaveImageHandle(Hash,x,y,v)
        private SaveUbersplat(Hash,x,y,v)        = SaveUbersplatHandle(Hash,x,y,v)
        private SaveRegion(Hash,x,y,v)           = SaveRegionHandle(Hash,x,y,v)
        private SaveFogState(Hash,x,y,v)         = SaveFogStateHandle(Hash,x,y,v)
        private SaveFogModifier(Hash,x,y,v)      = SaveFogModifierHandle(Hash,x,y,v)

        private LoadIndex(x,y)                 = Load##Integer(Hash,x,y)
        private LoadInteger(x,y)               = Load##Integer(Hash,x,y)
        private LoadReal(x,y)                  = Load##Real(Hash,x,y)
        private LoadBoolean(x,y)               = Load##Boolean(Hash,x,y)
        private LoadString(x,y)                = LoadStr(Hash,x,y)
        private LoadAgent(x,y)                 = LoadAgentHandle(Hash,x,y)
        private LoadWidget(x,y)                = LoadWidgetHandle(Hash,x,y)
        private LoadHashtable(x,y)             = LoadHashtableHandle(Hash,x,y)
        private LoadPlayer(x,y)                = LoadPlayerHandle(Hash,x,y)
        private LoadDestructable(x,y)          = LoadDestructableHandle(Hash,x,y)
        private LoadItem(x,y)                  = LoadItemHandle(Hash,x,y)
        private LoadUnit(x,y)                  = LoadUnitHandle(Hash,x,y)
        private LoadAbility(x,y)               = LoadAbilityHandle(Hash,x,y)
        private LoadTimer(x,y)                 = LoadTimerHandle(Hash,x,y)
        private LoadTrigger(x,y)               = LoadTriggerHandle(Hash,x,y)
        private LoadTriggerEvent(x,y)          = LoadTriggerEventHandle(Hash,x,y)
        private LoadTriggerCondition(x,y)      = LoadTriggerConditionHandle(Hash,x,y)
        private LoadTriggerAction(x,y)         = LoadTriggerActionHandle(Hash,x,y)
        private LoadForce(x,y)                 = LoadForceHandle(Hash,x,y)
        private LoadGroup(x,y)                 = LoadGroupHandle(Hash,x,y)
        private LoadLocation(x,y)              = LoadLocationHandle(Hash,x,y)
        private LoadRect(x,y)                  = LoadRectHandle(Hash,x,y)
        private LoadBooleanExpr(x,y)           = LoadBooleanExprHandle(Hash,x,y)
        private LoadSound(x,y)                 = LoadSoundHandle(Hash,x,y)
        private LoadEffect(x,y)                = LoadEffectHandle(Hash,x,y)
        private LoadUnitPool(x,y)              = LoadUnitPoolHandle(Hash,x,y)
        private LoadItemPool(x,y)              = LoadItemPoolHandle(Hash,x,y)
        private LoadQuest(x,y)                 = LoadQuestHandle(Hash,x,y)
        private LoadQuestItem(x,y)             = LoadQuestItemHandle(Hash,x,y)
        private LoadDefeatCondition(x,y)       = LoadDefeatConditionHandle(Hash,x,y)
        private LoadTimerDialog(x,y)           = LoadTimerDialogHandle(Hash,x,y)
        private LoadLeaderboard(x,y)           = LoadLeaderboardHandle(Hash,x,y)
        private LoadMultiboard(x,y)            = LoadMultiboardHandle(Hash,x,y)
        private LoadMultiboardItem(x,y)        = LoadMultiboardItemHandle(Hash,x,y)
        private LoadTrackable(x,y)             = LoadTrackableHandle(Hash,x,y)
        private LoadDialog(x,y)                = LoadDialogHandle(Hash,x,y)
        private LoadButton(x,y)                = LoadButtonHandle(Hash,x,y)
        private LoadTextTag(x,y)               = LoadTextTagHandle(Hash,x,y)
        private LoadLightning(x,y)             = LoadLightningHandle(Hash,x,y)
        private LoadImage(x,y)                 = LoadImageHandle(Hash,x,y)
        private LoadUbersplat(x,y)             = LoadUbersplatHandle(Hash,x,y)
        private LoadRegion(x,y)                = LoadRegionHandle(Hash,x,y)
        private LoadFogState(x,y)              = LoadFogStateHandle(Hash,x,y)
        private LoadFogModifier(x,y)           = LoadFogModifierHandle(Hash,x,y)
        private LoadIndex(Hash,x,y)            = Load##Integer(Hash,x,y)
        private LoadInteger(Hash,x,y)          = Load##Integer(Hash,x,y)
        private LoadReal(Hash,x,y)             = Load##Real(Hash,x,y)
        private LoadBoolean(Hash,x,y)          = Load##Boolean(Hash,x,y)
        private LoadString(Hash,x,y)           = LoadStr(Hash,x,y)
        private LoadAgent(Hash,x,y)            = LoadAgentHandle(Hash,x,y)
        private LoadWidget(Hash,x,y)           = LoadWidgetHandle(Hash,x,y)
        private LoadHashtable(Hash,x,y)        = LoadHashtableHandle(Hash,x,y)
        private LoadPlayer(Hash,x,y)           = LoadPlayerHandle(Hash,x,y)
        private LoadDestructable(Hash,x,y)     = LoadDestructableHandle(Hash,x,y)
        private LoadItem(Hash,x,y)             = LoadItemHandle(Hash,x,y)
        private LoadUnit(Hash,x,y)             = LoadUnitHandle(Hash,x,y)
        private LoadAbility(Hash,x,y)          = LoadAbilityHandle(Hash,x,y)
        private LoadTimer(Hash,x,y)            = LoadTimerHandle(Hash,x,y)
        private LoadTrigger(Hash,x,y)          = LoadTriggerHandle(Hash,x,y)
        private LoadTriggerEvent(Hash,x,y)     = LoadTriggerEventHandle(Hash,x,y)
        private LoadTriggerCondition(Hash,x,y) = LoadTriggerConditionHandle(Hash,x,y)
        private LoadTriggerAction(Hash,x,y)    = LoadTriggerActionHandle(Hash,x,y)
        private LoadForce(Hash,x,y)            = LoadForceHandle(Hash,x,y)
        private LoadGroup(Hash,x,y)            = LoadGroupHandle(Hash,x,y)
        private LoadLocation(Hash,x,y)         = LoadLocationHandle(Hash,x,y)
        private LoadRect(Hash,x,y)             = LoadRectHandle(Hash,x,y)
        private LoadBooleanExpr(Hash,x,y)      = LoadBooleanExprHandle(Hash,x,y)
        private LoadSound(Hash,x,y)            = LoadSoundHandle(Hash,x,y)
        private LoadEffect(Hash,x,y)           = LoadEffectHandle(Hash,x,y)
        private LoadUnitPool(Hash,x,y)         = LoadUnitPoolHandle(Hash,x,y)
        private LoadItemPool(Hash,x,y)         = LoadItemPoolHandle(Hash,x,y)
        private LoadQuest(Hash,x,y)            = LoadQuestHandle(Hash,x,y)
        private LoadQuestItem(Hash,x,y)        = LoadQuestItemHandle(Hash,x,y)
        private LoadDefeatCondition(Hash,x,y)  = LoadDefeatConditionHandle(Hash,x,y)
        private LoadTimerDialog(Hash,x,y)      = LoadTimerDialogHandle(Hash,x,y)
        private LoadLeaderboard(Hash,x,y)      = LoadLeaderboardHandle(Hash,x,y)
        private LoadMultiboard(Hash,x,y)       = LoadMultiboardHandle(Hash,x,y)
        private LoadMultiboardItem(Hash,x,y)   = LoadMultiboardItemHandle(Hash,x,y)
        private LoadTrackable(Hash,x,y)        = LoadTrackableHandle(Hash,x,y)
        private LoadDialog(Hash,x,y)           = LoadDialogHandle(Hash,x,y)
        private LoadButton(Hash,x,y)           = LoadButtonHandle(Hash,x,y)
        private LoadTextTag(Hash,x,y)          = LoadTextTagHandle(Hash,x,y)
        private LoadLightning(Hash,x,y)        = LoadLightningHandle(Hash,x,y)
        private LoadImage(Hash,x,y)            = LoadImageHandle(Hash,x,y)
        private LoadUbersplat(Hash,x,y)        = LoadUbersplatHandle(Hash,x,y)
        private LoadRegion(Hash,x,y)           = LoadRegionHandle(Hash,x,y)
        private LoadFogState(Hash,x,y)         = LoadFogStateHandle(Hash,x,y)
        private LoadFogModifier(Hash,x,y)      = LoadFogModifierHandle(Hash,x,y)

        private HaveIndex(x,y)        = HaveSavedInteger(Hash,x,y)
        private HaveInteger(x,y)      = HaveSavedInteger(Hash,x,y)
        private HaveReal(x,y)         = HaveSavedReal(Hash,x,y)
        private HaveBoolean(x,y)      = HaveSavedBoolean(Hash,x,y)
        private HaveString(x,y)       = HaveSavedString(Hash,x,y)
        private HaveHandle(x,y)       = HaveSavedHandle(Hash,x,y)
        private HaveIndex(Hash,x,y)   = HaveSavedInteger(Hash,x,y)
        private HaveInteger(Hash,x,y) = HaveSavedInteger(Hash,x,y)
        private HaveReal(Hash,x,y)    = HaveSavedReal(Hash,x,y)
        private HaveBoolean(Hash,x,y) = HaveSavedBoolean(Hash,x,y)
        private HaveString(Hash,x,y)  = HaveSavedString(Hash,x,y)
        private HaveHandle(Hash,x,y)  = HaveSavedHandle(Hash,x,y)

        private RemoveIndex(x,y)        = RemoveSavedInteger(Hash,x,y)
        private RemoveInteger(x,y)      = RemoveSavedInteger(Hash,x,y)
        private RemoveReal(x,y)         = RemoveSavedReal(Hash,x,y)
        private RemoveBoolean(x,y)      = RemoveSavedBoolean(Hash,x,y)
        private RemoveString(x,y)       = RemoveSavedString(Hash,x,y)
        private RemoveHandle(x,y)       = RemoveSavedHandle(Hash,x,y)
        private RemoveIndex(Hash,x,y)   = RemoveSavedInteger(Hash,x,y)
        private RemoveInteger(Hash,x,y) = RemoveSavedInteger(Hash,x,y)
        private RemoveReal(Hash,x,y)    = RemoveSavedReal(Hash,x,y)
        private RemoveBoolean(Hash,x,y) = RemoveSavedBoolean(Hash,x,y)
        private RemoveString(Hash,x,y)  = RemoveSavedString(Hash,x,y)
        private RemoveHandle(Hash,x,y)  = RemoveSavedHandle(Hash,x,y)

        private RemoveHash()       = FlushParentHashtable(Hash)
        private RemoveHash(x)      = FlushChildHashtable(Hash,x)
        private RemoveHash(Hash,x) = FlushChildHashtable(Hash,x)
    }

