Exemple #1
0
 public Turn(Player owner)
 {
     Owner = owner;
     Possessor = null;
     IsRepeatable = true;
     ActionsRemaining = BuysRemaining = 1;
     TreasureRemaining = 0;
     Phase = Phases.Action;
     CardsInPlay = new List<Card>();
     CardsPlayed = new List<Card>();
     TurnNumber = 1;
 }
Exemple #2
0
 /// <summary>
 /// The targeted player reveals a card
 /// </summary>
 /// <param name="revealer">The player revealing the card</param>
 /// <param name="card">The card being revealed</param>
 public void RevealCard(Player revealer, Card card)
 {
     _game.NotifyPlayers(p => p.OnRevealCard(revealer, card));
 }
Exemple #3
0
        /// <summary>
        /// The targeted player puts a card on top of his deck
        /// </summary>
        /// <param name="target"></param>
        /// <param name="card"></param>
        public void PutCardOnDeck(Player target, Card card)
        {
            _game.NotifyPlayers(
                p => p.OnPutCardOnDeck(target, card),
                p => p.OnPutCardOnDeckNotVisible(target));

            target.Deck.AddToTop(card);
        }
Exemple #4
0
        /// <summary>
        /// The targeted player gains a card
        /// </summary>
        /// <param name="target">The player gaining the card</param>
        /// <param name="code">The card being gained</param>
        /// <returns></returns>
        public Card GainCard(Player target, CardCode code)
        {
            if (!Supplies.HasSupply(code))
                throw new ArgumentOutOfRangeException("Supply piles do not include " + code.ToString());

            Card retval = null;
            CardContainer pile = Supplies[code];

            if (pile.Count > 0)
            {
                retval = pile.Draw();
            }

            _game.NotifyPlayers(p => p.OnGainCard(target, code));
            return retval;
        }
Exemple #5
0
 /// <summary>
 /// Signals when a player puts a card on his/her deck
 /// </summary>
 /// <param name="player">The player moving the card to his deck</param>
 /// <param name="cardOnDeck">The card being moved</param>
 public abstract void OnPutCardOnDeck(Player player, Card cardOnDeck);
Exemple #6
0
 /// <summary>
 /// Signals when a Possession turn starts
 /// </summary>
 /// <param name="possessingPlayer">The player who is doing the possessing</param>
 /// <param name="possessedPlayer">The possessed</param>
 public abstract void OnPossessedTurnStart(Player possessingPlayer, Player possessedPlayer);
Exemple #7
0
 public Turn(Player owner, Player possessor, bool isRepeatable = false)
     : this(owner)
 {
     Possessor = possessor;
     IsRepeatable = isRepeatable;
 }
Exemple #8
0
 /// <summary>
 /// Indicated player draws cards from his own deck
 /// </summary>
 /// <param name="p"></param>
 /// <param name="count"></param>
 /// <returns></returns>
 public IList<Card> DrawCards(Player drawer, int count = 1)
 {
     return DrawCards(drawer, drawer.Deck, count);
 }
Exemple #9
0
 /// <summary>
 /// Signals when a player has drawn some cards
 /// </summary>
 /// <param name="drawingPlayer">The player drawing the cards</param>
 /// <param name="drawnCards">The cards drawn</param>
 public abstract void OnDrawCards(Player drawingPlayer, IList<Card> drawnCards);
Exemple #10
0
 /// <summary>
 /// Signals when a new turn starts
 /// </summary>
 /// <param name="activePlayer">The player who's turn it now is</param>
 public abstract void OnTurnStart(Player activePlayer);
Exemple #11
0
 /// <summary>
 /// Signals when a turn ends.
 /// </summary>
 /// <param name="activePlayer">The player who's turn just ended</param>
 public abstract void OnTurnEnd(Player activePlayer);
Exemple #12
0
 /// <summary>
 /// Signals when a player shuffles his deck
 /// </summary>
 /// <param name="shuffler">The player doing the shuffling</param>
 public abstract void OnShuffleDeck(Player shuffler);
Exemple #13
0
 /// <summary>
 /// Signals when a player reveals his/her hand
 /// </summary>
 /// <param name="revealingPlayer">The revealing player</param>
 /// <param name="revealedCards">The revealed cards</param>
 public abstract void OnRevealHand(Player revealingPlayer, IList<Card> revealedCards);
Exemple #14
0
 /// <summary>
 /// Signals when a player reveals a card
 /// </summary>
 /// <param name="revealingPlayer">The revealing player</param>
 /// <param name="revealedCard">The card revealed</param>
 public abstract void OnRevealCard(Player revealingPlayer, Card revealedCard);
Exemple #15
0
 /// <summary>
 /// Signals when a player puts a card on his/her deck but that card is not visible
 /// </summary>
 /// <param name="player"></param>
 public abstract void OnPutCardOnDeckNotVisible(Player player);
Exemple #16
0
 /// <summary>
 /// The targeted player reveals his hand
 /// </summary>
 /// <param name="target">The hand revealer</param>
 public void RevealHand(Player target)
 {
     _game.NotifyPlayers(p=> p.OnRevealHand(target, target.Hand.ToList()));
 }
Exemple #17
0
 /// <summary>
 /// The targeted player shuffles his deck
 /// </summary>
 /// <param name="target">The deck shuffler</param>
 public void ShuffleDeck(Player target)
 {
     target.Deck.Shuffle();
     _game.NotifyPlayers(p => p.OnShuffleDeck(target));
 }
Exemple #18
0
 /// <summary>
 /// Signals when a player has drawn some cards, but those cards are not visible
 /// </summary>
 /// <param name="drawingPlayer"></param>
 /// <param name="count"></param>
 public abstract void OnDrawCardsNotVisible(Player drawingPlayer, int count);
Exemple #19
0
 public IList<Card> DrawCards(Player drawer, CardContainer deck, int count = 1)
 {
     IList<Card> retval = deck.Draw(count);
     _game.NotifyPlayers(
         p => p.OnDrawCards(drawer, retval),
         p => p.OnDrawCardsNotVisible(drawer, count));
     return retval;
 }
Exemple #20
0
 /// <summary>
 /// Signals when a player gains a card
 /// </summary>
 /// <param name="gainingPlayer">The player gaining the card</param>
 /// <param name="gainedCardCode">The card code gained</param>
 public abstract void OnGainCard(Player gainingPlayer, CardCode gainedCardCode);