コード例 #1
0
        protected override void OnLoadFromConfig(ConfigNode node)
        {
            base.OnLoadFromConfig(node);

            rewardFunds = ConfigNodeUtil.ParseValue<double>(node, "rewardFunds");
            explorationType = ConfigNodeUtil.ParseValue<ExplorationType>(node, "explorationType");
        }
コード例 #2
0
        protected override void OnLoadFromConfig(ConfigNode node)
        {
            base.OnLoadFromConfig(node);

            rewardFunds     = ConfigNodeUtil.ParseValue <double>(node, "rewardFunds");
            explorationType = ConfigNodeUtil.ParseValue <ExplorationType>(node, "explorationType");
        }
コード例 #3
0
        public ExplorationData GetRandomData(ExplorationType type)
        {
            if (type == ExplorationType.Common)
			{
				return GetRandomData();
			}
			List<ExplorationData> dataList = typeDic[type];
			int index = RandomUtils.Range(0, dataList.Count);
			return dataList[index];
        }
コード例 #4
0
 static string ExplorationTypeNamePlural(ExplorationType type)
 {
     switch (type)
     {
         case ExplorationType.Biome:
             return "biomes";
         case ExplorationType.CelestialBody:
             return "celestial bodies";
     }
     return "";
 }
コード例 #5
0
 static string ExplorationTypeNamePlural(ExplorationType type)
 {
     switch (type)
     {
         case ExplorationType.Biome:
             return "biomes";
         case ExplorationType.CelestialBody:
             return "celestial bodies";
     }
     return "";
 }
コード例 #6
0
        private void applyBonusAndPenalties(BonusAndPenalties bonusOrPenalty, ExplorationType explorationType, int access)
        {
            double bonusOrPenaltyValue = 0;

            if (bonusOrPenalty == BonusAndPenalties.ALFA)
            {
                bonusOrPenaltyValue = this.Alfa;
            }
            else if (bonusOrPenalty == BonusAndPenalties.BETA)
            {
                bonusOrPenaltyValue = this.Beta;
            }
            else if (bonusOrPenalty == BonusAndPenalties.RHO)
            {
                bonusOrPenaltyValue = this.Rho;
            }
            else if (bonusOrPenalty == BonusAndPenalties.SIGMA)
            {
                bonusOrPenaltyValue = this.Sigma;
            }

            KeyValuePair <int, int> indices = Spectrum.GetIndexesFromAccess(access, this.frequencySegments);
            double modifiedValue            = this.EstimationMatrix[indices.Key, indices.Value] * bonusOrPenaltyValue;
            double specificMaximum;

            if (explorationType == ExplorationType.ACCESS)
            {
                specificMaximum = this.MaximumValue;
            }
            else
            {
                specificMaximum = this.NonAccessMaximumValue;
            }

            if (modifiedValue < specificMaximum && modifiedValue > this.MinimumValue)
            {
                this.EstimationMatrix[indices.Key, indices.Value] = modifiedValue;
            }
            else if (modifiedValue < this.MinimumValue)
            {
                this.EstimationMatrix[indices.Key, indices.Value] = this.MinimumValue;
            }
            if (modifiedValue > specificMaximum)
            {
                this.EstimationMatrix[indices.Key, indices.Value] = specificMaximum;
            }
        }
コード例 #7
0
ファイル: VehicleNccma.cs プロジェクト: AkashBaidya/SIMITS
        private void applyBonusAndPenalties(BonusAndPenalties bonusOrPenalty, ExplorationType explorationType, int access)
        {
            double bonusOrPenaltyValue = 0;
            if (bonusOrPenalty == BonusAndPenalties.ALFA)
            {
                bonusOrPenaltyValue = this.Alfa;
            }
            else if (bonusOrPenalty == BonusAndPenalties.BETA)
            {
                bonusOrPenaltyValue = this.Beta;
            }
            else if (bonusOrPenalty == BonusAndPenalties.RHO)
            {
                bonusOrPenaltyValue = this.Rho;
            }
            else if (bonusOrPenalty == BonusAndPenalties.SIGMA)
            {
                bonusOrPenaltyValue = this.Sigma;
            }

            KeyValuePair<int, int> indices = Spectrum.GetIndexesFromAccess(access, this.frequencySegments);
            double modifiedValue = this.EstimationMatrix[indices.Key, indices.Value] * bonusOrPenaltyValue;
            double specificMaximum;
            if (explorationType == ExplorationType.ACCESS)
            {
                specificMaximum = this.MaximumValue;
            }
            else
            {
                specificMaximum = this.NonAccessMaximumValue;
            }

            if (modifiedValue < specificMaximum && modifiedValue > this.MinimumValue)
            {
                this.EstimationMatrix[indices.Key, indices.Value] = modifiedValue;
            }
            else if (modifiedValue < this.MinimumValue)
            {
                this.EstimationMatrix[indices.Key, indices.Value] = this.MinimumValue;
            }
            if (modifiedValue > specificMaximum)
            {
                this.EstimationMatrix[indices.Key, indices.Value] = specificMaximum;
            }

        }
コード例 #8
0
 public static Exploration Create(ExplorationType type, List<object> paramList = null)
 {
     ExplorationData data = ExplorationDataManager.Instance.GetRandomData(type);
     Exploration expl = DoCreate(data, paramList);
     return expl;
 }
コード例 #9
0
 private void CreateExploration(ExplorationType type, PositionScript birth, List<object> paramList = null)
 {
     if (birth != null)
     {
         Exploration expl = ExplorationFactory.Create(type, paramList);
         expl.SetPosition(birth.transform.position);
         expl.SetRotation(birth.transform.eulerAngles.y);
         explorationProxy.AddInBlock(expl);
     }
 }