public PForwardedComponent GetLatestVersion(string id) { if (!remoteComponents.TryGetValue(id, out PForwardedComponent remoteComponent)) { // Attempt to resolve it object instantiated = getLatestVersion.Invoke(id); if (instantiated == null) { #if DEBUG PRegistry.LogPatchWarning("Unable to find a component matching: " + id); #endif remoteComponent = null; } else if (instantiated is PForwardedComponent inThisMod) { // Running the current version remoteComponent = inThisMod; } else { remoteComponent = new PRemoteComponent(instantiated); } remoteComponents.Add(id, remoteComponent); } return(remoteComponent); }
public object GetSharedData(string id) { return(getSharedData.Invoke(id)); }