当前位置: 首页>>代码示例>>C#>>正文


C# Speed.GetName方法代码示例

本文整理汇总了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();
 }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:38,代码来源:Helm.cs


注:本文中的Speed.GetName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。