当前位置: 首页>>代码示例>>C#>>正文


C# ScienceData类代码示例

本文整理汇总了C#中ScienceData的典型用法代码示例。如果您正苦于以下问题:C# ScienceData类的具体用法?C# ScienceData怎么用?C# ScienceData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ScienceData类属于命名空间,在下文中一共展示了ScienceData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Keep

        public void Keep(ScienceData data)
        {
            resetLabBonuses();

            if (keepDelegate != null)
                keepDelegate(data);
        }
开发者ID:Bear67,项目名称:WildBlueTools,代码行数:7,代码来源:FakeExperimentResults.cs

示例2: Reset

        public void Reset(ScienceData data)
        {
            resetLabBonuses();

            if (resetDelegate != null)
                resetDelegate(data);
        }
开发者ID:Bear67,项目名称:WildBlueTools,代码行数:7,代码来源:FakeExperimentResults.cs

示例3: ScienceDataValue

        public ScienceDataValue(ScienceData scienceData, global::Part hostPart)
        {
            this.scienceData = scienceData;
            this.hostPart = hostPart;

            InitializeSuffixes();
        }
开发者ID:KSP-KOS,项目名称:KOS,代码行数:7,代码来源:ScienceDataValue.cs

示例4: Process

        public void Process(ScienceData data)
        {
            resetLabBonuses();

            if (processDelegate != null)
                processDelegate(data);
        }
开发者ID:Bear67,项目名称:WildBlueTools,代码行数:7,代码来源:FakeExperimentResults.cs

示例5: Awake

		public void Awake() {
			vessel = this.GetComponent<Vessel>();

			Print("VesselSettings for " + vessel.vesselName + " started.");

			_expanded = new List<IScienceDataContainer>();
			_selectedContainer = null;
			_selectedData = null;

			UpdateContainerLists();
			GameEvents.onVesselWasModified.Add(OnVesselWasModified);
		}
开发者ID:SirDargon,项目名称:ScienceHardDrives,代码行数:12,代码来源:VesselSettings.cs

示例6: DumpData

 public void DumpData(ScienceData science_data)
 {
     if (science_data == this.science_data)
     {
         this.science_data = null;
         merdp = null;
         result_string = null;
         result_title = null;
         transmit_value = 0;
         recovery_value = 0;
         Deployed = false;
     }
 }
开发者ID:Kerbas-ad-astra,项目名称:KSPInterstellar,代码行数:13,代码来源:ModuleModableScienceGenerator.cs

示例7: onSendDataToLab

 public void onSendDataToLab(ScienceData data)
 {
     List<ModuleScienceLab> labList = vessel.FindPartModulesImplementing<ModuleScienceLab>();
     if(labList.Count > 0) {
         ModuleScienceLab lab = labList.OrderBy(l => ScienceUtil.GetLabScore(l)).First(l => l.IsOperational());
         if(lab != null) {
             lab.StartCoroutine(lab.ProcessData(data, new Callback<ScienceData>(onLabComplete)));
         }
         else {
             ScreenMessages.PostScreenMessage("<color=#ff9900ff>No opperational science lab on this vessel.</color>", 4f, ScreenMessageStyle.UPPER_CENTER);
         }
     }
     else {
         ScreenMessages.PostScreenMessage("<color=#ff9900ff>No science lab on this vessel.</color>", 4f, ScreenMessageStyle.UPPER_CENTER);
     }
 }
开发者ID:DMagic1,项目名称:ScienceContainers,代码行数:16,代码来源:ProbeScienceContainer.cs

示例8: CreateData

        public static ScienceData CreateData(Part part, float amount)
        {
            ScienceExperiment experiment = ResearchAndDevelopment.GetExperiment(kBiomeAnalysisID);
            ScienceSubject subject = ResearchAndDevelopment.GetExperimentSubject(experiment, ScienceUtil.GetExperimentSituation(part.vessel),
                part.vessel.mainBody, Utils.GetCurrentBiome(part.vessel).name);

            //Kerbin low orbit has a science multiplier of 1.
            ScienceSubject subjectLEO = ResearchAndDevelopment.GetExperimentSubject(experiment, ExperimentSituations.InSpaceLow,
                FlightGlobals.GetHomeBody(), "");

            //This ensures you can re-run the experiment.
            subjectLEO.science = 0f;
            subjectLEO.scientificValue = 1f;

            //Create science data
            ScienceData data = new ScienceData(amount, 1f, 0f, subjectLEO.id, subject.title);

            return data;
        }
开发者ID:PalverZ,项目名称:Pathfinder,代码行数:19,代码来源:WBIBiomeAnalysis.cs

示例9: getAvailableScience

        public ScienceData getAvailableScience(Vessel v, SCANdata.SCANtype sensor, bool notZero)
        {
            SCANdata data = getData(v.mainBody);
            ScienceData sd = null;
            ScienceExperiment se = null;
            ScienceSubject su = null;
            bool found = false;
            string id = null;
            double coverage = 0f;

            if(v.mainBody.pqsController != null) {
                if(!found && (sensor & SCANdata.SCANtype.AltimetryLoRes) != SCANdata.SCANtype.Nothing) {
                    found = true;
                    id = "SCANsatAltimetryLoRes";
                    coverage = data.getCoveragePercentage(SCANdata.SCANtype.AltimetryLoRes);
                }
                if(!found && (sensor & SCANdata.SCANtype.AltimetryHiRes) != SCANdata.SCANtype.Nothing) {
                    found = true;
                    id = "SCANsatAltimetryHiRes";
                    coverage = data.getCoveragePercentage(SCANdata.SCANtype.AltimetryHiRes);
                }
            }
            if(v.mainBody.BiomeMap != null) {
                if(!found && (sensor & SCANdata.SCANtype.Biome) != SCANdata.SCANtype.Nothing) {
                    found = true;
                    id = "SCANsatBiomeAnomaly";
                    coverage = data.getCoveragePercentage(SCANdata.SCANtype.Biome | SCANdata.SCANtype.Anomaly);
                }
            }

            if(!found) return null;

            se = ResearchAndDevelopment.GetExperiment(id);
            if(se == null) return null;

            su = ResearchAndDevelopment.GetExperimentSubject(se, ExperimentSituations.InSpaceHigh, v.mainBody, "surface");
            if(su == null) return null;

            print("[SCANsat] coverage " + coverage.ToString("F1") + ", science cap " + su.scienceCap.ToString("F1") + ", subject value " + su.subjectValue.ToString("F2") + ", science value " + su.scientificValue.ToString("F2") + ", science " + su.science.ToString("F2"));
            su.scientificValue = 1;

            float science = (float)coverage;
            if(science > 95) science = 100;
            if(science < 30) science = 0;
            science = science / 100f;
            science = Mathf.Max(0, (science * su.scienceCap) - su.science);

            print("[SCANsat] remaining science: " + science.ToString("F1") + ", base = " + (se.baseValue).ToString("F1"));

            science /= Mathf.Max(0.1f, su.scientificValue);
            science /= su.subjectValue;

            print("[SCANsat] result = " + science.ToString("F2"));

            if(notZero && science <= 0) science = 0.00001f;

            sd = new ScienceData(science, 1f, 0f, id, se.experimentTitle + " of " + v.mainBody.theName);
            sd.subjectID = su.id;
            return sd;
        }
开发者ID:BenChung,项目名称:SCAN,代码行数:60,代码来源:SCANcontroller.cs

示例10: DumpInitialData

 private void DumpInitialData(ScienceData data)
 {
     if (scienceReports.Contains(data))
     {
         experimentsReturned++;
         Inoperable = !IsRerunnable();
         Deployed = Inoperable;
         scienceReports.Remove(data);
     }
 }
开发者ID:romarro,项目名称:Orbital-Science,代码行数:10,代码来源:DMModuleScienceAnimate.cs

示例11: onComplete

 protected virtual void onComplete(ScienceData data)
 {
     ReviewData();
 }
开发者ID:romarro,项目名称:Orbital-Science,代码行数:4,代码来源:DMModuleScienceAnimate.cs

示例12: ReturnData

        public new void ReturnData(ScienceData data)
        {
            if (data == null)
                return;

            storedScienceReports.Add(data);

            experimentsReturned--;

            if (experimentsReturned < 0)
                experimentsReturned = 0;

            Inoperable = false;

            if (experimentLimit <= 1)
                Deployed = true;
            else
            {
                if (experimentNumber >= experimentLimit - 1)
                    Deployed = true;
            }
        }
开发者ID:romarro,项目名称:Orbital-Science,代码行数:22,代码来源:DMModuleScienceAnimate.cs

示例13: ReviewData

 void IScienceDataContainer.ReviewDataItem(ScienceData data)
 {
     ReviewData();
 }
开发者ID:romarro,项目名称:Orbital-Science,代码行数:4,代码来源:DMModuleScienceAnimate.cs

示例14: generateScienceData

        protected override bool generateScienceData()
        {
            ScienceExperiment experiment = ResearchAndDevelopment.GetExperiment(experimentID);
            if (experiment == null) return false;

            if (science_to_add > 0)
            {
                result_title = experiment.experimentTitle;
                result_string = "Science experiments were conducted in the vicinity of " + vessel.mainBody.name + ".";

                transmit_value = science_to_add;
                recovery_value = science_to_add;
                data_size = science_to_add * 1.25f;
                xmit_scalar = 1;
                
                ScienceSubject subject = ResearchAndDevelopment.GetExperimentSubject(experiment, ScienceUtil.GetExperimentSituation(vessel), vessel.mainBody, "");
                subject.scienceCap = 167 * PluginHelper.getScienceMultiplier(vessel.mainBody.flightGlobalsIndex, false);
                ref_value = subject.scienceCap;

                science_data = new ScienceData(science_to_add, 1, 0, subject.id, "Science Lab Data");

                return true;
            }
            return false;
        }
开发者ID:Ninja5tyl3,项目名称:KSPInterstellar,代码行数:25,代码来源:ScienceModule.cs

示例15: TransmitToKSC

        public bool TransmitToKSC(ScienceData data)
        {
            List<ModuleDataTransmitter> transmitters = this.part.vessel.FindPartModulesImplementing<ModuleDataTransmitter>();
            List<ScienceData> dataQueue = new List<ScienceData>();
            ModuleDataTransmitter bestTransmitter = null;

            //Package up the data and put it in the queue.
            TransmitItem item = new TransmitItem();
            item.science = data.dataAmount;
            item.reputation = 0f;
            item.funds = 0f;
            item.title = data.title;
            transmitList.Add(item);

            //Find an available transmitter. if found, transmit the data.
            dataQueue.Add(data);
            foreach (ModuleDataTransmitter transmitter in transmitters)
            {
                if (transmitter.IsBusy() == false)
                {
                    if (bestTransmitter == null)
                        bestTransmitter = transmitter;
                    else if (transmitter.packetSize > bestTransmitter.packetSize)
                        bestTransmitter = transmitter;
                }
            }

            if (bestTransmitter != null)
            {
                bestTransmitter.TransmitData(dataQueue, OnTransmitComplete);
                return true;
            }
            else
            {
                //Inform user that there is no available transmitter.
                ScreenMessages.PostScreenMessage(kNoAvailableTransmitter, 5.0f, ScreenMessageStyle.UPPER_CENTER);
                return false;
            }
        }
开发者ID:Bear67,项目名称:WildBlueTools,代码行数:39,代码来源:TransmitHelper.cs


注:本文中的ScienceData类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。