Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel()
        {
            if (IsInDesignMode)
            {
                Card a = new Card(Shape.DIAMOND, Color.BLACK, 7, "/ImagePath/pink_7.jpg");
                Card b = new Card(Shape.DIAMOND, Color.BLACK, 6, "/ImagePath/pink_6.jpg");


                CardsViewModel cards = new CardsViewModel();
                hand = cards.Hand2;
            }
            else
            {
                Card a = new Card(Shape.DIAMOND, Color.BLACK, 7, "/ImagePath/pink_7.jpg");
                Card b = new Card(Shape.DIAMOND, Color.BLACK, 6, "/ImagePath/pink_6.jpg");

                CardsViewModel cards = new CardsViewModel();
                hand = cards.Hand2;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel()
        {
            if (IsInDesignMode)
            {
                Card a = new Card(Shape.DIAMOND, Color.BLACK, 7, "/ImagePath/pink_7.jpg");
                Card b = new Card(Shape.DIAMOND, Color.BLACK, 6, "/ImagePath/pink_6.jpg");

                CardsViewModel cards = new CardsViewModel();
                hand = cards.Hand2;

            }
            else
            {
                Card a = new Card(Shape.DIAMOND, Color.BLACK, 7, "/ImagePath/pink_7.jpg");
                Card b = new Card(Shape.DIAMOND, Color.BLACK, 6, "/ImagePath/pink_6.jpg");

                CardsViewModel cards = new CardsViewModel();
                hand = cards.Hand2;

            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// GEt players's card
        /// </summary>
        /// <summary>
        /// GEt card for player with passed id
        /// </summary>
        private CardsViewModel GetCards(int playerId)
        {
            CardsViewModel playersCard = new CardsViewModel();
            List<Card> playerCard = _currentGame.GetPlayersCard(playerId);
            ObservableCollection<CardViewModel> playersHand = new ObservableCollection<CardViewModel>();
            foreach (Card p in playerCard)
            {
                playersHand.Add(new CardViewModel(p));

            }
            playersCard.Hand2 = playersHand;
            return playersCard;
        }