//////////////////////////////////////////////////////////////////////////////// // lib_inc_randoms - This library has functions used by random functions // By Deva B. Winblood. November 11th, 2008 //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////// // PROTOTYPES //////////////////////////////////// // FILE: lib_inc_randoms FUNCTION: RND_GetStorageID() // This will return the ID number to use for storing information attached // to this object. If an ID number does not exist it will create one. int RND_GetStorageID(object oObject); // FILE: lib_inc_randoms FUNCTION: RND_GetStoredInt() // This will return the integer variable stored for the specified storage // ID. int RND_GetStoredInt(int nStorageID,string sVariable); // FILE: lib_inc_randoms FUNCTION: RND_GetStoredString() // This will return the string variable stored for the specified storage // ID. string RND_GetStoredString(int nStorageID, string sVariable); // FILE: lib_inc_randoms FUNCTION: RND_GetStoredFloat() // This will return the float variable stored for the specified storage // ID. float RND_GetStoredFloat(int nStorageID, string sVariable); // FILE: lib_inc_randoms FUNCTION: RND_GetStoredLocation() // This will return the location variable stored for the specified storage // ID. location RND_GetStoredLocation(int nStorageID, string sVariable); // FILE: lib_inc_randoms FUNCTION: RND_GetStoredObject() // This will return the object variable stored for the specified storage // ID. object RND_GetStoredObject(int nStorageID, string sVariable); // FILE: lib_inc_randoms FUNCTION: RND_DeleteStoredInt() // This will delete the specified storage ID based variable. void RND_DeleteStoredInt(int nStorageID,string sVariable); // FILE: lib_inc_randoms FUNCTION: RND_DeleteStoredString() // This will delete the specified storage ID based variable. void RND_DeleteStoredString(int nStorageID,string sVariable); // FILE: lib_inc_randoms FUNCTION: RND_DeleteStoredFloat() // This will delete the specified storage ID based variable. void RND_DeleteStoredFloat(int nStorageID,string sVariable); // FILE: lib_inc_randoms FUNCTION: RND_DeleteStoredLocation() // This will delete the specified storage ID based variable. void RND_DeleteStoredLocation(int nStorageID,string sVariable); // FILE: lib_inc_randoms FUNCTION: RND_DeleteStoredObject() // This will delete the specified storage ID based variable. void RND_DeleteStoredObject(int nStorageID,string sVariable); // FILE: lib_inc_randoms FUNCTION: RND_SetStoredInt() // This will set the stored values bades on the nStorageID. void RND_SetStoredInt(int nStorageID, string sVariable,int nValue); // FILE: lib_inc_randoms FUNCTION: RND_SetStoredFloat() // This will set the stored values bades on the nStorageID. void RND_SetStoredFloat(int nStorageID, string sVariable,float fValue); // FILE: lib_inc_randoms FUNCTION: RND_SetStoredString() // This will set the stored values bades on the nStorageID. void RND_SetStoredString(int nStorageID, string sVariable,string sValue); // FILE: lib_inc_randoms FUNCTION: RND_SetStoredLocation() // This will set the stored values bades on the nStorageID. void RND_SetStoredLocation(int nStorageID, string sVariable,location lValue); // FILE: lib_inc_randoms FUNCTION: RND_SetStoredObject() // This will set the stored values bades on the nStorageID. void RND_SetStoredObject(int nStorageID, string sVariable,object oValue); //////////////////////////////////// // FUNCTIONS //////////////////////////////////// int RND_GetStorageID(object oObject) { // PURPOSE: Return a Storage ID int nRet=GetLocalInt(oObject,"nStorageID"); if (nRet==0) { // create ID object oMod=GetModule(); int nLast=GetLocalInt(oMod,"nLastStorageID"); nRet=nLast+1; SetLocalInt(oObject,"nStorageID",nRet); SetLocalInt(oMod,"nLastStorageID",nRet); } // create ID return nRet; } // RND_GetStorageID() int RND_GetStoredInt(int nStorageID,string sVariable) { // PURPOSE: Return stored value return GetLocalInt(GetModule(),"nSV"+IntToString(nStorageID)+"_"+sVariable); } // RND_GetStoredInt() string RND_GetStoredString(int nStorageID,string sVariable) { // PURPOSE: Return stored value return GetLocalString(GetModule(),"sSV"+IntToString(nStorageID)+"_"+sVariable); } // RND_GetStoredString() float RND_GetStoredFloat(int nStorageID,string sVariable) { // PURPOSE: Return stored value return GetLocalFloat(GetModule(),"fSV"+IntToString(nStorageID)+"_"+sVariable); } // RND_GetStoredFloat() location RND_GetStoredLocation(int nStorageID,string sVariable) { // PURPOSE: Return stored value return GetLocalLocation(GetModule(),"lSV"+IntToString(nStorageID)+"_"+sVariable); } // RND_GetStoredLocation() object RND_GetStoredObject(int nStorageID,string sVariable) { // PURPOSE: Return stored value return GetLocalObject(GetModule(),"oSV"+IntToString(nStorageID)+"_"+sVariable); } // RND_GetStoredObject() void RND_DeleteStoredInt(int nStorageID,string sVariable) { // PURPOSE: Delete Stored value DeleteLocalInt(GetModule(),"nSV"+IntToString(nStorageID)+"_"+sVariable); } // RND_DeleteStoredInt() void RND_DeleteStoredString(int nStorageID,string sVariable) { // PURPOSE: Delete Stored value DeleteLocalString(GetModule(),"sSV"+IntToString(nStorageID)+"_"+sVariable); } // RND_DeleteStoredString() void RND_DeleteStoredFloat(int nStorageID,string sVariable) { // PURPOSE: Delete Stored value DeleteLocalFloat(GetModule(),"fSV"+IntToString(nStorageID)+"_"+sVariable); } // RND_DeleteStoredFloat() void RND_DeleteStoredLocation(int nStorageID,string sVariable) { // PURPOSE: Delete Stored value DeleteLocalLocation(GetModule(),"lSV"+IntToString(nStorageID)+"_"+sVariable); } // RND_DeleteStoredLocation() void RND_DeleteStoredObject(int nStorageID,string sVariable) { // PURPOSE: Delete Stored value DeleteLocalObject(GetModule(),"oSV"+IntToString(nStorageID)+"_"+sVariable); } // RND_DeleteStoredObject() void RND_SetStoredInt(int nStorageID, string sVariable,int nValue) { // PURPOSE: Set stored value SetLocalInt(GetModule(),"nSV"+IntToString(nStorageID)+"_"+sVariable,nValue); } // RND_SetStoredInt() void RND_SetStoredString(int nStorageID, string sVariable,string sValue) { // PURPOSE: Set stored value SetLocalString(GetModule(),"sSV"+IntToString(nStorageID)+"_"+sVariable,sValue); } // RND_SetStoredString() void RND_SetStoredLocation(int nStorageID, string sVariable,location lValue) { // PURPOSE: Set stored value SetLocalLocation(GetModule(),"lSV"+IntToString(nStorageID)+"_"+sVariable,lValue); } // RND_SetStoredLocation() void RND_SetStoredFloat(int nStorageID, string sVariable,float fValue) { // PURPOSE: Set stored value SetLocalFloat(GetModule(),"fSV"+IntToString(nStorageID)+"_"+sVariable,fValue); } // RND_SetStoredFloat() void RND_SetStoredObject(int nStorageID, string sVariable,object oValue) { // PURPOSE: Set stored value SetLocalObject(GetModule(),"oSV"+IntToString(nStorageID)+"_"+sVariable,oValue); } // RND_SetStoredObject() //void main(){}