示例#1
0
        public void ParseWolfRecipe()
        {
            var inputIngredients = WOLF_AbstractPartModule.ParseRecipeIngredientList(InputResources);
            if (inputIngredients == null)
            {
                return;
            }

            WolfRecipe = new Recipe(inputIngredients, new Dictionary<string, int>());
        }
示例#2
0
        public override string GetInfo()
        {
            StringBuilder output = new StringBuilder();

            output
            .AppendLine(ConverterName)
            .AppendLine();

            if (!string.IsNullOrEmpty(InputResources))
            {
                var resources = WOLF_AbstractPartModule.ParseRecipeIngredientList(InputResources);

                output.AppendLine("<color=#99FF00>Inputs:</color>");
                foreach (var resource in resources)
                {
                    output
                    .Append(" - WOLF ")
                    .Append(resource.Key)
                    .Append(": ")
                    .AppendLine(resource.Value.ToString());
                }
            }
            if (outputList.Count > 0)
            {
                output.AppendLine("<color=#99FF00>Outputs:</color>");
                foreach (var resource in outputList)
                {
                    output
                    .Append(" - ")
                    .Append(resource.ResourceName)
                    .Append(": ");

                    if (resource.ResourceName == "ElectricCharge")
                    {
                        output
                        .AppendFormat("{0:F2}/sec", resource.Ratio)
                        .AppendLine();
                    }
                    else
                    {
                        output
                        .AppendFormat("{0:F2}/day", resource.Ratio * KSPUtil.dateTimeFormatter.Day)
                        .AppendLine();
                    }
                }
            }

            return(output.ToString());
        }
示例#3
0
        public override string GetInfo()
        {
            var info = new StringBuilder();

            info
            .AppendLine(RecipeDisplayName)
            .AppendLine();

            if (!string.IsNullOrEmpty(InputResources))
            {
                var inputs = WOLF_AbstractPartModule.ParseRecipeIngredientList(InputResources);
                info.AppendFormat("<color=#99FF00>{0}:</color>", NEEDS_TEXT);
                info.AppendLine();
                foreach (var resource in inputs)
                {
                    info
                    .Append(" - ")
                    .Append(resource.Key)
                    .Append(": ")
                    .AppendFormat("{0:D}", resource.Value)
                    .AppendLine();
                }
            }
            if (!string.IsNullOrEmpty(OutputResources))
            {
                var outputs = WOLF_AbstractPartModule.ParseRecipeIngredientList(OutputResources);
                info.AppendFormat("<color=#99FF00>{0}:</color>", PROVIDES_TEXT);
                info.AppendLine();
                foreach (var resource in outputs)
                {
                    info
                    .Append(" - ")
                    .Append(resource.Key)
                    .Append(": ")
                    .AppendFormat("{0:D}", resource.Value)
                    .AppendLine();
                }
            }

            return(info.ToString());
        }