本文整理汇总了C#中Output.Write方法的典型用法代码示例。如果您正苦于以下问题:C# Output.Write方法的具体用法?C# Output.Write怎么用?C# Output.Write使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Output
的用法示例。
在下文中一共展示了Output.Write方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Player
public Player(List<Player> players, OutputType outputType)
{
writer = new Output(outputType);
writer.Write("Enter the name of the player: ");
this.name = Console.ReadLine().Trim();
writer.Write("Enter the piece you want to use: ");
this.piece = new Piece(Console.ReadLine().Trim());
while (players.Select(p => p).Where(x => string.Compare(x.Piece.Symbol, this.piece.Symbol) == 0).Count() >= 1)
{
writer.Write("That piece has already been taken.\nChoose a different piece: ");
this.piece = new Piece(Console.ReadLine().Trim());
}
writer.Write("Is this player HUMAN or AI: ");
do
{
var playerType = Console.ReadLine().Trim();
PlayerType humanOrNot;
if (Enum.TryParse<PlayerType>(playerType.ToUpper(), out humanOrNot))
{
this.playerType = humanOrNot;
break;
}
writer.Write("Enter a valid Player Type: [human] or [AI]: ");
continue;
} while (true);
this.order = -1;
}