private DeckRegularDict <RegularSimpleCard> CardsForFirstDefense()
        {
            if (_gameContainer.GetDefenseStage == null)
            {
                throw new BasicBlankException("Nobody is handling get defense stage for computer ai.  Rethink");
            }
            var thisList  = _gameContainer.SingleInfo !.MainHandList.PossibleCombinations(EnumColorList.Black);
            var firstItem = thisList.OrderByDescending(items => _gameContainer.GetDefenseStage(items)).ThenByDescending(items => items.Sum(temps => (int)temps.Value)).Take(1).Single();

            return(new DeckRegularDict <RegularSimpleCard>(firstItem));
        }
示例#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);
        }