本文整理汇总了C#中City.getName方法的典型用法代码示例。如果您正苦于以下问题:C# City.getName方法的具体用法?C# City.getName怎么用?C# City.getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类City
的用法示例。
在下文中一共展示了City.getName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PrintAddedCity
/// <summary>
/// Print information about the new city that was found
/// </summary>
/// <param name="city"></param>
/// <param name="cityInfo"></param>
public void PrintAddedCity(City city, CityInfo cityInfo)
{
PrintBreak();
textBox.Dispatcher.Invoke(
new Action(delegate()
{
textBox.Text += string.Format("Add new city: {0}\n",
city.getName());
textBox.Text += string.Format("Distance from start: {0:0.##}\n",
cityInfo.FromStart);
textBox.Text += string.Format("Estimated path length: {0:0.##}\n",
cityInfo.PathDistance);
}),
DispatcherPriority.Normal, null);
}
示例2: PrintBestCity
/// <summary>
/// Print information about the best city to explore next
/// </summary>
/// <param name="city"></param>
/// <param name="cityInfo"></param>
public void PrintBestCity(City city, CityInfo cityInfo)
{
PrintLineBreak();
textBox.Dispatcher.Invoke(
new Action(delegate()
{
textBox.Text += string.Format("Next city to explore: {0}\n",
city.getName());
textBox.Text += string.Format("Estimated path distance: {0:0.##}\n",
cityInfo.PathDistance);
}),
DispatcherPriority.Normal, null);
}
示例3: PrintStartAlg
/// <summary>
/// Print start message
/// </summary>
/// <param name="startCity"></param>
/// <param name="finalCity"></param>
/// <param name="heuristic"></param>
public void PrintStartAlg(City startCity, City finalCity,
Heuristic heuristic)
{
textBox.Dispatcher.Invoke(
new Action(delegate()
{
textBox.Text += "--== Starting A-star algorithm ==--\n";
PrintBreak();
if (heuristic == Heuristic.Distance)
{
textBox.Text += string.Format("Used heuristic: Minimum Distance\n");
}
else if (heuristic == Heuristic.Hops)
{
textBox.Text += string.Format("Used heuristic: Minimum Hops\n");
}
textBox.Text += string.Format("Start city: {0}\n",
startCity.getName());
textBox.Text += string.Format("Final city: {0}\n",
finalCity.getName());
}),
DispatcherPriority.Normal, null);
}
示例4: PrintUpdatedCity
/// <summary>
/// Print information about the city that was updated
/// </summary>
/// <param name="city"></param>
/// <param name="newCityInfo"></param>
/// <param name="oldCityInfo"></param>
public void PrintUpdatedCity(City city, CityInfo newCityInfo,
CityInfo oldCityInfo)
{
PrintBreak();
textBox.Dispatcher.Invoke(
new Action(delegate()
{
textBox.Text += string.Format("Update city (shorter path): {0}\n",
city.getName());
textBox.Text += string.Format("Old distance from start: {0:0.##}\n",
oldCityInfo.FromStart);
textBox.Text += string.Format("New distance from start: {0:0.##}\n",
newCityInfo.FromStart);
textBox.Text += string.Format("Estimated path length: {0:0.##}\n",
newCityInfo.PathDistance);
}),
DispatcherPriority.Normal, null);
}
示例5: PrintRejectedCity
/// <summary>
/// Print information about the city that was rejected
/// </summary>
/// <param name="city"></param>
/// <param name="newCityInfo"></param>
/// <param name="oldCityInfo"></param>
public void PrintRejectedCity(City city, CityInfo newCityInfo,
CityInfo oldCityInfo)
{
PrintBreak();
textBox.Dispatcher.Invoke(
new Action(delegate()
{
textBox.Text += string.Format("Reject city (already visited): {0}\n",
city.getName());
textBox.Text += string.Format("Old distance from start: {0:0.##}\n",
oldCityInfo.FromStart);
textBox.Text += string.Format("New distance from start: {0:0.##}\n",
newCityInfo.FromStart);
}),
DispatcherPriority.Normal, null);
}