protected override SolitaireGameClass <DemonSolitaireSaveInfo> GetGame(IGamePackageResolver resolver) { return(resolver.ReplaceObject <DemonSolitaireMainGameClass>()); }
public XPuzzleShellViewModel(IGamePackageResolver mainContainer, CommandContainer container, IGameInfo GameData, ISaveSinglePlayerClass saves) : base(mainContainer, container, GameData, saves) { }
protected override SolitaireGameClass <BeleaguredCastleSaveInfo> GetGame(IGamePackageResolver resolver) { return(resolver.ReplaceObject <BeleaguredCastleMainGameClass>()); }
public DummyRummyVMData(IEventAggregator aggregator, CommandContainer command, IGamePackageResolver resolver) { Deck1 = new DeckObservablePile <RegularRummyCard>(aggregator, command); Pile1 = new PileObservable <RegularRummyCard>(aggregator, command); PlayerHand1 = new HandObservable <RegularRummyCard>(command); TempSets = new TempSetsObservable <EnumSuitList, EnumColorList, RegularRummyCard>(command, resolver); MainSets = new MainSetsObservable <EnumSuitList, EnumColorList, RegularRummyCard, DummySet, SavedSet>(command); TempSets.HowManySets = 6; }
public Pinochle2PlayerMainView(IEventAggregator aggregator, TestOptions test, Pinochle2PlayerVMData model, IGamePackageResolver resolver ) { _aggregator = aggregator; _model = model; _resolver = resolver; _aggregator.Subscribe(this); _deckGPile = new BaseDeckWPF <Pinochle2PlayerCardInformation, ts, DeckOfCardsWPF <Pinochle2PlayerCardInformation> >(); _discardGPile = new BasePileWPF <Pinochle2PlayerCardInformation, ts, DeckOfCardsWPF <Pinochle2PlayerCardInformation> >(); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <Pinochle2PlayerCardInformation, ts, DeckOfCardsWPF <Pinochle2PlayerCardInformation> >(); _trick1 = new TwoPlayerTrickWPF <EnumSuitList, Pinochle2PlayerCardInformation, ts, DeckOfCardsWPF <Pinochle2PlayerCardInformation> >(); _guide1 = new GuideUI(); _deckStack = new StackPanel(); _yourMeld = new BaseHandWPF <Pinochle2PlayerCardInformation, ts, DeckOfCardsWPF <Pinochle2PlayerCardInformation> >(); _opponentMeld = new BaseHandWPF <Pinochle2PlayerCardInformation, ts, DeckOfCardsWPF <Pinochle2PlayerCardInformation> >(); _tempG = new TempRummySetsWPF <EnumSuitList, EnumColorList, Pinochle2PlayerCardInformation, ts, DeckOfCardsWPF <Pinochle2PlayerCardInformation> >(); _trick1.Width = 500; // i think. _yourMeld.Divider = 1.5; _opponentMeld.Divider = 1.5; _yourMeld.HandType = HandObservable <Pinochle2PlayerCardInformation> .EnumHandList.Vertical; _opponentMeld.HandType = HandObservable <Pinochle2PlayerCardInformation> .EnumHandList.Vertical; _tempG.Height = 250; //i think. StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(Pinochle2PlayerMainViewModel.RestoreScreen) }; } StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_deckStack); _deckStack.Children.Add(_discardGPile); otherStack.Children.Add(_trick1); otherStack.Children.Add(_tempG); mainStack.Children.Add(otherStack); _score.AddColumn("Cards Left", false, nameof(Pinochle2PlayerPlayerItem.ObjectCount)); //very common. _score.AddColumn("Tricks Won", false, nameof(Pinochle2PlayerPlayerItem.TricksWon)); _score.AddColumn("Current Score", false, nameof(Pinochle2PlayerPlayerItem.CurrentScore)); _score.AddColumn("Total Score", false, nameof(Pinochle2PlayerPlayerItem.TotalScore)); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(Pinochle2PlayerMainViewModel.NormalTurn)); firstInfo.AddRow("Trump", nameof(Pinochle2PlayerMainViewModel.TrumpSuit)); firstInfo.AddRow("Status", nameof(Pinochle2PlayerMainViewModel.Status)); mainStack.Children.Add(_playerHandWPF); var endButton = GetGamingButton("End Turn", nameof(Pinochle2PlayerMainViewModel.EndTurnAsync)); endButton.HorizontalAlignment = HorizontalAlignment.Left; var meldBut = GetGamingButton("Meld", nameof(Pinochle2PlayerMainViewModel.MeldAsync)); otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; StackPanel tempStack = new StackPanel(); tempStack.Children.Add(meldBut); tempStack.Children.Add(endButton); otherStack.Children.Add(tempStack); otherStack.Children.Add(_yourMeld); otherStack.Children.Add(_opponentMeld); mainStack.Children.Add(otherStack); StackPanel scoreStack = new StackPanel(); scoreStack.Children.Add(_score); scoreStack.Children.Add(firstInfo.GetContent); scoreStack.Children.Add(_guide1); Grid finalGrid = new Grid(); AddLeftOverColumn(finalGrid, 70); AddLeftOverColumn(finalGrid, 30); // hopefully that works. AddControlToGrid(finalGrid, mainStack, 0, 0); AddControlToGrid(finalGrid, scoreStack, 0, 1); _deckGPile.Margin = new Thickness(5, 5, 5, 5); _discardGPile.Margin = new Thickness(5, 5, 5, 5); if (restoreP != null) { //todo: figure out where to place the restore ui if there is a restore option. mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = finalGrid; }
public ShipCaptainCrewVMData(IGamePackageResolver resolver, CommandContainer command) { _resolver = resolver; _command = command; }
public SequenceDiceVMData(CommandContainer command, IGamePackageResolver resolver) { _command = command; _resolver = resolver; }
public StatsBoardCP(IGamePackageResolver mainContainer) : base(mainContainer) { }
public void LoadList(HandObservable <CA> thisMod, string tagUsed) { CA firstCard; _tagUsed = tagUsed; BindingContext = thisMod; SetBinding(TextProperty, new Binding(nameof(HandObservable <CA> .Text))); SetBinding(IsEnabledProperty, new Binding(nameof(HandObservable <CA> .IsEnabled))); _thisMod = thisMod; if (_alreadyLoaded == true) { throw new BasicBlankException("Needs some rethinking because i intended to load once"); } if (_thisMod.HandList.Count == 0) { firstCard = new CA(); } else { firstCard = _thisMod.HandList.First(); } if (firstCard.DefaultSize.Height == 0 || firstCard.DefaultSize.Width == 0) { throw new BasicBlankException("The width and height must be greater than 0 when initializging hand wpf"); } IGamePackageResolver thisR = (IGamePackageResolver)cons !; IProportionImage thisI = thisR.Resolve <IProportionImage>(tagUsed); _sizeUsed = firstCard.DefaultSize.GetSizeUsed(thisI.Proportion); ObjectList = _thisMod.HandList; ObjectList.CollectionChanged += ObjectList_CollectionChanged; ThisScroll = new ScrollView(); if (HasAngles == false) { _thisStack = new GameOverlapLayout <CA, GC>(_sizeUsed); _thisStack.Spacing = 0; } else { _otherStack = new StackLayout(); _otherStack.Spacing = 0; } SetBinding(MaximumCardsProperty, new Binding(nameof(HandObservable <CA> .Maximum))); PositionMainControls(); PopulateList(); SetVisibleConverter(); _thisGrid.Children.Add(ThisDraw); ThisScroll.HorizontalScrollBarVisibility = ScrollBarVisibility.Default; ThisScroll.VerticalScrollBarVisibility = ScrollBarVisibility.Default; //try this too. if (HasAngles == false) { ThisScroll.Content = _thisStack; } else { ThisScroll.Content = _otherStack; } var thisRect = ThisFrame.GetControlArea(); if (HasAngles == false) { ThisScroll.Margin = new Thickness(thisRect.Left - 1, thisRect.Top - 1, 0, 3); // try this way. } else { ThisScroll.Margin = new Thickness(thisRect.Left - 1, thisRect.Top - 1, 3, 3); } _thisGrid.Children.Add(ThisScroll); RecalulateFrames(); _drawControl = new SKCanvasView(); _drawControl.EnableTouchEvents = true; _drawControl.Touch += DrawControlTouch; _thisGrid.Children.Add(_drawControl); Content = _thisGrid; _alreadyLoaded = true; }
protected override SolitaireGameClass <FreeCellSolitaireSaveInfo> GetGame(IGamePackageResolver resolver) { _mainGame = resolver.ReplaceObject <FreeCellSolitaireMainGameClass>(); return(_mainGame); }
public SinisterSixVMData(IGamePackageResolver resolver, CommandContainer command) { _resolver = resolver; _command = command; }
public void SetContainer(IGamePackageResolver thisCon) { _privateBoard.MainContainer = thisCon; }
public SignalRMessageService(ISignalRInfo thisTCP, IMessageProcessor thisMessage, IGamePackageResolver resolver) { _thisTCP = thisTCP; _thisMessage = thisMessage; _resolver = resolver; }
public CaptiveQueensSolitaireShellViewModel(IGamePackageResolver mainContainer, CommandContainer container, IGameInfo GameData, ISaveSinglePlayerClass saves) : base(mainContainer, container, GameData, saves) { }
public CustomMain(ScoreModel thisMod, CommandContainer command, IGamePackageResolver resolver) : base(thisMod, command, resolver) { ShowCenter = false; _thisMod = thisMod; }
public SixtySix2PlayerMainView(IEventAggregator aggregator, TestOptions test, SixtySix2PlayerVMData model, IGamePackageResolver resolver ) { _aggregator = aggregator; _model = model; _resolver = resolver; _aggregator.Subscribe(this); _deckGPile = new BaseDeckXF <SixtySix2PlayerCardInformation, ts, DeckOfCardsXF <SixtySix2PlayerCardInformation> >(); _discardGPile = new BasePileXF <SixtySix2PlayerCardInformation, ts, DeckOfCardsXF <SixtySix2PlayerCardInformation> >(); _score = new ScoreBoardXF(); _playerHandWPF = new BaseHandXF <SixtySix2PlayerCardInformation, ts, DeckOfCardsXF <SixtySix2PlayerCardInformation> >(); _trick1 = new TwoPlayerTrickXF <EnumSuitList, SixtySix2PlayerCardInformation, ts, DeckOfCardsXF <SixtySix2PlayerCardInformation> >(); _deckStack = new StackLayout(); _marriage1 = new BaseHandXF <SixtySix2PlayerCardInformation, ts, DeckOfCardsXF <SixtySix2PlayerCardInformation> >(); StackLayout mainStack = new StackLayout(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer(nameof(SixtySix2PlayerMainViewModel.RestoreScreen)); } StackLayout otherStack = new StackLayout(); otherStack.Orientation = StackOrientation.Horizontal; otherStack.Children.Add(_deckStack); _deckStack.Children.Add(_discardGPile); // can reposition or not even have as well. otherStack.Children.Add(_trick1); mainStack.Children.Add(otherStack); _score.AddColumn("Cards Left", true, nameof(SixtySix2PlayerPlayerItem.ObjectCount)); _score.AddColumn("Tricks Won", true, nameof(SixtySix2PlayerPlayerItem.TricksWon)); _score.AddColumn("Score Round", true, nameof(SixtySix2PlayerPlayerItem.ScoreRound)); _score.AddColumn("Game Points Round", true, nameof(SixtySix2PlayerPlayerItem.GamePointsRound)); _score.AddColumn("Total Points Game", true, nameof(SixtySix2PlayerPlayerItem.GamePointsGame)); SimpleLabelGridXF firstInfo = new SimpleLabelGridXF(); firstInfo.AddRow("Turn", nameof(SixtySix2PlayerMainViewModel.NormalTurn)); firstInfo.AddRow("Trump", nameof(SixtySix2PlayerMainViewModel.TrumpSuit)); firstInfo.AddRow("Status", nameof(SixtySix2PlayerMainViewModel.Status)); firstInfo.AddRow("Bonus", nameof(SixtySix2PlayerMainViewModel.BonusPoints)); mainStack.Children.Add(_playerHandWPF); mainStack.Children.Add(firstInfo.GetContent); mainStack.Children.Add(_score); otherStack = new StackLayout(); otherStack.Orientation = StackOrientation.Horizontal; var thisBut = GetGamingButton("Go Out", nameof(SixtySix2PlayerMainViewModel.GoOutAsync)); otherStack.Children.Add(thisBut); thisBut = GetGamingButton("Announce Marriage", nameof(SixtySix2PlayerMainViewModel.AnnouceMarriageAsync)); otherStack.Children.Add(thisBut); mainStack.Children.Add(otherStack); mainStack.Children.Add(_guide1); mainStack.Children.Add(_marriage1); _deckGPile.Margin = new Thickness(5, 5, 5, 5); _discardGPile.Margin = new Thickness(5, 5, 5, 5); if (restoreP != null) { //todo: figure out where to place the restore ui if there is a restore option. mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = mainStack; }
public DominoGamesVM(CommandContainer commandContainer, IDominoDrawProcesses <D> mainGame, IDominoGamesData <D> viewModel, BasicData basicData, TestOptions test, IGamePackageResolver resolver) : base(commandContainer, mainGame, viewModel, basicData, test, resolver) { _model = viewModel; _mainGame = mainGame; //do the delegates. _model.DrewDominoAsync = DrewDominoAsync; if (AlwaysEnableHand() == false) { _model.PlayerHand1.SendEnableProcesses(this, () => { return(CanEnableHand()); }); } else { _model.PlayerHand1.SendAlwaysEnable(this);// will handle this part } _model.BoneYard.SendEnableProcesses(this, () => { return(CanEnableBoneYard()); }); _model.HandClickedAsync = HandClicked; _model.PlayerBoardClickedAsync = PlayerBoardClickedAsync; }