当前位置: 首页>>代码示例>>C#>>正文


C# Player.GetName方法代码示例

本文整理汇总了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;
        }
开发者ID:adharmad,项目名称:prisoners-dilemma,代码行数:10,代码来源:ContararyStartingBad.cs

示例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;
        }
开发者ID:adharmad,项目名称:prisoners-dilemma,代码行数:10,代码来源:ContararyStartingGood.cs

示例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;
        }
开发者ID:adharmad,项目名称:prisoners-dilemma,代码行数:11,代码来源:TitForTat.cs

示例4: GetOpponent

 public Player GetOpponent(Player player)
 {
     if (player.GetName().Equals(first.GetName())) {
         return second;
     } else {
         return first;
     }
 }
开发者ID:adharmad,项目名称:prisoners-dilemma,代码行数:8,代码来源:Match.cs

示例5: Play

        public PlayResult Play(Player opponent)
        {
            if (playersWhoDefected.Contains(opponent.GetName())) {
                return PlayResult.Defect;
            }

            // else cooperate
            return PlayResult.Cooperate;
        }
开发者ID:adharmad,项目名称:prisoners-dilemma,代码行数:9,代码来源:Vindictive.cs

示例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!"); }
            }
        }
开发者ID:TaFinalDestination,项目名称:ForgeCraft,代码行数:22,代码来源:CmdPoison.cs

示例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!");
 }
开发者ID:MinedroidFTW,项目名称:ForgeCraft,代码行数:21,代码来源:CmdHeal.cs

示例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())
     };
 }
开发者ID:vlthr,项目名称:hearthomaton,代码行数:19,代码来源:State.cs

示例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");
     }
 }
开发者ID:Duelist,项目名称:Project-Reach,代码行数:9,代码来源:EnemyManager.cs


注:本文中的Player.GetName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。