public async Task AddToReserveAsync() { if (GlobalClass.MainModel !.ReservePiles1 !.HowManyCards >= 8) { await UIPlatform.ShowMessageAsync("There can only be 8 cards to reserve. Therefore, cannot add any more cards to reserve"); return; } if (GlobalClass.MainModel.ReservePiles1.ObjectSelected() > 0) { await UIPlatform.ShowMessageAsync("There is already a card selected. Unselect the card first before adding a card to reserve"); return; } if (_thisMod !.WastePiles1 !.OneSelected() == -1) { await UIPlatform.ShowMessageAsync("There is no card selected to add to reserve"); return; } var thisCard = _thisMod.WastePiles1.GetCard(); GlobalClass.MainModel !.ReservePiles1.AddCard(thisCard); _thisMod.WastePiles1.RemoveSingleCard(); }
//for now, no double click. if we decide to support it, then will be here. protected override async Task <bool> HasOtherAsync(int pile) { int reserves = GlobalClass.MainModel !.ReservePiles1 !.ObjectSelected(); int wastes = _thisMod !.WastePiles1 !.OneSelected(); if (reserves > 0 && wastes > -1) { await UIPlatform.ShowMessageAsync("Must either select a reserve or a waste pile but not both"); return(true); } if (wastes == pile || wastes == -1 && reserves == 0) { _thisMod.WastePiles1.SelectUnselectPile(pile); //i think. return(true); } if (reserves > 0) { if (_thisMod.WastePiles1.CanAddSingleCard(pile, GlobalClass.MainModel.ReservePiles1.GetCardSelected()) == false) { await UIPlatform.ShowMessageAsync("Illegal Move"); return(true); } var oldCard = GlobalClass.MainModel !.ReservePiles1.GetCardSelected(); GlobalClass.MainModel !.ReservePiles1.RemoveCard(oldCard); _thisMod.WastePiles1.AddSingleCard(pile, oldCard); return(true); } var thisCard = _thisMod.WastePiles1.GetCard(); if (_thisMod.WastePiles1.CanAddSingleCard(pile, thisCard) == false) { await UIPlatform.ShowMessageAsync("Illegal Move"); return(true); } _thisMod.WastePiles1.MoveSingleCard(pile); return(true); }