예제 #1
0
        protected override ISantaseGame CreateGame()
        {
            IPlayer      firstPlayer  = new SmartPlayer();                          // new PlayerWithLoggerDecorator(new SmartPlayer(), new ConsoleLogger("[-]"))
            IPlayer      secondPlayer = new BotskoPlayer();
            ISantaseGame game         = new SantaseGame(firstPlayer, secondPlayer); // new ConsoleLogger("[game] "));

            return(game);
        }
예제 #2
0
        public MainPage()
        {
            this.InitializeComponent();

            if (AnalyticsInfo.VersionInfo.DeviceFamily == "Windows.Desktop")
            {
                this.AdRow.Height = new GridLength(90);
                this.AdMediator_2D55AF.Height = 90;
                this.AdMediator_2D55AF.Width = 768;
            }
            else
            {
                this.AdRow.Height = new GridLength(80);
                this.AdMediator_2D55AF.Height = 80;
                this.AdMediator_2D55AF.Width = 480;
            }

            this.playerCardControls = new[]
                                          {
                                              this.PlayerCard1, this.PlayerCard2, this.PlayerCard3,
                                              this.PlayerCard4, this.PlayerCard5, this.PlayerCard6
                                          };

            this.uiPlayer = new UiPlayer();
            this.uiPlayer.RedrawCards += this.UiPlayerRedrawCards;
            this.uiPlayer.RedrawTrumpCard += this.UiPlayerRedrawTrumpCard;
            this.uiPlayer.RedrawNumberOfCardsLeftInDeck += this.UiPlayerOnRedrawNumberOfCardsLeftInDeck;
            this.uiPlayer.RedrawPlayerPlayedCard += this.UiPlayerOnRedrawPlayerPlayedCard;
            this.uiPlayer.RedrawOtherPlayerPlayedCard += this.UiPlayerOnRedrawOtherPlayerPlayedCard;
            this.uiPlayer.RedrawCurrentAndOtherPlayerRoundPoints +=
                this.UiPlayerOnRedrawCurrentAndOtherPlayerRoundPoints;
            this.uiPlayer.RedrawCurrentAndOtherPlayerTotalPoints +=
                this.UiPlayerOnRedrawCurrentAndOtherPlayerTotalPoints;
            this.uiPlayer.RedrawPlayedCards += this.UiPlayerOnRedrawPlayedCards;
            this.uiPlayer.GameClosed += this.UiPlayerOnGameClosed;
            this.uiPlayer.GameEnded += this.UiPlayerOnGameEnded;

            IPlayer smartPlayer = new BotskoPlayer();
            this.game = new SantaseGame(this.uiPlayer, smartPlayer);

            this.PlayerCard.Transparent();
            this.OldPlayerCard.Transparent();
            this.OtherPlayerCard.Transparent();
            this.OldOtherPlayerCard.Transparent();

            Task.Run(() => this.game.Start());
        }