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


C# IActor.Die方法代码示例

本文整理汇总了C#中IActor.Die方法的典型用法代码示例。如果您正苦于以下问题:C# IActor.Die方法的具体用法?C# IActor.Die怎么用?C# IActor.Die使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IActor的用法示例。


在下文中一共展示了IActor.Die方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MoveToNeighbor

 //the actor dies if he tries to enter and there is no bridge if there is a bridge then he can ennter the location without diengh
 public override bool MoveToNeighbor(IActor actor, Directions direction)
 {
     if (!_Bridge.IsActive)
     {
         actor.Die();
         return false;
     }
     return Location.MoveToNeighbor(actor, direction);
 }
开发者ID:akrem1st,项目名称:Assignment2d,代码行数:10,代码来源:WaterLocation.cs

示例2: EnterLocation

 //the method calls die method when a player enter this location returns falls as the move has no effect
 public override bool EnterLocation(IActor actor)
 {
     actor.Die();
     Console.WriteLine("You entered Booby Trap and you Died.");
     return false;
 }
开发者ID:akrem1st,项目名称:Assignment2c-git,代码行数:7,代码来源:BoobyTrapLocation.cs

示例3: KillActor

 /// <summary>
 /// If the player has a weapon and he is in the same location as an actor, he can kill the actor.
 /// </summary>
 /// <param name="actor"></param>
 public override void KillActor(IActor actor)
 {
     if(HasItem(new Weapon().Name) && CurrentLocation == actor.CurrentLocation)
         actor.Die();
 }
开发者ID:akrem1st,项目名称:Assignment2d,代码行数:9,代码来源:Player.cs

示例4: Kill

 /// <summary>
 /// kills an actor received as a param
 /// </summary>
 /// <param name="actor"></param>
 public void Kill(IActor actor)
 {
     actor.Die();
 }
开发者ID:akrem1st,项目名称:Assignment2d,代码行数:8,代码来源:Player.cs

示例5: KillActor

 public override void KillActor(IActor actor)
 {
     actor.Die();
 }
开发者ID:akrem1st,项目名称:Assignment2d,代码行数:4,代码来源:Monster.cs

示例6: EnterLocation

 //the method calls die method when a player enter this location. Returns false as the move has no effect
 public override bool EnterLocation(IActor actor)
 {
     actor.Die();//call the die method if player enters into it
     Console.WriteLine("You entered Booby Trap and you Died.");
     return false;
 }
开发者ID:akrem1st,项目名称:Assignment2d,代码行数:7,代码来源:BoobyTrapLocation.cs


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