本文整理汇总了C#中Combatant.AddPawnToView方法的典型用法代码示例。如果您正苦于以下问题:C# Combatant.AddPawnToView方法的具体用法?C# Combatant.AddPawnToView怎么用?C# Combatant.AddPawnToView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Combatant
的用法示例。
在下文中一共展示了Combatant.AddPawnToView方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApproachMeleeRange
public void ApproachMeleeRange()
{
Board board = new Board( new int[,] {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0 },
{ 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0 },
{ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 },
{ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 },
{ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 },
{ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 },
{ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
});
Combatant attacker = new Combatant("Attacker", board, new Point(1, 7));
Combatant defender = new Combatant("Defender", board, new Point(10, 1));
board.AddPawn(attacker);
board.AddPawn(defender);
attacker.Health = 10;
defender.Health = 10;
attacker.BaseStats = new Stats() {
Attack = 10,
Stamina = 25
};
attacker.AddPawnToView(defender);
MeleeAttackSkill attack = new MeleeAttackSkill(attacker, new Point[] { Point.Right, 2 * Point.Right }) {
ActionPoints = 3
};
attacker.AddSkill(attack);
WalkSkill walk = new WalkSkill(attacker);
attacker.AddSkill(walk);
LostGen.Decision.ApproachMeleeRange approach = new LostGen.Decision.ApproachMeleeRange(attacker);
approach.Target = defender;
approach.Setup();
approach.Run();
board.BeginTurn();
Assert.AreEqual(25, attacker.ActionPoints);
board.Turn();
Assert.AreEqual(new Point(10, 3), attacker.Position);
}