private static void SpawnedDeployablesRemove(int id, JDeployable instance) { spawnedDeployables.Remove(id); Type type; if (!TryGetType(instance.ToString(), out type)) { return; } if (spawnedDeployablesByType.ContainsKey(type)) { spawnedDeployablesByType[type].Remove(instance); } JInfoAttribute info; if (!DeployableTypes.TryGetValue(type, out info)) { return; } if (spawnedDeployablesByPlugin.ContainsKey(info.PluginInfo.Title)) { spawnedDeployablesByPlugin[info.PluginInfo.Title].Remove(instance); } }
private static bool SaveJDeployable(int id, JDeployable d) { DeployableSaveData sd = new DeployableSaveData { t = d.ToString(), s = d.data }; JInfoAttribute info = null; if (!DeployableTypes.TryGetValue(d.GetType(), out info)) { return(false); } if (!DataManager.data.p.ContainsKey(info.PluginInfo.Title)) { DataManager.data.p.Add(info.PluginInfo.Title, new Dictionary <int, DeployableSaveData>()); } DataManager.data.p[info.PluginInfo.Title].Add(id, sd); return(true); }