示例#1
0
 public CardView(CardView card)
 {
     _cardData = card.Data;
     _cardFace = card.Face;
     Init();
     this.SetOrientationAsync(card.Orientation, 2);
     this.Selected = card.Selected;
 }
示例#2
0
        public CardView(VectorCard card, CardData cardData, CardOrientation orientation)
        {
            Init();

            _cardFace = card;
            _cardData = cardData;
            _canvasFrontOfCard.Children.Clear(); // pull the AceOfClubs that is there for design purposes
            _canvasFrontOfCard.Children.Add(_cardFace.Canvas);
            _cardFace.Canvas.Width  = CARD_WIDTH;
            _cardFace.Canvas.Height = CARD_HEIGHT;
            _orientation            = orientation;

            Reset();
        }
示例#3
0
 public void Init()
 {
     for (int n = _grid.Children.Count - 4; n >= 0; n--)
     {
         VectorCard v = new VectorCard(((Canvas)_grid.Children[n]), n, (CardNames)n);
         _grid.Children.RemoveAt(n);
         Suit     suit = ((Suit)(int)(n / 13));
         int      rank = (int)(n % 13) + 1;
         int      val  = (rank < 10) ? rank : 10;
         CardData data = new CardData((CardNames)n, Owner.Shared, rank, val, n, suit);
         CardView view = new CardView(v, data, CardOrientation.FaceDown);
         _cards.Insert(0, view);
     }
 }