本文整理汇总了C#中Location.modify_cost方法的典型用法代码示例。如果您正苦于以下问题:C# Location.modify_cost方法的具体用法?C# Location.modify_cost怎么用?C# Location.modify_cost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Location
的用法示例。
在下文中一共展示了Location.modify_cost方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: get_info
public string get_info (Location location)
{
long[] raw_cost = this.cost;
location.modify_cost (raw_cost);
string cost = this.describe_cost (raw_cost, false);
long[] raw_maintenance = new long[3];
this.maintenance.CopyTo(raw_maintenance,0);
location.modify_maintenance (raw_maintenance);
string maint = this.describe_cost (raw_maintenance, true);
string detect = this.get_detect_info (location);
string size = "";
if (this.size > 1)
size = string.Format ("\nHas space for {0} computers.", this.size);
string location_message = "";
if (location.modifiers.ContainsKey ("cpu"))
{
string modifier = "";
if (location.modifiers["cpu"] > 1)
modifier = G.strings["cpu_bonus"];
else
modifier = G.strings["cpu_penalty"];
location_message = string.Format ("\n\n" + G.strings["location_modifiers"], modifier);
}
return string.Format ("{0}\nBuild cost:{1}\nMaintenance:{2}\n{3} {4}\n---\n{5}{6}", this.name, cost, maint, detect, size, this.description, location_message);
}