public static KCL GetKCL(string name) { if (m_Clsns.ContainsKey(name)) { CachedKCL found = m_Clsns[name]; found.m_References++; return(found.m_Clsn); } if (!Program.m_ROM.FileExists(name)) { return(null); } NitroFile kclfile = Program.m_ROM.GetFileFromName(name); KCL clsn = new KCL(kclfile); CachedKCL ckcl = new CachedKCL(); ckcl.m_Clsn = clsn; ckcl.m_References = 1; m_Clsns.Add(name, ckcl); return(clsn); }
public static void RemoveKCL(string clsnName) { if (!m_Clsns.ContainsKey(clsnName)) { return; } CachedKCL ckcl = m_Clsns[clsnName]; ckcl.m_References--; if (ckcl.m_References > 0) { return; } m_Clsns.Remove(clsnName); }