Esempio n. 1
0
 public void PutStone(Vector2D position)
 {
     this.Game          = Game.PutStone(position);
     this.Board         = Game.Board;
     this.CurrentPlayer = Game.CurrentPlayer;
     if (Game.IsGameOver)
     {
         PlayerViewModel winner = PlayerW;
         if (PlayerB.Score.Value > PlayerW.Score.Value)
         {
             winner = PlayerB;
         }
         SwitchTo(new GameOverViewModel(this.viewModel, Options, winner));
     }
 }
Esempio n. 2
0
        private void InitializeObject()
        {
            Pot           = 0;
            MinBet        = 50;
            StartCash     = 10000;
            _players      = new List <PlayerBaseViewModel>();
            _cardsOnTable = new List <Card>();

            FirstPlayer = new PlayerViewModel()
            {
                PlayerState = new PlayerState()
                {
                    Cash = StartCash, IsDealer = true, Name = "Игрок", IsSmallBlind = false, IsBigBlind = false, Number = 0
                },
                TableInfo = this
            };

            SecondPlayer = new AIViewModel()
            {
                PlayerState = new PlayerState()
                {
                    Cash = StartCash, IsDealer = false, Name = "Компьютер 1", IsSmallBlind = true, IsBigBlind = false, Number = 1
                },
                TableInfo = this
            };
            ThirdPlayer = new AIViewModel()
            {
                PlayerState = new PlayerState()
                {
                    Cash = StartCash, IsDealer = false, Name = "Компьютер 2", IsSmallBlind = false, IsBigBlind = true, Number = 2
                },
                TableInfo = this
            };
            FourthPlayer = new AIViewModel()
            {
                PlayerState = new PlayerState()
                {
                    Cash = StartCash, IsDealer = false, Name = "Компьютер 3", IsSmallBlind = false, IsBigBlind = false, Number = 3
                },
                TableInfo = this
            };
            FifthPlayer = new AIViewModel()
            {
                PlayerState = new PlayerState()
                {
                    Cash = StartCash, IsDealer = false, Name = "Компьютер 4", IsSmallBlind = false, IsBigBlind = false, Number = 4
                },
                TableInfo = this
            };
            SixthPlayer = new AIViewModel()
            {
                PlayerState = new PlayerState()
                {
                    Cash = StartCash, IsDealer = false, Name = "Компьютер 5", IsSmallBlind = false, IsBigBlind = false, Number = 5
                },
                TableInfo = this
            };
            _deck = new CardDeck();

            _players.Add(FirstPlayer);
            _players.Add(SecondPlayer);
            _players.Add(ThirdPlayer);
            _players.Add(FourthPlayer);
            _players.Add(FifthPlayer);
            _players.Add(SixthPlayer);
        }
Esempio n. 3
0
        public GameOverViewModel(MainViewModel model, PlayerOptionsViewModel options, PlayerViewModel winner) : base(model)
        {
            this.Options = options;
            this.Winner  = winner;
            Exit         = new ExitCommand(this.viewModel);

            Restart = new EasyCommand(() =>
            {
                WelcomeViewModel newGame = new WelcomeViewModel(this.viewModel);
                newGame.Options          = Options;
                SwitchTo(newGame);
            });
        }