Exemplo n.º 1
0
 public Turn(Trader trader, DrawPile drawPile, DiscardPile discardPile, Trader receivingTrader)
 {
     this.trader = trader;
     this.drawPile = drawPile;
     this.discardPile = discardPile;
     this.receivingTrader = receivingTrader;
 }
Exemplo n.º 2
0
        public PlayTurnsGamePart(IEnumerable<Trader> traders, DiscardPile discardPile, DrawPile drawPile)
        {
            this.discardPile = discardPile;
            this.drawPile = drawPile;

            this.traders = traders.ToArray();
        }
Exemplo n.º 3
0
 public void ShouldBeAbleToDrawSingleBean()
 {
     var drawPile = new DrawPile(new DiscardPile());
     var bean1 = new Bean(1, Suit.Blue);
     var bean2 = new Bean(2, Suit.Green);
     drawPile.AddBeans(new[] {bean1, bean2});
     Assert.AreEqual(new[] {bean1}, drawPile.Draw(1));
 }
Exemplo n.º 4
0
        public SpaceBeansGamePart(SpaceBeansGameSetup setup)
        {
            setup.Validate();

            discardPile = new DiscardPile();
            drawPile = new DrawPile(discardPile);
            traders = setup.GetTraders();
        }
Exemplo n.º 5
0
 public void ShouldBeAbleToDrawMultipleBeans()
 {
     var drawPile = new DrawPile(new DiscardPile());
     var bean1 = new Bean(1, Suit.Blue);
     var bean2 = new Bean(2, Suit.Green);
     var bean3 = new Bean(3, Suit.Red);
     drawPile.AddBeans(new[] { bean1, bean2, bean3 });
     Assert.AreEqual(new [] {bean1, bean2}, drawPile.Draw(2));
 }
Exemplo n.º 6
0
 public void ShouldReshuffleIfDrawingMoreCardsThanAvailable()
 {
     var discardPile = new DiscardPile();
     var drawPile = new DrawPile(discardPile);
     var bean1 = new Bean(1, Suit.Blue);
     drawPile.AddBeans(new[] { bean1 });
     var bean2 = new Bean(4, Suit.Orange);
     var bean3 = new Bean(5, Suit.Purple);
     discardPile.DiscardBeans(new[] { bean2, bean3, });
     Assert.AreEqual(new[] { bean1, bean2 }, drawPile.Draw(2));
     Assert.AreEqual(0, discardPile.Count);
 }
Exemplo n.º 7
0
 public void ShouldNotReshuffleIfDrawingFewerCardsThanAvailable()
 {
     var discardPile = new DiscardPile();
     var drawPile = new DrawPile(discardPile);
     var bean1 = new Bean(1, Suit.Blue);
     var bean2 = new Bean(2, Suit.Green);
     var bean3 = new Bean(3, Suit.Red);
     drawPile.AddBeans(new[] { bean1, bean2, bean3 });
     discardPile.DiscardBeans(new[] { new Bean(4, Suit.Orange), new Bean(5, Suit.Purple), });
     Assert.AreEqual(new[] { bean1, bean2 }, drawPile.Draw(2));
     Assert.AreEqual(2, discardPile.Count);
 }
Exemplo n.º 8
0
 public GameSetupPart(DrawPile drawPile)
 {
     this.drawPile = drawPile;
 }
Exemplo n.º 9
0
 public DrawPhase(Trader trader, DrawPile drawPile)
 {
     this.trader = trader;
     this.drawPile = drawPile;
 }