本文整理汇总了C#中Operator.DirtMetalCreditCalculator方法的典型用法代码示例。如果您正苦于以下问题:C# Operator.DirtMetalCreditCalculator方法的具体用法?C# Operator.DirtMetalCreditCalculator怎么用?C# Operator.DirtMetalCreditCalculator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Operator
的用法示例。
在下文中一共展示了Operator.DirtMetalCreditCalculator方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MerchantMain
public static void MerchantMain()
{
Console.WriteLine("Welcome to Merchant's Guide to Galaxy.Please enter your query with each word sepated by a space.");
string inputQuery = Console.ReadLine();
try
{
var operatorObj = new Operator();
var initializeEngine = new InitializeEngine();
if (inputQuery != null)
{
var splitInputQuery = inputQuery.ToUpper().Split(' ');
var onlyDirtToken = new List<string>();
var onlyMetalToken = new List<string>();
foreach (var validExpression in splitInputQuery)
{
if (initializeEngine.GetValidDirts().Contains(validExpression))
{
onlyDirtToken.Add(validExpression);
}
if (initializeEngine.GetValidMetals().Contains(validExpression))
{
onlyMetalToken.Add(validExpression);
}
}
if (onlyDirtToken.Any() || onlyMetalToken.Any())
{
var onlyDirtValue = operatorObj.GetOnlyDirtValue(onlyDirtToken.ToArray());
var onlyMetalsCredit = operatorObj.GetMetalsCredit(onlyMetalToken.ToArray());
var dirtMetalCredit = operatorObj.DirtMetalCreditCalculator(inputQuery);
if (onlyDirtValue > 0 && onlyMetalsCredit > 0 && dirtMetalCredit > 0)
{
Console.WriteLine(dirtMetalCredit.ToString(CultureInfo.InvariantCulture));
Console.ReadLine();
}
if (onlyDirtValue > 0)
{
Console.WriteLine(onlyDirtValue.ToString(CultureInfo.InvariantCulture));
Console.ReadLine();
}
if (onlyMetalsCredit > 0)
{
Console.WriteLine(onlyMetalsCredit.ToString(CultureInfo.InvariantCulture));
Console.ReadLine();
}
}
else
{
Console.WriteLine("I have no idea what you are talking about");
Console.ReadLine();
}
}
}
catch (Exception)
{
Console.WriteLine("I have no idea what you are talking about");
}
}