public ExperimentObserver(StorageCache cache, ExperimentSettings expSettings, BiomeFilter filter, ScanInterface scanMapInterface, string expid, ModuleScienceExperiment exp = null) { settings = expSettings; biomeFilter = filter; requireControllable = true; if (exp != null) { rerunnable = exp.rerunnable; resettable = exp.resettable; } if (scanMapInterface == null) { scanMapInterface = new DefaultScanInterface(); } scanInterface = scanMapInterface; experiment = ResearchAndDevelopment.GetExperiment(expid); if (experiment == null) { Log.Error("Failed to get experiment '{0}'", expid); } storage = cache; Rescan(); }
public event Callback OnExperimentsScanned = delegate { }; // called whenever the observers rescan the ship, typically void Awake() { vesselStorage = gameObject.AddComponent <StorageCache>(); biomeFilter = gameObject.AddComponent <BiomeFilter>(); scienceAlert = gameObject.GetComponent <ScienceAlert>(); audio = GetComponent <AudioPlayer>() ?? AudioPlayer.Audio; scienceAlert.OnScanInterfaceChanged += OnScanInterfaceChanged; scienceAlert.OnToolbarButtonChanged += OnToolbarButtonChanged; GameEvents.onVesselWasModified.Add(OnVesselWasModified); GameEvents.onVesselChange.Add(OnVesselChanged); GameEvents.onVesselDestroy.Add(OnVesselDestroyed); }
public EvaReportObserver(StorageCache cache, ProfileData.ExperimentSettings settings, BiomeFilter filter, ScanInterface scanInterface, string expid = "evaReport") : base(cache, settings, filter, scanInterface, expid) { }
public RequiresCrew(StorageCache cache, ProfileData.ExperimentSettings settings, BiomeFilter filter, ScanInterface scanInterface, string expid) : base(cache, settings, filter, scanInterface, expid) { requireControllable = false; }