コード例 #1
0
        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();
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 public EvaReportObserver(StorageCache cache, ProfileData.ExperimentSettings settings, BiomeFilter filter,
                          ScanInterface scanInterface, string expid = "evaReport")
     : base(cache, settings, filter, scanInterface, expid)
 {
 }
コード例 #4
0
 public RequiresCrew(StorageCache cache, ProfileData.ExperimentSettings settings, BiomeFilter filter,
                     ScanInterface scanInterface, string expid)
     : base(cache, settings, filter, scanInterface, expid)
 {
     requireControllable = false;
 }