本文整理汇总了C#中Character.IsDead方法的典型用法代码示例。如果您正苦于以下问题:C# Character.IsDead方法的具体用法?C# Character.IsDead怎么用?C# Character.IsDead使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Character
的用法示例。
在下文中一共展示了Character.IsDead方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public void Execute(Character.NPC actor, ITrigger trigger = null)
{
if (!actor.IsDead() && !actor.InCombat) {
Rooms.Room room = Rooms.Room.GetRoom(actor.Location);
room.GetRoomExits();
List<Rooms.Exits> availableExits = room.RoomExits;
if (DateTime.Now.ToUniversalTime() > actor.NextAiAction) {//so it's time for this AI state to execute
Commands.CommandParser.ExecuteCommand(actor, availableExits[Extensions.RandomNumber.GetRandomNumber().NextNumber(0, availableExits.Count)].Direction);
actor.NextAiAction = DateTime.Now.AddSeconds(Extensions.RandomNumber.GetRandomNumber().NextNumber(60, 121)).ToUniversalTime(); //set when we want this action to execute next
if (!FSM.ContinueWithThisState()) {
actor.Fsm.ChangeState(Speak.GetState(), actor);
}
}
}
if (actor.InCombat) {
actor.Fsm.ChangeState(Combat.GetState(), actor);
}
}
示例2: IsDead_returns_true_if_hit_points_equals_0
public void IsDead_returns_true_if_hit_points_equals_0()
{
var character = new Character(hitPoints: 0);
character.IsDead().ShouldEqual(true);
}
示例3: IsDead_returns_false_if_hit_points_greater_than_0
public void IsDead_returns_false_if_hit_points_greater_than_0()
{
var character = new Character(hitPoints: 5);
character.IsDead().ShouldEqual(false);
}