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


C# Playfield.getAttackTargets方法代码示例

本文整理汇总了C#中HRSim.Playfield.getAttackTargets方法的典型用法代码示例。如果您正苦于以下问题:C# Playfield.getAttackTargets方法的具体用法?C# Playfield.getAttackTargets怎么用?C# Playfield.getAttackTargets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HRSim.Playfield的用法示例。


在下文中一共展示了Playfield.getAttackTargets方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: isEnemyLowest

        private bool isEnemyLowest(Minion mnn, Playfield p)
        {

            Player mPlayer, ePlayer;

            if (p.isOwnTurn)
            {
                mPlayer = p.playerFirst;
                ePlayer = p.playerSecond;
            }
            else
            {
                mPlayer = p.playerFirst;
                ePlayer = p.playerSecond;
            }

            bool ret = true;
            List<Minion> litt = p.getAttackTargets(true, false);
            int val = getValueOfEnemyMinion(mnn);
            foreach (Minion m in ePlayer.ownMinions)
            {
                if (litt.Find(x => x.entitiyID == m.entitiyID) == null) continue;
                if (getValueOfEnemyMinion(m) < val) ret = false;
            }
            return ret;
        }
开发者ID:shuyi3,项目名称:AIPJ,代码行数:26,代码来源:PenalityManager.cs

示例2: getMoveList


//.........这里部分代码省略.........
                                //}
                                //else 
                                //{
                                //    ret.Add(a);
                                //}
                            }
                        }

                        //tempRet.Sort((x, y) => y.Item2.CompareTo(x.Item2));
                        //if (tempRet.Count > 0)
                        //{
                        //    ret.Add(tempRet[0].Item1);
                        //    if (tempRet[0].Item1.target.own == p.isOwnTurn) 
                        //    {
                        //        p.moveTrigger.hasOwnTargetMove = true;
                        //    }
                        //}
                        //if (tempRet.Count > 1)
                        //{
                        //    ret.Add(tempRet[1].Item1);
                        //    if (tempRet[1].Item1.target.own == p.isOwnTurn)
                        //    {
                        //        p.moveTrigger.hasOwnTargetMove = true;
                        //    }
                        //}
                    }
                }


            }

          //get targets for Hero weapon and Minions  ###################################################################################

            trgts = p.getAttackTargets(own, isLethalCheck);
            //if (!isLethalCheck) trgts = this.cutAttackList(trgts);

          // attack with minions
            List<Minion> attackingMinions = new List<Minion>(8);
            foreach (Minion m in mPlayer.ownMinions)
            {
                if (m.Ready && m.Angr >= 1 && !m.frozen) attackingMinions.Add(m); //* add non-attacing minions
            }
            //attackingMinions = this.cutAttackList(attackingMinions);

            foreach (Minion m in attackingMinions)
            {
                int attackPenality = 0;
                foreach (Minion trgt in trgts)
                {
                    if (usePenalityManager) attackPenality = pen.getAttackWithMininonPenality(m, p, trgt, isLethalCheck);
                    if (attackPenality <= 499)
                    {
                        Action a = new Action(actionEnum.attackWithMinion, null, m, 0, trgt, attackPenality, 0, 0);
                        ret.Add(a);
                    }
                }
            }

          // attack with hero (weapon)
            if (mPlayer.ownHero.Ready && mPlayer.ownHero.Angr >= 1)
            {
                int heroAttackPen = 0;
                foreach (Minion trgt in trgts)
                {
                    if (usePenalityManager) heroAttackPen = pen.getAttackWithHeroPenality(trgt, p, isLethalCheck);
                    if (heroAttackPen <= 499)
开发者ID:shuyi3,项目名称:AIPJ,代码行数:67,代码来源:Movegenerator.cs


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