async Task IBuyProcesses.BuyerSelectedAsync(int deck)
        {
            _gameContainer.SingleInfo = _gameContainer.PlayerList !.GetWhoPlayer();
            if (_gameContainer.SingleInfo.CanSendMessage(_gameContainer.BasicData !) == true)
            {
                await _gameContainer.Network !.SendAllAsync("buyerselected", deck);
            }
            var thisDeal = _model.CurrentDealList !.HandList.GetSpecificItem(deck);

            thisDeal.IsSelected = false;
            _model.CurrentDealList.HandList.ReplaceAllWithGivenItem(thisDeal);
            if (_gameContainer.Test !.NoAnimations == false)
            {
                await _gameContainer.Delay !.DelaySeconds(.5);
            }
            RemovePlayerDeal(thisDeal);
            _gameContainer.SingleInfo.MoneyHas += thisDeal.Value;
            var tempList = _gameContainer.SingleInfo.Hand.GetMailOrDealList <DealCard>(EnumCardCategory.Deal);

            _model.CurrentDealList.HandList.ReplaceRange(tempList);
            if (_gameContainer.Test !.NoAnimations == false)
            {
                await _gameContainer.Delay !.DelaySeconds(1.5);
            }
            _gameContainer.PopulateDeals(_model);
            if (_gameContainer.Test !.NoAnimations == false)
            {
                await _gameContainer.Delay !.DelaySeconds(1.5);
            }
            _gameContainer.SaveRoot !.GameStatus = EnumStatus.EndingTurn;
            await _gameContainer.ContinueTurnAsync !.Invoke();
        }
Beispiel #2
0
        public SolitaireCard GetCardSelected()
        {
            int nums = ObjectSelected();

            if (nums == 0)
            {
                return(new SolitaireCard()); //hopefully still okay.
            }
            return(HandList.GetSpecificItem(nums));
        }
        private async Task TrainClickedAsync(int index)
        {
            CommandContainer.StartExecuting();
            int decks = DominoSelected(out bool train);

            if (decks == 0)
            {
                await UIPlatform.ShowMessageAsync("Sorry, must have one domino selected to put on the pile");

                CommandContainer.StopExecuting();
                CommandContainer.ManualReport();
                return;
            }
            MexicanDomino thisDomino;

            if (train)
            {
                thisDomino = _viewModel.PrivateTrain1 !.HandList.GetSpecificItem(decks);
            }
            else
            {
                thisDomino = _viewModel.PlayerHand1.HandList.GetSpecificItem(decks);
            }
            if (_viewModel.TrainStation1 !.CanPlacePiece(thisDomino, index) == false)
            {
                await UIPlatform.ShowMessageAsync("Illegal Move");

                CommandContainer.StopExecuting();
                return;
            }
            if (_mainGame.BasicData !.MultiPlayer)
            {
                SendPlay output = new SendPlay();
                output.Deck    = decks;
                output.Section = index;
                await _mainGame.Network !.SendAllAsync("dominoplayed", output);
            }
            if (train)
            {
                _mainGame !.SingleInfo !.LongestTrainList.RemoveObjectByDeck(decks);
                _viewModel.PrivateTrain1 !.HandList.RemoveObjectByDeck(decks);
            }
            else
            {
                _mainGame !.SingleInfo !.MainHandList.RemoveObjectByDeck(decks);
            }
            _viewModel.UpdateCount(_mainGame.SingleInfo !);
            await _viewModel.TrainStation1.AnimateShowSelectedDominoAsync(index, thisDomino, _mainGame); //hopefully this simple.

            CommandContainer.StopExecuting();                                                            //try this as well.
        }
        protected override SolitaireCard CardPlayed()
        {
            var thisCard = base.CardPlayed();

            if (thisCard.Deck > 0)
            {
                if (GlobalClass.Stock !.ObjectSelected() > 0)
                {
                    return(new SolitaireCard());
                }
                return(thisCard);
            }
            thisCard = GlobalClass.Stock !.HandList.GetSpecificItem(GlobalClass.Stock.ObjectSelected());
            return(thisCard);
        }
Beispiel #5
0
        public bool IsCardSelected(int deck)
        {
            var thisCard = HandList.GetSpecificItem(deck);

            return(thisCard.IsSelected);
        }