protected override void OnLoadFromConfig(ConfigNode node)
        {
            base.OnLoadFromConfig(node);

            rewardFunds = ConfigNodeUtil.ParseValue<double>(node, "rewardFunds");
            explorationType = ConfigNodeUtil.ParseValue<ExplorationType>(node, "explorationType");
        }
        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];
        }
 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
        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);
     }
 }