예제 #1
0
 public SkuckCardGameMainGameClass(IGamePackageResolver mainContainer,
                                   IEventAggregator aggregator,
                                   BasicData basicData,
                                   TestOptions test,
                                   SkuckCardGameVMData currentMod,
                                   IMultiplayerSaveState state,
                                   IAsyncDelayer delay,
                                   ICardInfo <SkuckCardGameCardInformation> cardInfo,
                                   CommandContainer command,
                                   SkuckCardGameGameContainer gameContainer,
                                   ITrickData trickData,
                                   ITrickPlay trickPlay,
                                   IAdvancedTrickProcesses aTrick,
                                   IBidProcesses bidProcesses,
                                   IPlayChoiceProcesses choiceProcesses,
                                   ITrumpProcesses trumpProcesses
                                   )
     : base(mainContainer, aggregator, basicData, test, currentMod, state, delay, cardInfo, command, gameContainer, trickData, trickPlay)
 {
     _model           = currentMod;
     _command         = command;
     _gameContainer   = gameContainer;
     _aTrick          = aTrick;
     _bidProcesses    = bidProcesses;
     _choiceProcesses = choiceProcesses;
     _trumpProcesses  = trumpProcesses;
     _gameContainer.ComputerTurnAsync     = ComputerTurnAsync;
     _gameContainer.StartNewTrickAsync    = StartNewTrickAsync;
     _gameContainer.ShowHumanCanPlayAsync = ShowHumanCanPlayAsync;
 }
 public SkuckChoosePlayViewModel(
     CommandContainer commandContainer,
     SkuckCardGameGameContainer gameContainer,
     IPlayChoiceProcesses processes)
 {
     CommandContainer = commandContainer;
     _gameContainer   = gameContainer;
     _processes       = processes;
 }
예제 #3
0
 public SkuckSuitViewModel(CommandContainer commandContainer,
                           SkuckCardGameVMData model,
                           SkuckCardGameGameContainer gameContainer,
                           ITrumpProcesses processes
                           )
 {
     CommandContainer = commandContainer;
     _model           = model;
     _gameContainer   = gameContainer;
     _processes       = processes;
 }
 public SkuckBiddingViewModel(CommandContainer commandContainer,
                              SkuckCardGameVMData model,
                              SkuckCardGameGameContainer gameContainer,
                              IBidProcesses processes
                              )
 {
     CommandContainer = commandContainer;
     _model           = model;
     _gameContainer   = gameContainer;
     _processes       = processes;
 }
예제 #5
0
        public SkuckCardGameMainView(IEventAggregator aggregator,
                                     TestOptions test,
                                     SkuckCardGameVMData model,
                                     SkuckCardGameGameContainer gameContainer
                                     )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);
            _gameContainer = gameContainer;
            _score         = new ScoreBoardXF();
            _playerHandWPF = new BaseHandXF <SkuckCardGameCardInformation, ts, DeckOfCardsXF <SkuckCardGameCardInformation> >();
            _trick1        = new TwoPlayerTrickXF <EnumSuitList, SkuckCardGameCardInformation, ts, DeckOfCardsXF <SkuckCardGameCardInformation> >();
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer(nameof(SkuckCardGameMainViewModel.RestoreScreen));
            }
            _score.AddColumn("Strength", false, nameof(SkuckCardGamePlayerItem.StrengthHand));
            _score.AddColumn("Tie", false, nameof(SkuckCardGamePlayerItem.TieBreaker));
            _score.AddColumn("Bid", false, nameof(SkuckCardGamePlayerItem.BidAmount), visiblePath: nameof(SkuckCardGamePlayerItem.BidVisible));
            _score.AddColumn("Won", false, nameof(SkuckCardGamePlayerItem.TricksWon));
            _score.AddColumn("Cards", false, nameof(SkuckCardGamePlayerItem.ObjectCount));
            _score.AddColumn("P Rounds", false, nameof(SkuckCardGamePlayerItem.PerfectRounds));
            _score.AddColumn("T Score", false, nameof(SkuckCardGamePlayerItem.TotalScore));
            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Round", nameof(SkuckCardGameMainViewModel.RoundNumber));
            firstInfo.AddRow("Trump", nameof(SkuckCardGameMainViewModel.TrumpSuit)); //if trump is not needed, then comment.
            firstInfo.AddRow("Turn", nameof(SkuckCardGameMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(SkuckCardGameMainViewModel.Status));
            _playerHandWPF.Divider = 1.4;
            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            otherStack.Children.Add(_trick1);
            ParentSingleUIContainer parent = new ParentSingleUIContainer(nameof(SkuckCardGameMainViewModel.BidScreen));

            otherStack.Children.Add(parent);
            parent = new ParentSingleUIContainer(nameof(SkuckCardGameMainViewModel.SuitScreen));
            otherStack.Children.Add(parent);
            parent = new ParentSingleUIContainer(nameof(SkuckCardGameMainViewModel.ChoosePlayScreen));
            otherStack.Children.Add(parent);
            mainStack.Children.Add(otherStack);


            mainStack.Children.Add(_playerHandWPF);
            otherStack             = new StackLayout();
            otherStack.Orientation = StackOrientation.Horizontal;
            mainStack.Children.Add(otherStack);
            otherStack.Children.Add(_score);
            otherStack.Children.Add(firstInfo.GetContent);
            Grid finalGrid = new Grid();
            Grid tempGrid  = new Grid();

            AddLeftOverRow(tempGrid, 1);
            AddLeftOverRow(tempGrid, 1);
            AddLeftOverColumn(finalGrid, 1);
            AddAutoColumns(finalGrid, 1);
            AddControlToGrid(finalGrid, mainStack, 0, 0);
            AddControlToGrid(finalGrid, tempGrid, 0, 1);
            AddControlToGrid(tempGrid, _temp1, 0, 0);
            AddControlToGrid(tempGrid, _temp2, 1, 0);


            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.
            }

            GamePackageViewModelBinder.ManuelElements.Clear();                     //often times i have to add manually.

            SkuckCardGameSaveInfo save = cons !.Resolve <SkuckCardGameSaveInfo>(); //usually needs this part for multiplayer games.

            _score !.LoadLists(save.PlayerList);
            _playerHandWPF !.LoadList(_model.PlayerHand1 !, ts.TagUsed); // i think
            _trick1 !.Init(_model.TrickArea1 !, ts.TagUsed);
            SkuckCardGamePlayerItem selfPlayer  = _gameContainer.PlayerList !.GetSelf();
            SkuckCardGamePlayerItem otherPlayer = _gameContainer.PlayerList.GetOnlyOpponent();

            _temp1.LoadList(selfPlayer.TempHand !);
            _temp2.LoadList(otherPlayer.TempHand !);

            Content = finalGrid;
        }
예제 #6
0
 public TrumpProcesses(SkuckCardGameVMData model, SkuckCardGameGameContainer gameContainer)
 {
     _model         = model;
     _gameContainer = gameContainer;
 }
 public PlayChoiceProcesses(SkuckCardGameGameContainer gameContainer)
 {
     _gameContainer = gameContainer;
 }
        public SkuckCardGameMainView(IEventAggregator aggregator,
                                     TestOptions test,
                                     SkuckCardGameVMData model,
                                     SkuckCardGameGameContainer gameContainer
                                     )
        {
            _aggregator    = aggregator;
            _model         = model;
            _gameContainer = gameContainer;
            _aggregator.Subscribe(this);

            _score         = new ScoreBoardWPF();
            _playerHandWPF = new BaseHandWPF <SkuckCardGameCardInformation, ts, DeckOfCardsWPF <SkuckCardGameCardInformation> >();

            _trick1 = new TwoPlayerTrickWPF <EnumSuitList, SkuckCardGameCardInformation, ts, DeckOfCardsWPF <SkuckCardGameCardInformation> >();

            _playerHandWPF.Divider = 1.2;
            StackPanel mainStack             = new StackPanel();
            ParentSingleUIContainer?restoreP = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer()
                {
                    Name = nameof(SkuckCardGameMainViewModel.RestoreScreen)
                };
            }

            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            otherStack.Children.Add(_trick1);
            ParentSingleUIContainer parent = new ParentSingleUIContainer()
            {
                Name = nameof(SkuckCardGameMainViewModel.BidScreen)
            };

            otherStack.Children.Add(parent);
            parent = new ParentSingleUIContainer()
            {
                Name = nameof(SkuckCardGameMainViewModel.SuitScreen)
            };
            otherStack.Children.Add(parent);
            parent = new ParentSingleUIContainer()
            {
                Name = nameof(SkuckCardGameMainViewModel.ChoosePlayScreen)
            };
            otherStack.Children.Add(parent);
            mainStack.Children.Add(otherStack);
            _score.AddColumn("Strength Hand", false, nameof(SkuckCardGamePlayerItem.StrengthHand));
            _score.AddColumn("Tie Breaker", false, nameof(SkuckCardGamePlayerItem.TieBreaker));
            _score.AddColumn("Bid Amount", false, nameof(SkuckCardGamePlayerItem.BidAmount), visiblePath: nameof(SkuckCardGamePlayerItem.BidVisible));
            _score.AddColumn("Tricks Taken", false, nameof(SkuckCardGamePlayerItem.TricksWon));
            _score.AddColumn("Cards In Hand", false, nameof(SkuckCardGamePlayerItem.ObjectCount));
            _score.AddColumn("Perfect Rounds", false, nameof(SkuckCardGamePlayerItem.PerfectRounds));
            _score.AddColumn("Total Score", false, nameof(SkuckCardGamePlayerItem.TotalScore));
            SimpleLabelGrid firstInfo = new SimpleLabelGrid();

            firstInfo.AddRow("Round", nameof(SkuckCardGameMainViewModel.RoundNumber));
            firstInfo.AddRow("Trump", nameof(SkuckCardGameMainViewModel.TrumpSuit)); //if trump is not needed, then comment.
            firstInfo.AddRow("Turn", nameof(SkuckCardGameMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(SkuckCardGameMainViewModel.Status));
            mainStack.Children.Add(_playerHandWPF);
            otherStack             = new StackPanel();
            otherStack.Orientation = Orientation.Horizontal;
            mainStack.Children.Add(otherStack);
            otherStack.Children.Add(_score);
            otherStack.Children.Add(firstInfo.GetContent);
            Grid finalGrid = new Grid();
            Grid tempGrid  = new Grid();

            AddLeftOverRow(tempGrid, 1);
            AddLeftOverRow(tempGrid, 1);
            AddLeftOverColumn(finalGrid, 1);
            AddAutoColumns(finalGrid, 1);
            AddControlToGrid(finalGrid, mainStack, 0, 0);
            AddControlToGrid(finalGrid, tempGrid, 0, 1);
            AddControlToGrid(tempGrid, _temp1, 0, 0);
            AddControlToGrid(tempGrid, _temp2, 1, 0);


            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;
        }