Beispiel #1
0
 public void pickHeroHead(PlayerHead ph)
 {
     if ((((ph.MyHero.handle != null) && (Singleton <GamePlayerCenter> .instance.GetHostPlayer() != null)) && (Singleton <GamePlayerCenter> .instance.GetHostPlayer().Captain.handle != null)) && (ph.MyHero != Singleton <GamePlayerCenter> .instance.GetHostPlayer().Captain))
     {
         for (int i = 0; i < this.heroHeads.Length; i++)
         {
             PlayerHead head = this.heroHeads[i];
             if ((null == head) || (head.MyHero == 0))
             {
                 break;
             }
             head.SetPicked(ph == head);
         }
         FrameCommand <SwitchCaptainCommand> command = FrameCommandFactory.CreateFrameCommand <SwitchCaptainCommand>();
         command.cmdData.ObjectID = ph.MyHero.handle.ObjID;
         command.Send();
     }
 }
        public void pickHeroHead(PlayerHead ph)
        {
            if (ph.MyHero.handle == null || Singleton <GamePlayerCenter> .instance.GetHostPlayer() == null || Singleton <GamePlayerCenter> .instance.GetHostPlayer().Captain.handle == null)
            {
                return;
            }
            if (ph.MyHero == Singleton <GamePlayerCenter> .instance.GetHostPlayer().Captain)
            {
                return;
            }
            for (int i = 0; i < this.heroHeads.Length; i++)
            {
                PlayerHead playerHead = this.heroHeads[i];
                if (null == playerHead || !playerHead.MyHero)
                {
                    break;
                }
                playerHead.SetPicked(ph == playerHead);
            }
            FrameCommand <SwitchCaptainCommand> frameCommand = FrameCommandFactory.CreateFrameCommand <SwitchCaptainCommand>();

            frameCommand.cmdData.ObjectID = ph.MyHero.handle.ObjID;
            frameCommand.Send();
        }