private DeckRegularDict <RegularSimpleCard> CardsForAttack()
        {
            if (_gameContainer.GetAttackStage == null)
            {
                throw new BasicBlankException("Nobody is handling get attack stage for computer ai.  Rethink");
            }
            var possibleList = _gameContainer.SingleInfo !.MainHandList.PossibleCombinations(EnumColorList.Red);
            var thisItem     = possibleList.OrderByDescending(items => _gameContainer.GetAttackStage(items)).ThenByDescending(items => items.DistinctCount(temps => temps.Value)).Take(1).Single(); //hopefully using distinct count works.

            return(new DeckRegularDict <RegularSimpleCard>(thisItem));
        }
Exemple #2
0
        public bool CanAddDefenseCards(ICustomBasicList <RegularSimpleCard> thisList)
        {
            if (_gameContainer.GetAttackStage == null)
            {
                throw new BasicBlankException("Nobody is handling the getattackstage.  Rethink");
            }
            if (_gameContainer.GetDefenseStage == null)
            {
                throw new BasicBlankException("Nobody is handling the getdefensestage.  Rethink");
            }
            BladesOfSteelPlayerItem thisPlayer = _gameContainer.PlayerList !.GetWhoPlayer();
            var attackStage = _gameContainer.GetAttackStage(thisPlayer.AttackList);

            if (attackStage == EnumAttackGroup.GreatOne)
            {
                return(false);
            }
            var defenseStage = _gameContainer.GetDefenseStage(thisList);

            if (defenseStage == EnumDefenseGroup.StarGoalie)
            {
                return(true);
            }
            if ((int)defenseStage > (int)attackStage)
            {
                return(true);
            }
            if ((int)attackStage > (int)defenseStage)
            {
                return(false);
            }
            int attackPoints  = thisPlayer.AttackList.Sum(items => (int)items.Value);
            int defensePoints = thisList.Sum(items => (int)items.Value);

            return(defensePoints >= attackPoints);
        }