예제 #1
0
        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);
        }
예제 #2
0
 public object GetSharedData(string id)
 {
     return(getSharedData.Invoke(id));
 }