本文整理汇总了C#中Speed.GetName方法的典型用法代码示例。如果您正苦于以下问题:C# Speed.GetName方法的具体用法?C# Speed.GetName怎么用?C# Speed.GetName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Speed
的用法示例。
在下文中一共展示了Speed.GetName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PlotCourse
/// <summary>
/// Plots the course to the target and notifies the requester of the outcome via the onCoursePlotSuccess or Failure events.
/// </summary>
/// <param name="target">The target.</param>
/// <param name="speed">The speed.</param>
/// <param name="standoffDistance">The distance to standoff from the target. When appropriate, this is added to the radius of the target to
/// determine how close the ship is allowed to approach.</param>
/// <param name="isFleetMove">if set to <c>true</c> the ship will only move when the fleet is ready.</param>
public void PlotCourse(IDestinationTarget target, Speed speed, float standoffDistance, bool isFleetMove) {
D.Assert(speed != default(Speed) && speed != Speed.AllStop, "{0} speed of {1} is illegal.".Inject(_ship.FullName, speed.GetName()));
bool targetIsUnreachable = false;
if (targetIsUnreachable) {
//TODO are there any circumstances where the target is known to be unreachable when 'plotting the course'?
OnCoursePlotFailure();
return;
}
if (target is IFormationStation) {
PlotCourse(target as IFormationStation, speed);
}
else if (target is StationaryLocation) {
PlotCourse(target as StationaryLocation, speed, isFleetMove);
}
else if (target is ICommandTarget) {
PlotCourse(target as ICommandTarget, speed, standoffDistance);
}
else if (target is IElementTarget) {
PlotCourse(target as IElementTarget, speed, standoffDistance);
}
else if (target is IMortalTarget) {
D.Assert(target is IPlanetoidModel);
PlotCourse(target as IMortalTarget, speed, standoffDistance, isFleetMove);
}
else {
D.Error("{0} of Type {1} not anticipated.", target.FullName, target.GetType().Name);
return;
}
OnCoursePlotSuccess();
}