本文整理汇总了C#中Party.getMember方法的典型用法代码示例。如果您正苦于以下问题:C# Party.getMember方法的具体用法?C# Party.getMember怎么用?C# Party.getMember使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Party
的用法示例。
在下文中一共展示了Party.getMember方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: playerCommandSelect
/// <summary>
/// The player is prompted to select an enemy party member to attack for their current member's turn.
/// </summary>
/// <param name="member">Player's current attacking member.</param>
/// <param name="receiver">Enemy Party</param>
/// <returns>The chosen target's name.</returns>
/// <remarks>If the chosen target is dead or does not exist, an appropriate message is displayed.</remarks>
/// <remarks>If the user's presses enter with no input, a randomly select target's name is returned.</remarks>
private static string playerCommandSelect(IEngageable member, Party receiver)
{
string target;
Console.WriteLine();
Console.WriteLine("Please select a target for " + member);
target = Console.ReadLine();
if (target.Equals("") || target.Equals(null) || target.Trim().Equals(""))
{
if (member.getTarget() != null)
{
target = member.getTarget().getName();
}
else
{
target = receiver.getMember().getName();
}
}
if (receiver.getMember(target) == null)
{
Console.WriteLine(target);
Text.color("\n" + target + " is not a valid target.", ConsoleColor.Red);
}
else if (receiver.getMember(target).isDead())
{
if(!(member is Cleric))
{
Text.color("\n" + target + " is already dead. You're a horrible person!", ConsoleColor.Red);
}
else
{
Text.color("\nYou cannot resurrect " + target + ". I'm sorry.", ConsoleColor.Red);
}
}
return target;
}