Esempio n. 1
0
        // specifics support
        public Specifics Specs()
        {
            Specifics specs   = new Specifics();
            Process   process = Profile.processes.Find(k => k.modifiers.Contains(resource));

            if (process != null)
            {
                foreach (var pair in process.inputs)
                {
                    if (!process.modifiers.Contains(pair.Key))
                    {
                        specs.add(pair.Key, Lib.BuildString("<color=#ff0000>", Lib.HumanReadableRate(pair.Value * capacity), "</color>"));
                    }
                    else
                    {
                        specs.add("Half-life", Lib.HumanReadableDuration(0.5 / pair.Value));
                    }
                }
                foreach (var pair in process.outputs)
                {
                    specs.add(pair.Key, Lib.BuildString("<color=#00ff00>", Lib.HumanReadableRate(pair.Value * capacity), "</color>"));
                }
            }
            return(specs);
        }
Esempio n. 2
0
        // specifics support
        public Specifics Specs()
        {
            Specifics specs = new Specifics();

            if (redundancy.Length > 0)
            {
                specs.add("Redundancy", redundancy);
            }
            specs.add("Repair", new CrewSpecs(repair).info());
            specs.add(string.Empty);
            specs.add("<color=#00ffff>Standard quality</color>");
            specs.add("MTBF", Lib.HumanReadableDuration(mtbf));
            specs.add(string.Empty);
            specs.add("<color=#00ffff>High quality</color>");
            specs.add("MTBF", Lib.HumanReadableDuration(mtbf * Settings.QualityScale));
            if (extra_cost > double.Epsilon)
            {
                specs.add("Extra cost", Lib.HumanReadableCost(extra_cost * part.partInfo.cost));
            }
            if (extra_mass > double.Epsilon)
            {
                specs.add("Extra mass", Lib.HumanReadableMass(extra_mass * part.partInfo.partPrefab.mass));
            }
            return(specs);
        }
Esempio n. 3
0
		// specifics support
		public Specifics Specs()
		{
			Specifics specs = new Specifics();
			specs.add("volume", Lib.HumanReadableVolume(volume > double.Epsilon ? volume : Lib.PartVolume(part)));
			specs.add("surface", Lib.HumanReadableSurface(surface > double.Epsilon ? surface : Lib.PartSurface(part)));
			if (inflate.Length > 0) specs.add("Inflatable", "yes");
			return specs;
		}
Esempio n. 4
0
		// specifics support
		public Specifics Specs()
		{
			Specifics specs = new Specifics();
			specs.add("bonus", "firm-ground");
			specs.add("EC/s", Lib.HumanReadableRate(ec_rate));
			specs.add("deployable", deploy.Length > 0 ? "yes" : "no");
			return specs;
		}
Esempio n. 5
0
        // specifics support
        public Specifics Specs()
        {
            Specifics specs = new Specifics();

            specs.add("Researcher", new CrewSpecs(researcher).info());
            specs.add("EC rate", Lib.HumanReadableRate(ec_rate));
            specs.add("Analysis rate", Lib.HumanReadableDataRate(analysis_rate));
            return(specs);
        }
Esempio n. 6
0
        // specifics support
        public Specifics Specs()
        {
            Specifics specs = new Specifics();

            specs.add(radiation >= 0.0 ? Localizer.Format("#KERBALISM_Emitter_Emitted") : Localizer.Format("#KERBALISM_Emitter_ActiveShielding"), Lib.HumanReadableRadiation(Math.Abs(radiation)));
            if (ec_rate > double.Epsilon)
            {
                specs.add("EC/s", Lib.HumanReadableRate(ec_rate));
            }
            return(specs);
        }
Esempio n. 7
0
        // specifics support
        public Specifics Specs()
        {
            Specifics specs = new Specifics();

            specs.add(radiation >= 0.0 ? "Radiation emitted" : "Active shielding", Lib.HumanReadableRadiation(Math.Abs(radiation)));
            if (ec_rate > double.Epsilon)
            {
                specs.add("EC/s", Lib.HumanReadableRate(ec_rate));
            }
            return(specs);
        }
Esempio n. 8
0
        // specifics support
        public Specifics Specs()
        {
            var specs = new Specifics();

            specs.add("Type", type);
            return(specs);
        }
Esempio n. 9
0
        // specifics support
        public Specifics Specs()
        {
            Specifics specs = new Specifics();

            specs.add("bonus", bonus);
            return(specs);
        }
Esempio n. 10
0
        // specifics support
        public Specifics Specs()
        {
            Specifics specs = new Specifics();

            specs.add("slots", slots.ToString());
            specs.add("reconfigure", new CrewSpecs(reconfigure).info());
            specs.add(string.Empty);
            specs.add("setups:");

            // organize setups by tech required, and add the ones without tech
            Dictionary <string, List <string> > org = new Dictionary <string, List <string> >();

            foreach (ConfigureSetup setup in setups)
            {
                if (setup.tech.Length > 0)
                {
                    if (!org.ContainsKey(setup.tech))
                    {
                        org.Add(setup.tech, new List <string>());
                    }
                    org[setup.tech].Add(setup.name);
                }
                else
                {
                    specs.add(Lib.BuildString("• <b>", setup.name, "</b>"));
                }
            }

            // add setups grouped by tech
            foreach (var pair in org)
            {
                // shortcuts
                string        tech_id     = pair.Key;
                List <string> setup_names = pair.Value;

                // get tech title
                // note: non-stock technologies will return empty titles, so we use tech-id directly in that case
                string tech_title = ResearchAndDevelopment.GetTechnologyTitle(tech_id).ToLower();
                tech_title = !string.IsNullOrEmpty(tech_title) ? tech_title : tech_id;

                // add tech name
                specs.add(string.Empty);
                specs.add(Lib.BuildString("<color=#00ffff>", tech_title, ":</color>"));

                // add setup names
                foreach (string setup_name in setup_names)
                {
                    specs.add(Lib.BuildString("• <b>", setup_name, "</b>"));
                }
            }

            return(specs);
        }
Esempio n. 11
0
		// specifics support
		public Specifics Specs()
		{
			Specifics specs = new Specifics();
			specs.add("type", ((HarvestTypes)type).ToString());
			specs.add("resource", resource);
			if (min_abundance > double.Epsilon) specs.add("min abundance", Lib.HumanReadablePerc(min_abundance, "F2"));
			if (type == 2 && min_pressure > double.Epsilon) specs.add("min pressure", Lib.HumanReadablePressure(min_pressure));
			specs.add("extraction rate", Lib.HumanReadableRate(rate));
			if (ec_rate > double.Epsilon) specs.add("ec consumption", Lib.HumanReadableRate(ec_rate));
			return specs;
		}
Esempio n. 12
0
        // specifics support
        public Specifics Specs()
        {
            var specs = new Specifics();

            specs.add("Name", ResearchAndDevelopment.GetExperiment(experiment).experimentTitle);
            specs.add("Data rate", Lib.HumanReadableDataRate(data_rate));
            specs.add("EC required", Lib.HumanReadableRate(ec_rate));
            if (crew.Length > 0)
            {
                specs.add("Operator", new CrewSpecs(crew).info());
            }
            specs.add(string.Empty);
            specs.add("<color=#00ffff>Situations:</color>", string.Empty);
            var tokens = Lib.Tokenize(situations, ',');

            foreach (string s in tokens)
            {
                specs.add(Lib.BuildString("• <b>", s, "</b>"));
            }
            return(specs);
        }
Esempio n. 13
0
        // specifics support
        public Specifics Specs()
        {
            double[] ranges = new double[12];
            for (int i = 0; i < 12; ++i)
            {
                ranges[i] = dist / 13.0 * (double)(i + 1);
            }

            Specifics specs = new Specifics();

            specs.add("Type", type == AntennaType.low_gain ? "low-gain" : "high-gain");
            specs.add("Transmission cost", Lib.BuildString(cost.ToString("F2"), " EC/s"));
            specs.add("Nominal rate", Lib.HumanReadableDataRate(rate));
            specs.add("Nominal distance", Lib.HumanReadableRange(dist));
            specs.add(string.Empty);
            specs.add("<color=#00ffff><b>Transmission rates</b></color>");
            foreach (double range in ranges)
            {
                specs.add(Lib.BuildString(Lib.HumanReadableRange(range), "\t<b>", Lib.HumanReadableDataRate(calculate_rate(range * 0.99, dist, rate)), "</b>"));
            }
            return(specs);
        }
Esempio n. 14
0
        // specifics support
        public Specifics Specs()
        {
            Specifics specs = new Specifics();

            specs.add("Havest size", Lib.HumanReadableAmount(crop_size, " " + crop_resource));
            specs.add("Harvest time", Lib.HumanReadableDuration(1.0 / crop_rate));
            specs.add("Lighting tolerance", Lib.HumanReadableFlux(light_tolerance));
            if (pressure_tolerance > double.Epsilon)
            {
                specs.add("Pressure tolerance", Lib.HumanReadablePressure(Sim.PressureAtSeaLevel() * pressure_tolerance));
            }
            if (radiation_tolerance > double.Epsilon)
            {
                specs.add("Radiation tolerance", Lib.HumanReadableRadiation(radiation_tolerance));
            }
            specs.add("Lamps EC rate", Lib.HumanReadableRate(ec_rate));
            specs.add(string.Empty);
            specs.add("<color=#00ffff>Required resources</color>");
            foreach (ModuleResource input in resHandler.inputResources)
            {
                specs.add(input.name, Lib.BuildString("<color=#ff0000>", Lib.HumanReadableRate(input.rate), "</color>"));
            }
            specs.add(string.Empty);
            specs.add("<color=#00ffff>By-products</color>");
            foreach (ModuleResource output in resHandler.outputResources)
            {
                specs.add(output.name, Lib.BuildString("<color=#00ff00>", Lib.HumanReadableRate(output.rate), "</color>"));
            }
            return(specs);
        }