コード例 #1
0
        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();
        }
コード例 #2
0
 public OnirimGame()
 {
     DiscardPile  = new DiscardPile();
     LocationPile = new LocationPile();
     LimboPile    = new LimboPile();
     DoorPile     = new DoorPile();
     Hand         = new Hand();
     Deck         = new Deck();
 }
コード例 #3
0
 private void Print()
 {
     Console.Clear();
     DiscardPile.Print();
     LimboPile.Print();
     DoorPile.Print();
     LocationPile.Print();
     Hand.Print();
     Deck.Print();
 }
コード例 #4
0
ファイル: GameEvent.cs プロジェクト: shtonki/cardstone
 public MoveCardEvent(Card card, LocationPile pile)
     : this(card, new Location(pile, card.owner.side))
 {
 }
コード例 #5
0
ファイル: Effect.cs プロジェクト: shtonki/cardstone
 public MoveTo(TargetRule t, LocationPile pile)
     : base(t)
 {
     this.pile = pile;
 }
コード例 #6
0
ファイル: Cost.cs プロジェクト: shtonki/cardstone
 public MoveToCost(LocationPile from, LocationPile to, int cardsToMove)
 {
     this.to = to;
     this.from = from;
     this.cardsToMove = cardsToMove;
 }
コード例 #7
0
ファイル: Cost.cs プロジェクト: shtonki/cardstone
 public MoveThisCost(LocationPile from, LocationPile to, int cardsToMove, Card sacMe)
     : base(from, to, cardsToMove)
 {
     this.sacMe = sacMe;
 }
コード例 #8
0
ファイル: Player.cs プロジェクト: shtonki/cardstone
 public Pile getPile(LocationPile p)
 {
     return piles[(int)p];
 }