本文整理汇总了C#中Player.GetName方法的典型用法代码示例。如果您正苦于以下问题:C# Player.GetName方法的具体用法?C# Player.GetName怎么用?C# Player.GetName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Player
的用法示例。
在下文中一共展示了Player.GetName方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Play
public PlayResult Play(Player opponent)
{
if (playerLastAction.ContainsKey(opponent.GetName())) {
PlayResult lastAction = (PlayResult)playerLastAction[opponent.GetName()];
return lastAction;
}
// else defect
return PlayResult.Defect;
}
示例2: Play
public PlayResult Play(Player opponent)
{
if (playerLastAction.ContainsKey(opponent.GetName())) {
PlayResult lastAction = (PlayResult)playerLastAction[opponent.GetName()];
return lastAction;
}
// else cooperate
return PlayResult.Cooperate;
}
示例3: Play
public PlayResult Play(Player opponent)
{
if (lastResult.ContainsKey(opponent.GetName())) {
PlayResult pr = (PlayResult)lastResult[opponent.GetName()];
return pr;
}
// else cooperate
return PlayResult.Cooperate;
}
示例4: GetOpponent
public Player GetOpponent(Player player)
{
if (player.GetName().Equals(first.GetName())) {
return second;
} else {
return first;
}
}
示例5: Play
public PlayResult Play(Player opponent)
{
if (playersWhoDefected.Contains(opponent.GetName())) {
return PlayResult.Defect;
}
// else cooperate
return PlayResult.Cooperate;
}
示例6: Use
public override void Use(Player p, params string[] args)
{
if (args.Length < 1 || args.Length > 1)
{
Help(p);
return;
}
Player pl = Player.FindPlayer(args[0]);
if (pl == null) { p.SendMessage("Player " + args[0] + " not found!"); return; }
if (pl.Mode == 0)
{
pl.SlowlyDie(10, 1000, 2);
if (pl != p) { Player.GlobalMessage(pl.GetName() + " got poisonned by " + p.GetName() + "! D:"); }
else { Player.GlobalMessage(p.GetName() + " poisonned him/herself! D:"); }
}
else
{
if (pl != p) { p.SendMessage(pl.GetName() + " is in " + Color.DarkGreen + "Creative" + Color.White + " mode!"); }
else { p.SendMessage("You are in " + Color.DarkGreen + "Creative" + Color.White + " mode!"); }
}
}
示例7: Use
public override void Use(Player p, params string[] args)
{
if (args.Length > 0)
{
Player who = Player.FindPlayer(args[0]);
if (who != null)
{
who.health = 20;
p.SendMessage("Healed " + who.GetName() + "!");
who.SendMessage(p.GetName() + " healed you!");
return;
}
else
{
p.SendMessage("Player " + args[0] + " not found!");
return;
}
}
p.health = 20;
p.SendMessage("You healed yourself!");
}
示例8: Extract
private static object Extract(Player p)
{
if (p == null) return null;
return new
{
name = p.GetName(),
hero = Extract(p.GetHeroCard()),
hand = Extract(p.GetHandZone()),
deckCount = p.GetDeckZone().GetCardCount(),
availableMana = p.GetNumAvailableResources(),
heroPower = Extract(p.GetHeroPowerCard()),
maxMana = p.GetTag(GAME_TAG.RESOURCES),
// numMinionsInPlay = p.GetNumMinionsInPlay(),
// rank = p.GetRank() != null ? p.GetRank().ToString() : null,
secretZone = Extract(p.GetSecretZone()),
playZone = Extract(ZoneMgr.Get().FindZoneOfType<ZonePlay>(p.GetSide())),
weapon = Extract(p.GetWeaponCard())
};
}
示例9: PlayerDamage
private void PlayerDamage(Player player, Enemy newEnemy)
{
player.DecHealth(newEnemy.GetDamage());
Debug.Log(player.GetName() + " has been hit for " + newEnemy.GetDamage() + " damage");
if (player.IsDead()){
GameStorage.gameState = GameStorage.GameState.Stopped; // Game stopped
player.GetPlayerObj().animation.Play ("Dead");
}
}