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


C# Playfield.printMoveList方法代码示例

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


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

示例1: getMoveListForPlayfield

        public void getMoveListForPlayfield(Playfield p, bool log, bool lethalCheck)
        {
            bool own = p.isOwnTurn;
            Player mPlayer;
            int playerNumber = 1;
            if (own)
            {
                mPlayer = p.playerFirst;
                playerNumber = 1;
            }
            else
            {
                mPlayer = p.playerSecond;
                playerNumber = 2;
            }

            Action playedAction;          

            if (p.moveList.Count == 0) //if starting, generate move
            {
                //GameManager.Instance.moveCount++;
                p.moveList = new List<Action>(getMoveList(p, lethalCheck, true, true));
                if (log)
                {
                    Helpfunctions.Instance.logg("######################start turn for player " + playerNumber);
                }
            }
            else //non starting, generate move from existing moves
            {
                playedAction = mPlayer.playactions[mPlayer.playactions.Count - 1];

                if (log)
                {
                    Helpfunctions.Instance.logg("Action:------------------------------------");
                    playedAction.print();
                    p.printMoveList();
                }

                if (p.moveTrigger.handcardAdded || p.moveTrigger.tauntChanged || p.moveTrigger.manaChanged ||
                    p.moveTrigger.ownNewTarget || p.moveTrigger.enemyNewTarget)
                {
                    p.moveList = getMoveList(p, lethalCheck, true, true);
                }
                else 
                {
                    if (p.moveTrigger.minionDied)
                    {
                        foreach (int entityID in p.moveTrigger.minionDiedList)
                        {
                            p.moveList.RemoveAll(x => ((x.target != null && x.target.entitiyID == entityID) || ((x.actionType == actionEnum.attackWithMinion) && x.own.entitiyID == entityID)));
                        }
                    }
                    //Helpfunctions.Instance.logg("movecount == " + GameManager.Instance.moveCount);
                    if (playedAction.actionType == actionEnum.playcard) //play a card
                    {
                        p.moveList.RemoveAll(x => (x.card != null && x.card.entity == playedAction.card.entity));
                    }
                    if (playedAction.actionType == actionEnum.attackWithMinion)//
                    {
                        if (playedAction.own.entitiyID == 1008 && playedAction.target.entitiyID == 1003)
                        {
                            int debug = 1;
                        }
                        if ((playedAction.own.windfury && playedAction.own.numAttacksThisTurn == 2) || !playedAction.own.windfury)
                        {
                            p.moveList.RemoveAll(x => (x.actionType == actionEnum.attackWithMinion && x.own.entitiyID == playedAction.own.entitiyID));
                        }
                    }
                    if (playedAction.actionType == actionEnum.useHeroPower)
                    {
                        p.moveList.RemoveAll(x => x.actionType == actionEnum.useHeroPower);
                    }

                    //mana
                    p.moveList.RemoveAll(x => x.manaCost > mPlayer.mana);
                }
            }

            foreach (int m in p.moveTrigger.minionDiedList)
            {
                if (m == 1008)
                {
                    int debug = 1;
                }
            }
            p.moveTrigger.Clear();

            if (log)
            {
                if (p.isOwnTurn)
                {
                    Helpfunctions.Instance.logg("player 1 Mana: " + p.playerFirst.mana + "/" + p.playerFirst.ownMaxMana);
                }
                else
                {
                    Helpfunctions.Instance.logg("player 2 Mana: " + p.playerSecond.mana + "/" + p.playerSecond.ownMaxMana);
                }
                p.printMoveList();
            }
        }
开发者ID:shuyi3,项目名称:AIPJ,代码行数:100,代码来源:Movegenerator.cs


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