Ejemplo n.º 1
0
        public void Init()
        {
            horizontalColumnSeparation = (int)imageDimensions.X + 10;
            verticalCardSeparation = 15;
            this.deckPilePosition = new Vector2(15, 15);
            this.firstColumnPosition = new Vector2(deckPilePosition.X, deckPilePosition.Y + imageDimensions.Y + 30);
            this.firstAcePosition = new Vector2(deckPilePosition.X + imageDimensions.X + 150, deckPilePosition.Y);
            this.shuffledDeck = new Pile(this, "queue");
            this.shuffledDeck.rectPos = new Rectangle((int)deckPilePosition.X, (int)deckPilePosition.Y, (int)imageDimensions.X, (int)imageDimensions.Y);
            visibleCards = new Collection<Card>();
            columns = new Pile[7];
            aces = new Pile[4];
            for (int i = 0; i < 7; i++) {
                if (i == 0) {
                    columns[i] = new Pile(this, 1, new Rectangle((int)firstColumnPosition.X, (int)firstColumnPosition.Y, (int)imageDimensions.X, 0));
                }
                else {
                    columns[i] = new Pile(this, i + 1, new Rectangle((columns[i - 1].rectPos.X + horizontalColumnSeparation), columns[i - 1].rectPos.Y, columns[i - 1].rectPos.Width, columns[i - 1].rectPos.Height));
                }
            }

            for (int i = 0; i < 4; i++) {
                if (i == 0) {
                    aces[i] = new Pile(this, new Rectangle((int)firstAcePosition.X, (int)firstAcePosition.Y, (int)imageDimensions.X, 0));
                }
                else {
                    aces[i] = new Pile(this, new Rectangle((aces[i - 1].rectPos.X + horizontalColumnSeparation), aces[i - 1].rectPos.Y, aces[i - 1].rectPos.Width, aces[i - 1].rectPos.Height));
                }
            }
            this.currentCards = new Pile(this, 3, new Rectangle((int)deckPilePosition.X + horizontalColumnSeparation, (int)deckPilePosition.Y, (int)imageDimensions.X * 2, (int)imageDimensions.Y));
            this.ShuffleDeck();
        }
Ejemplo n.º 2
0
 public void Setup()
 {
     _pile = new Pile();
 }
Ejemplo n.º 3
0
 public void Pile_NewPile_IsEmpty()
 {
     var pile = new Pile();
      Assert.IsTrue( pile.IsEmpty() );
 }