Task IUIView.TryActivateAsync() { BlackjackMainViewModel model = (BlackjackMainViewModel)DataContext; _deckGPile.Init(model.DeckPile, ts.TagUsed); return(Task.CompletedTask); }
Task IHandleAsync <LoadEventModel> .HandleAsync(LoadEventModel message) { BlackjackMainViewModel model = (BlackjackMainViewModel)BindingContext; _humanHand.LoadList(model.HumanStack !, ts.TagUsed); _computerHand.LoadList(model.ComputerStack !, ts.TagUsed); return(Task.CompletedTask); }
Task IHandleAsync <LoadEventModel> .HandleAsync(LoadEventModel message) { BlackjackMainViewModel model = (BlackjackMainViewModel)DataContext; _humanHand.LoadList(model.HumanStack !, ts.TagUsed); _computerHand.LoadList(model.ComputerStack !, ts.TagUsed); return(Task.CompletedTask); //return this.RefreshBindingsAsync(_aggregator); }
public int CalculateScore(BlackjackMainViewModel model) { if (model.SelectedYet == false) { if (SecondCard !.Points == 0) { throw new BasicBlankException("Cannot have 0 points. Find out what happened"); } return(SecondCard.Points); } if (_mVarComputer == false) { if (HandList.Any(Items => Items.Points == 0)) { throw new BasicBlankException("A card cannot be worth 0 points. find out what happened"); } } return(HandList.Sum(Items => Items.Points)); }
public Task NewGameAsync(DeckObservablePile <BlackjackCardInfo> deck, BlackjackMainViewModel model) { _model = model; //i think should be here. GameGoing = true; return(base.NewGameAsync(deck)); }