public void CreateNewPile(D thisCard) // because this appears to be the only game that has it this way. (?)
        {
            BasicPileInfo <D> thisPile = new BasicPileInfo <D>();

            thisPile.ObjectList.Add(thisCard);
            PileList.Add(thisPile); // the bindings should do what it needs to (because of observable) well see
        }
示例#2
0
        private async Task DiscardPiles_PileClickedAsync(int index, BasicPileInfo <FlinchCardInformation> thisPile)
        {
            int playerDeck = _model !.PlayerHand1 !.ObjectSelected();

            if (playerDeck > 0)
            {
                if (_mainGame !.SaveRoot !.GameStatus == EnumStatusList.FirstOne && _mainGame.SaveRoot.PlayerFound == 0)
                {
                    await UIPlatform.ShowMessageAsync("Sorry; cannot discard one because you need either a one or else pass on this turn");

                    _mainGame.UnselectAllCards();
                    return;
                }
                if (_model.DiscardPiles !.CanAddToDiscardFlinch(index) == false)
                {
                    await UIPlatform.ShowMessageAsync("Sorry, cannot discard here because there is an empty one that has to be used first");

                    return;
                }
                await _mainGame !.AddToDiscardAsync(index, playerDeck);
                return;
            }
            if (_model.DiscardPiles !.HasCard(index) == false)
            {
                return;
            }
            if (_model.DiscardPiles.PileList ![index].IsSelected == true)
        public abstract string NextCardInStock(); // could be W even

        private async Task StockFrame_PileClickedAsync(int index, BasicPileInfo <D> thisPile)
        {
            if (StockClickedAsync == null)
            {
                return;
            }
            await StockClickedAsync.Invoke();
        }
示例#4
0
 private async Task Piles_PileClickedAsync(int Index, BasicPileInfo <SolitaireCard> thisPile)
 {
     if (PileSelectedAsync == null)
     {
         return;
     }
     await PileSelectedAsync.Invoke(Index);
 }
 private async Task PrivateClickAsync(BasicPileInfo <D> pile)
 {
     if (PileClickedAsync == null)
     {
         return;
     }
     await PileClickedAsync.Invoke(PileList.IndexOf(pile));
 }
示例#6
0
 private async Task PrivatePileAsync(BasicPileInfo <FlinchCardInformation> card)
 {
     if (PileClickedAsync == null)
     {
         return;
     }
     await PileClickedAsync.Invoke(PileList.IndexOf(card));
 }
        private async Task StrawberryPiles_PileClickedAsync(int index, BasicPileInfo <MilkRunCardInformation> mainPile)
        {
            PileInfo thisPile = new PileInfo();

            thisPile.Milk = EnumMilkType.Strawberry;
            thisPile.Pile = index + 1.ToEnum < EnumPileType > ();
            await _mainGame !.PlayerPileClickedAsync(this, thisPile);
        }
示例#8
0
 private PrivateBasicIndividualPileXF <CA, GC, GW> FindControl(BasicPileInfo <CA> thisPile)
 {
     foreach (var thisFirst in _thisGrid !.Children)
     {
         if (Grid.GetColumn((ContentView)thisFirst !) == thisPile.Column - 1 && Grid.GetRow((ContentView)thisFirst !) == thisPile.Row - 1)
         {
             return((PrivateBasicIndividualPileXF <CA, GC, GW>)thisFirst !);
         }
     }
     throw new BasicBlankException("No Control Found");
 }
 private IndividualPileWPF?FindControl(BasicPileInfo <DutchBlitzCardInformation> thisPile)
 {
     foreach (object?thisCon in _thisStack !.Children)
     {
         var news = (IndividualPileWPF)thisCon !;
         if (news.DataContext.Equals(thisPile) == true)
         {
             return(news);
         }
     }
     return(null);
 }
示例#10
0
        public static async Task AnimateCardAsync <D>(this IEventAggregator thisE,
                                                      D thisCard, EnumAnimcationDirection direction, string tag
                                                      , BasicPileInfo <D>?pile1 = null, Action?finalAction = null) where D : class, IDeckObject, new()
        {
            AnimateCardInPileEventModel <D> thisA = new AnimateCardInPileEventModel <D>();

            thisA.Direction   = direction;
            thisA.FinalAction = finalAction;
            thisA.ThisCard    = thisCard;
            thisA.ThisPile    = pile1;
            await thisE.PublishAsync(thisA, tag, false);
        }
示例#11
0
 private IndividualPileXF?FindControl(BasicPileInfo <FlinchCardInformation> thisPile)
 {
     foreach (var thisCon in _thisStack !.Children)
     {
         var news = (IndividualPileXF)thisCon !;
         if (news.BindingContext.Equals(thisPile) == true)
         {
             return(news);
         }
     }
     return(null);
 }
        private async Task DiscardPiles_PileClickedAsync(int index, BasicPileInfo <SkipboCardInformation> thisPile)
        {
            int playerDeck = _model !.PlayerHand1 !.ObjectSelected();

            if (playerDeck > 0)
            {
                await _mainGame !.AddToDiscardAsync(index, playerDeck);
                return;
            }
            if (_model.DiscardPiles !.HasCard(index) == false)
            {
                return;
            }
            if (_model.DiscardPiles.PileList ![index].IsSelected == true)
        public void Init(HeapSolitaireMainViewModel thisMod, BasicPileInfo <HeapSolitaireCardInfo> thisPile)
        {
            _mainMod    = thisMod.Waste1;
            _privateMod = thisPile;
            _cardList   = _privateMod.ObjectList;
            var tempDeck = GetNewCard(new HeapSolitaireCardInfo());

            _pixels = (int)tempDeck.ObjectSize.Width / 4;
            _cardList.CollectionChanged += CollectionChanged;
            Background = Brushes.Transparent; //learned from old version of belegured castle that if not set to transparent, clicking does not work.
            MouseUp   += SinglePileUI_MouseUp;
            _privateMod.PropertyChanged += PropertyChanged;
            _thisGrid = new Grid();
            Content   = _thisGrid;
            PopulateControls();
        }
        public void Init(HeapSolitaireMainViewModel thisMod, BasicPileInfo <HeapSolitaireCardInfo> thisPile)
        {
            _mainMod    = thisMod.Waste1;
            _privateMod = thisPile;
            _cardList   = _privateMod.ObjectList;
            var tempDeck = GetNewCard(new HeapSolitaireCardInfo());

            _pixels = (int)tempDeck.ObjectSize.Width / 4;
            _cardList.CollectionChanged += CollectionChanged;
            _canvas = new SKCanvasView();
            _canvas.EnableTouchEvents = true;
            _canvas.Touch            += Touch;
            Grid grid = new Grid();

            _privateMod.PropertyChanged += TempPropertyChanged;
            _thisGrid = new Grid();
            _thisGrid.InputTransparent = true;
            grid.Children.Add(_thisGrid);
            grid.Children.Add(_canvas);
            Content = grid;
            PopulateControls();
        }
 private async Task CardPiles_PileClickedAsync(int index, BasicPileInfo <MillebournesCardInformation> thisPile)
 {
     if (_gameContainer.TeamClickAsync == null)
     {
         throw new BasicBlankException("Nobody is handling team clicking.  Rethink");
     }
     if (index == 0)
     {
         await _gameContainer.TeamClickAsync.Invoke(EnumPileType.Miles, TeamNumber);
     }
     else if (index == 1)
     {
         await _gameContainer.TeamClickAsync.Invoke(EnumPileType.Speed, TeamNumber);
     }
     else if (index == 2)
     {
         await _gameContainer.TeamClickAsync.Invoke(EnumPileType.Hazard, TeamNumber);
     }
     else
     {
         throw new BasicBlankException("Only 3 piles supported.  Find out what happened");
     }
 }
        private async Task PublicPiles_PileClickedAsync(int index, BasicPileInfo <SkipboCardInformation> thisPile)
        {
            int decks = CardSelected(out EnumCardType types, out int discardNum);

            if (decks == 0 && types == EnumCardType.IsNone)
            {
                await UIPlatform.ShowMessageAsync("Sorry, there was nothing selected");

                return;
            }
            if (decks == 0)
            {
                throw new BasicBlankException("Nothing selected but the type was not none");
            }
            bool rets = IsValidMove(index, decks);

            if (rets == false)
            {
                await UIPlatform.ShowMessageAsync("Illegal Move");

                return;
            }
            await PlayOnPileAsync(index, decks, types, discardNum);
        }
示例#17
0
 private Task Waste1_PileClickedAsync(int index, BasicPileInfo <HeapSolitaireCardInfo> pile)
 {
     Waste1 !.SelectPile(index);
     return(Task.CompletedTask);
 }
示例#18
0
 private async Task Main1_PileClickedAsync(int index, BasicPileInfo <HeapSolitaireCardInfo> pile)
 {
     await _mainGame !.SelectMainAsync(index);
 }
示例#19
0
 private async Task FreePiles1_PileClickedAsync(int Index, BasicPileInfo <SolitaireCard> ThisPile)
 {
     await _mainGame !.FreeSelectedAsync(Index);
 }
示例#20
0
 private async Task GameBoard1_PileClickedAsync(int index, BasicPileInfo <RegularSimpleCard> thisPile)
 {
     await _mainGame.SelectCardAsync(thisPile.ThisObject.Deck);
 }
示例#21
0
 private async Task Discards_PileClickedAsync(int index, BasicPileInfo <SolitaireCard> thisPile)
 {
     await AllPilesClickedAsync(index);
 }