Exemple #1
0
 public void ShowCard <F>(F thisCard)
     where F : FluxxCardInformation, new()
 {
     if (thisCard.Deck == CurrentCard.Deck)
     {
         return;
     }
     CurrentCard = FluxxDetailClass.GetNewCard(thisCard.Deck); //try this way.
     CurrentCard.Populate(thisCard.Deck);                      //needs to be specific so it can run the proper routines.
     NotifyCard();
 }
        public async Task PlayCardAsync(FluxxCardInformation card)
        {
            await _model !.ShowPlayCardAsync(card);

            card.IsSelected = false;
            card.Drew       = false;
            bool doAgain = false;

            _gameContainer.SaveRoot !.DoAnalyze = false;
            if (_gameContainer !.EverybodyGetsOneList.Count > 0)
            {
                throw new BasicBlankException("Everybody gets one was not finished.  That must be finished before playing another card");
            }
            if (_gameContainer.TempActionHandList.Count > 0)
            {
                throw new BasicBlankException("There are cards left from the temporary action list.  Must finish choosing the order to play the cards.  Then they will play in the order");
            }
            if (_gameContainer.CurrentAction != null)
            {
                if (_gameContainer.CurrentAction.Deck == EnumActionMain.LetsDoThatAgain)
                {
                    doAgain = true;
                    _model.Pile1 !.RemoveCardFromPile(card);
                }
            }
            _gameContainer.CurrentAction = null;
            if (_gameContainer.QuePlayList.Count == 0 && doAgain == false)
            {
                _gameContainer.SaveRoot.CardsPlayed++;
                _gameContainer.SingleInfo = _gameContainer.PlayerList !.GetWhoPlayer();
                _gameContainer.RemoveFromHandOnly(card);
            }
            else if (doAgain == false)
            {
                _gameContainer.QuePlayList.RemoveFirstItem();
            }
            _gameContainer.SingleInfo = _gameContainer.PlayerList !.GetWhoPlayer();
            FluxxCardInformation final = FluxxDetailClass.GetNewCard(card.Deck);

            final.Populate(card.Deck);
            switch (card.CardType)
            {
            case EnumCardType.Rule:
                await PlayRuleAsync((RuleCard)final);

                break;

            case EnumCardType.Keeper:
                await PlayKeeperAsync((KeeperCard)final);

                break;

            case EnumCardType.Goal:
                await PlayGoalAsync((GoalCard)final);

                break;

            case EnumCardType.Action:
                await PlayActionAsync((ActionCard)final);

                break;

            default:
                throw new BasicBlankException("Can't figure out which one to play for card type");
            }
        }
Exemple #3
0
 public DetailCardObservable()
 {
     CurrentCard           = new FluxxCardInformation();
     CurrentCard.IsUnknown = true;
 }
Exemple #4
0
 public void ResetCard()
 {
     CurrentCard           = new FluxxCardInformation();
     CurrentCard.IsUnknown = true;
     NotifyCard();
 }
Exemple #5
0
 private Task YourCards_ConsiderSelectOneAsync(FluxxCardInformation thisObject)
 {
     ShowCard(thisObject);
     return(Task.CompletedTask);
 }
Exemple #6
0
 public async Task DiscardKeeperAsync(FluxxCardInformation thisCard)
 {
     _gameContainer.SingleInfo !.KeeperList.RemoveObjectByDeck(thisCard.Deck);
     await _gameContainer.AnimatePlayAsync !(thisCard);
 }
Exemple #7
0
 public async Task DiscardFromHandAsync(FluxxCardInformation thisCard)
 {
     _gameContainer.RemoveFromHandOnly(thisCard);
     await _gameContainer.AnimatePlayAsync !(thisCard);
 }