public void Play(Player p, Supply s) { //Player gains the first two treasures var discards = new List<Card>(); int numTreasuresAdded = 0; Card card; do { card = p.PopDeck(); if (card is ITreasureCard) { numTreasuresAdded++; p.PutInHand(card); } else { discards.Add(card); } } while (numTreasuresAdded < 2 && card != null); foreach (Card c in discards) { p.Gain(c); } }
public GameState GetState(Player p, Supply s) { if (p.GetHandCards().Count == 0) { return ActionState.NextState(p, s); } else { return new CellarGameState(p, s); } }
public Game() { player = new Player(); supply = new Supply(); for(int i =0; i < 7; i++) { player.Gain( supply.Release("Copper")); } Card e = new Estate(); for(int i =0; i < 3; i++) { player.Gain( e ); } gameState = new GameStateContext(player, supply); gameState.StateChange += () => { OnStateChange(); }; player.NewHand(); }
public WorkshopGameState(Player p, Supply s) { player = p; supply = s; }
public void Play(Player p, Supply s) { }
public GameState GetState(Player p, Supply s) { return new WorkshopGameState(p, s); }
public void Play(Player p, Supply s) { p.NumBuys += 1; }
public void Play(Player p, Supply s) { p.ExpandHand(3); }
public CellarGameState(Player p, Supply s) { player = p; supply = s; discards = new List<Card>(); }
public void Play(Player p, Supply s) { p.NumActions += 1; }
public void Play(Player p, Supply s) { p.ExpandHand(1); p.NumActions += 1; p.NumBuys += 1; }