private void PlayCard(int index) { var card = Hand.GetAt(index); if (card == null) { return; } var lastPlayedCard = LocationPile.Cards.LastOrDefault(); if (lastPlayedCard != null && card.Suit == lastPlayedCard.Suit) { return; } Hand.RemoveAt(index); LocationPile.Add(card); if (LocationPile.CheckDoorUnlocked()) { var door = Deck.FindDoor(lastPlayedCard.Color); if (door != null) { DoorPile.Add(door); } bool win; if (CheckGameOver(out win)) { return; } } DrawUp(); }
public OnirimGame() { DiscardPile = new DiscardPile(); LocationPile = new LocationPile(); LimboPile = new LimboPile(); DoorPile = new DoorPile(); Hand = new Hand(); Deck = new Deck(); }
private void Print() { Console.Clear(); DiscardPile.Print(); LimboPile.Print(); DoorPile.Print(); LocationPile.Print(); Hand.Print(); Deck.Print(); }
public MoveCardEvent(Card card, LocationPile pile) : this(card, new Location(pile, card.owner.side)) { }
public MoveTo(TargetRule t, LocationPile pile) : base(t) { this.pile = pile; }
public MoveToCost(LocationPile from, LocationPile to, int cardsToMove) { this.to = to; this.from = from; this.cardsToMove = cardsToMove; }
public MoveThisCost(LocationPile from, LocationPile to, int cardsToMove, Card sacMe) : base(from, to, cardsToMove) { this.sacMe = sacMe; }
public Pile getPile(LocationPile p) { return piles[(int)p]; }