public void SendMessage(Player player, Cards.Card sourceCard, Currency currency) { if (GameMessage != null) { GameMessageEventArgs gmea = new GameMessageEventArgs(player, sourceCard, currency); GameMessage(this, gmea); } }
public void SendMessage(Player player, Cards.Card sourceCard, ICard card, int count) { if (GameMessage != null) { GameMessageEventArgs gmea = new GameMessageEventArgs(player, sourceCard, card, count); GameMessage(this, gmea); } }
public void SendMessage(Player player, Player playerAffected, Cards.Card sourceCard, ICard card) { if (GameMessage != null) { GameMessageEventArgs gmea = new GameMessageEventArgs(player, playerAffected, sourceCard, card); GameMessage(this, gmea); } }
/// <summary> /// Returns True if the card is allowed to be in the game /// </summary> /// <param name="c"></param> /// <returns></returns> private bool IsCardAllowed(Cards.Card card) { if (card.Location == Cards.Location.Kingdom) { return(true); } return(false); }
public Supply FindSupplyPileByCard(Cards.Card card) { if (this.Supplies.ContainsKey(card)) { return(this.Supplies[card]); } SupplyCollection sc = this.Supplies.FindAll(s => s.TopCard != null && s.TopCard.Name == card.Name); if (sc.Count == 1) { return(sc.ElementAt(0).Value); } return(null); }
internal Cards.Card GetNewCardPile(Func <Cards.Card, Boolean> predicate) { IEnumerable <Cards.Card> matchingCards = this.CardsAvailable.Where(predicate); if (matchingCards.Count() == 0) { throw new GameCreationException("Cannot satisfy specified constraints! Please double-check and make sure it's possible to construct a Kingdom card setup with the constraints specified"); } int index; // For some reason, Random.Next() actually sometimes returns the end point as an option -- Why? That seems really wrong. do { index = _RNG.Next(matchingCards.Count()); }while (index == matchingCards.Count()); Cards.Card toReturn = matchingCards.ElementAt(index); this.CardsAvailable.Remove(toReturn); return(toReturn); }
public Supply this[Cards.Card card] { get { return(_SupplyPiles[card]); } }
public GamePlayMessage(Player player, Cards.Card card) : this(null, player, card) { }
public GameMessageEventArgs(Player player, Player playerAffected, Cards.Card sourceCard, ICard card) : this(player, sourceCard, card) { this.AffectedPlayer = playerAffected; }
public GameMessageEventArgs(Player player, Cards.Card sourceCard, Currency currency) : this(player, sourceCard) { this.Currency = currency; }
public GameMessageEventArgs(Player player, Cards.Card sourceCard, ICard card, int count) : this(player, sourceCard, card) { this.Count = count; }
public GameMessageEventArgs(Player player, Cards.Card sourceCard, ICard card1, ICard card2) : this(player, sourceCard) { this.Card1 = card1; this.Card2 = card2; }
public GameMessageEventArgs(Player player, Cards.Card sourceCard) { this.Player = player; this.SourceCard = sourceCard; }
public GameUndoPlayMessage(WaitCallback waitCallback, Player player, Cards.Card card) : base(waitCallback) { this.Player = player; this.Card = card; }
public GamePlayMessage(WaitCallback waitCallback, Player player, Cards.Card card) : base(waitCallback) { Player = player; Card = card; }