本文整理汇总了C#中Match.AddPlayer方法的典型用法代码示例。如果您正苦于以下问题:C# Match.AddPlayer方法的具体用法?C# Match.AddPlayer怎么用?C# Match.AddPlayer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Match
的用法示例。
在下文中一共展示了Match.AddPlayer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ICannotAdd2PlayersToAMatchWithTheSameName
public void ICannotAdd2PlayersToAMatchWithTheSameName()
{
var match = new Match(7, 501);
var player = new Player("Andy");
match.AddPlayer(player);
match.AddPlayer(player);
}
示例2: ICanAddAPlayerToAMatch
public void ICanAddAPlayerToAMatch()
{
var match = new Match(7, 501);
var player = new Player("Andy");
match.AddPlayer(player);
Assert.AreEqual(1, match.Players.Count);
Assert.AreEqual("Andy", match.Players.FirstOrDefault().Key.Name);
}
示例3: ICanAddALegWonToAPlayer
public void ICanAddALegWonToAPlayer()
{
var match = new Match(7, 501);
var player = new Player("Andy");
match.AddPlayer(player);
var numberOfLegsWon = match.AddLegWonToPlayer(player);
Assert.AreEqual(1, numberOfLegsWon);
}
示例4: ICanStartANewLeg
public void ICanStartANewLeg()
{
var match = new Match(7, 501);
var player = new Player("Andy");
match.AddPlayer(player);
var player2 = new Player("Arthur");
match.AddPlayer(player2);
var leg = match.StartNewLeg();
Assert.AreEqual(2, leg.Players.Count);
Assert.AreEqual(501, leg.StartScore);
}