public void CardBytecode() { Card card1 = new TestCard(); Card card2 = new TestCard(); Card card3 = new TestCard(); bytes.push(LiteralFactory.CreateCardLiteral(card1.GetID())); bytes.push(LiteralFactory.CreateCardLiteral(card2.GetID())); bytes.push(LiteralFactory.CreateCardLiteral(card3.GetID())); Assert.AreEqual(card3.GetID(), bytes.ReadCardLiteral(dummyCallback)); Assert.AreEqual(card2.GetID(), bytes.ReadCardLiteral(dummyCallback)); Assert.AreEqual(card1.GetID(), bytes.ReadCardLiteral(dummyCallback)); }
public void MoveToDeck() { game.Cards = new CardManager(); Card c1 = new TestCard(); Card c2 = new TestCard(); Card c3 = new TestCard(); Card c4 = new TestCard(); game.Cards.Discard.AddCard(c1); game.Cards.Discard.AddCard(c2); game.Cards.Discard.AddCard(c3); game.Cards.Discard.AddCard(c4); bytes.push(InstructionFactory.Make_MoveToDeck( LiteralFactory.CreateCardLiteral(c1.GetID()), new List <byte> { (byte)DeckLocation.TOP } )); game.ExecuteNext(); Assert.AreSame(game.Cards.Deck.GetCard(DeckLocation.TOP), c1); bytes.push(InstructionFactory.Make_MoveToDeck( LiteralFactory.CreateCardLiteral(c2.GetID()), new List <byte> { (byte)DeckLocation.BOTTOM } )); game.ExecuteNext(); Assert.AreSame(game.Cards.Deck.GetCard(DeckLocation.BOTTOM), c2); bytes.push(InstructionFactory.Make_MoveToDeck( LiteralFactory.CreateCardLiteral(c3.GetID()), new List <byte> { (byte)DeckLocation.TOP } )); game.ExecuteNext(); Assert.AreSame(game.Cards.Deck.GetCard(DeckLocation.TOP), c3); bytes.push(InstructionFactory.Make_MoveToDeck( LiteralFactory.CreateCardLiteral(c4.GetID()), new List <byte> { (byte)DeckLocation.SHUFFLE } )); game.ExecuteNext(); Assert.IsNotNull(game.Cards.Deck.GetCard(c4.GetID())); }
public void MoveToDiscard() { game.Cards = new CardManager(); Card c1 = new TestCard(); Card c2 = new TestCard(); Card c3 = new TestCard(); Card c4 = new TestCard(); game.Cards.Deck.AddCard(c1); game.Cards.Deck.AddCard(c2); game.Cards.Deck.AddCard(c3); game.Cards.Deck.AddCard(c4); bytes.push(InstructionFactory.Make_MoveToDiscard( LiteralFactory.CreateCardLiteral(c1.GetID()) )); game.ExecuteNext(); Assert.IsNotNull(game.Cards.Discard.GetCard(c1.GetID())); bytes.push(InstructionFactory.Make_MoveToDiscard( LiteralFactory.CreateCardLiteral(c2.GetID()) )); game.ExecuteNext(); Assert.IsNotNull(game.Cards.Discard.GetCard(c2.GetID())); bytes.push(InstructionFactory.Make_MoveToDiscard( LiteralFactory.CreateCardLiteral(c3.GetID()) )); game.ExecuteNext(); Assert.IsNotNull(game.Cards.Discard.GetCard(c3.GetID())); bytes.push(InstructionFactory.Make_MoveToDiscard( LiteralFactory.CreateCardLiteral(c4.GetID()) )); game.ExecuteNext(); Assert.IsNotNull(game.Cards.Discard.GetCard(c4.GetID())); }