Beispiel #1
0
        public void TransferCards()
        {
            _moves += 2;
            var thisCard = _gameContainer.CurrentComputer !.StockList.First();

            _gameContainer.CurrentComputer.Discard.Add(thisCard);
            _gameContainer.CurrentComputer.StockList.RemoveSpecificItem(thisCard);
            UpdateComputerCount();
        }
Beispiel #2
0
        public DutchBlitzCardInformation CardToUseForPublic(MoveInfo thisMove)
        {
            _moves += 3;
            DutchBlitzCardInformation thisCard;

            if (thisMove.FromStock)
            {
                thisCard = _gameContainer.CurrentComputer !.StockList.First();
                _gameContainer.CurrentComputer.StockList.RemoveSpecificItem(thisCard);
                UpdateComputerCount();
                return(thisCard);
            }
            if (thisMove.FromHand)
            {
                thisCard = _gameContainer.CurrentComputer !.PileList.Last();
                _gameContainer.CurrentComputer.PileList.RemoveSpecificItem(thisCard);
                return(thisCard);
            }
            thisCard = _gameContainer.CurrentComputer !.Discard[thisMove.DiscardPile];
            _gameContainer.CurrentComputer.Discard.RemoveSpecificItem(thisCard);
            return(thisCard);
        }
Beispiel #3
0
        public MoveInfo ComputerMove()
        {
            MoveInfo output   = new MoveInfo();
            var      thisCard = _gameContainer.CurrentComputer !.StockList.First();

            if (thisCard.CardValue == 1)
            {
                output.FromStock     = true;
                output.NewPublicPile = true;
                return(output);
            }
            int  maxs = _model.PublicPiles1 !.MaxPiles();
            int  x;
            bool rets;

            for (x = 1; x <= maxs; x++)
            {
                rets = _model.PublicPiles1.CanAddToPile(thisCard, x - 1); // 0 based i think
                if (rets == true)
                {
                    output.FromStock  = true;
                    output.PublicPile = x - 1; // because 0 based now.
                    return(output);
                }
            }
            if (_gameContainer.CurrentComputer.Discard.Count < _gameContainer.MaxDiscard)
            {
                output.FromStock  = true;
                output.AddDiscard = true;
                return(output);
            }
            int y = 0;

            foreach (var tempCard in _gameContainer.CurrentComputer.Discard)
            {
                y++;
                if (tempCard.CardValue == 1)
                {
                    output.NewPublicPile = true;
                    output.DiscardPile   = y - 1;
                    return(output);
                }
                for (x = 1; x <= maxs; x++)
                {
                    rets = _model.PublicPiles1.CanAddToPile(tempCard, x - 1);
                    if (rets)
                    {
                        output.DiscardPile = y - 1;
                        output.PublicPile  = x - 1;
                        return(output);
                    }
                }
            }
            if (_gameContainer.CurrentComputer.PileList.Count > 0)
            {
                thisCard = _gameContainer.CurrentComputer.PileList.Last();
                if (thisCard.CardValue == 1)
                {
                    output.FromHand      = true;
                    output.NewPublicPile = true;
                    return(output);
                }
                for (x = 1; x <= maxs; x++)
                {
                    rets = _model.PublicPiles1.CanAddToPile(thisCard, x - 1);
                    if (rets)
                    {
                        output.FromHand   = true;
                        output.PublicPile = x - 1;
                        return(output);
                    }
                }
            }
            output.DiscardPile = -1;
            output.PublicPile  = -1;
            output.FromStock   = false;
            output.FromHand    = false;
            return(output);
        }