public static string Store(string type, string Prefix, DebugStorage storage, bool Print = true, int randomLen = 5) { if (storage == null) { return(null); } if (Variables.GetBool("programDebug") && Variables.GetBool(type.ToLower() + "Debug")) { var vName = "DebugStorage_" + Prefix + "_" + GlobalVars.RandomString(randomLen); //KeyValuePair<string, CommandTypes> k = new KeyValuePair<string, CommandTypes>(Command, result); Variables.SetVariableObject(vName, storage, new List <string>() { "ESCRIPT", "Debug", "Hidden" }); if (Print) { Debug.Log("Parser", "[CmdType] Storage -> " + vName); } return(vName); } else { return(null); } }
public static DebugStorage GetSafeStorage(string type, params object[] values) { if (Variables.GetBool("programDebug") && Variables.GetBool(type.ToLower() + "Debug")) { DebugStorage storage = new DebugStorage(); foreach (var a in values) { storage.Storage.Add(a); } return(storage); } return(null); }