using DominionBase.Cards; using DominionBase.Enums; using DominionBase.Piles; using DominionBase.Players; using DominionBase.Players.PlayerMessages; using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Threading; using System.Xml; namespace DominionBase { public interface IPlayer { #region Events event AttackedEventHandler Attacked; event BenefitReceivingInitiatedEventHandler BenefitReceivingInitiated; event BenefitReceivingEventHandler BenefitReceiving; event BenefitsChangedEventHandler BenefitsChanged; event BoonsChangedEventHandler BoonsChanged; event CalledFinishedEventHandler CalledFinished; event CallingEventHandler Calling; event CardBoughtEventHandler CardBought; event CardBuyFinishedEventHandler CardBuyFinished; event CardBuyingEventHandler CardBuying; event CardFlippedOverEventHandler CardFlippedOver; event CardFollowingInstructionsEventHandler CardFollowingInstructions; event CardGainedEventHandler CardGained; event CardGainedIntoEventHandler CardGainedInto; event CardGainFinishedEventHandler CardGainFinished; event CardGainingEventHandler CardGaining; event CardPayingEventHandler CardPaying; event CardPlayedEventHandler CardPlayed; event CardPlayFinishedEventHandler CardPlayFinished; event CardPlayingEventHandler CardPlaying; event CardPutIntoPlayEventHandler CardPutIntoPlay; event CardReceivedEventHandler CardReceived; event CardResolvingEventHandler CardResolving; event CardsAddedToDeckEventHandler CardsAddedToDeck; event CardsAddedToHandEventHandler CardsAddedToHand; event CardsDiscardedEventHandler CardsDiscarded; event CardsDiscardingEventHandler CardsDiscarding; event CardsDrawnEventHandler CardsDrawn; event CardUndoPlayedEventHandler CardUndoPlayed; event CardUndoPlayingEventHandler CardUndoPlaying; event CleanedUpEventHandler CleanedUp; event CleaningUpEventHandler CleaningUp; event DrawingCardsEventHandler DrawingCards; event DrawNewHandEventHandler DrawNewHand; event PhaseChangedEventHandler PhaseChanged; event PhaseChangedFinishedEventHandler PhaseChangedFinished; event PhaseChangingEventHandler PhaseChanging; event PlayerModeChangedEventHandler PlayerModeChanged; event ShuffledEventHandler Shuffled; event ShufflingEventHandler Shuffling; event ShufflingStartEventHandler ShufflingStart; event TakeablesChangedEventHandler TakeablesChanged; event Token.TokenActionEventHandler TokenActedOn; event TokenPlayedEventHandler TokenPlayed; event TokenPlayingEventHandler TokenPlaying; event TrashedEventHandler Trashed; event TrashedFinishedEventHandler TrashedFinished; event TrashingEventHandler Trashing; event TurnEndedEventHandler TurnEnded; event TurnStartedEventHandler TurnStarted; event TurnStartingEventHandler TurnStarting; #endregion #region Properties IGame _Game { get; } int Actions { get; set; } uint ActionsPlayed { get; } int Buys { get; } bool CanDraw { get; } Choose Choose { get; set; } int Coffers { get; } Currency Currency { get; } Turn CurrentTurn { get; } Deck DiscardPile { get; } Deck DrawPile { get; } PointsCollection EndgamePile { get; } Deck Hand { get; } Deck InPlay { get; } DeckCollection InPlayAndSetAside { get; } ConcurrentQueue MessageRequestQueue { get; } ConcurrentQueue MessageResponseQueue { get; } string Name { get; } PhaseEnum Phase { get; } CardMats PlayerMats { get; } PlayerMode PlayerMode { get; } PlayerType PlayerType { get; } Deck Private { get; } Deck Revealed { get; } Deck SetAside { get; } ItemCollection Takeables { get; } ItemCollection TakenBoons { get; } TokenCollections TokenPiles { get; } Guid UniqueId { get; } int VictoryPoints { get; } int Villagers { get; } AutoResetEvent WaitEvent { get; } #endregion #region Methods void ActionPlayed(); void AddCardInto(DeckLocation location, Card card, DeckPosition position = DeckPosition.Automatic); void AddCardInto(Type deckType, Card card, DeckPosition position = DeckPosition.Automatic); void AddCardToDeck(Card card, DeckPosition deckPosition); void AddCardToHand(Card card); void AddCardsInto(DeckLocation location, IEnumerable cards, DeckPosition position = DeckPosition.Automatic); void AddCardsInto(Type deckType, IEnumerable cards, DeckPosition position = DeckPosition.Automatic); void AddCardsToDeck(IEnumerable cards, DeckPosition deckPosition); void AddCardsToHand(DeckLocation location); void AddCardsToHand(IEnumerable cards); void AddToken(Token token); void AddTokens(TokenCollection tokens); bool AttackedByPlayerAllowed(IPlayer attacker, Card attackingCard); void BeginDrawing(); bool Buy(IBuyable supply); void Call(Card card); void Cleanup(); void Clear(); int CountAll(IPlayer fromPlayer = null, Predicate predicate = null, bool onlyObtainable = true, bool onlyCurrentlyDrawable = false); int CountVictoryPoints(); Card Discard(DeckLocation fromLocation); Card Discard(DeckLocation fromLocation, Card card); ItemCollection Discard(DeckLocation fromLocation, int count); ItemCollection Discard(DeckLocation fromLocation, IEnumerable cards, CardsDiscardResolver discardAction = null); ItemCollection Discard(DeckLocation fromLocation, Predicate match, CardsDiscardResolver discardAction = null); ItemCollection Discard(DeckLocation fromLocation, Type matType, Predicate match, int count = -1, CardsDiscardResolver discardAction = null); ItemCollection Discard(DeckLocation fromLocation, Type type, int count); void DiscardHand(bool visible); void DiscardRevealed(); void DiscardRevealed(Predicate match); void DoneWithActionTreasurePhase(); Card Draw(DeckLocation destination); ItemCollection Draw(int number, DeckLocation destination); Card Draw(Type deckType); ItemCollection DrawFrom(DeckPosition deckPosition, int number, object destination); ItemCollection DrawHand(int number); void End(); void EndDrawing(); void EndTurn(); void FinalizeDeck(); Facing FlipFaceDown(ICard card); Facing FlipFaceUp(ICard card); Facing FlipOver(ICard card); bool Gain(ISupply supply, IGameObject source, DeckLocation location, DeckPosition position = DeckPosition.Automatic, int count = 1, bool isBought = false); bool Gain(ISupply supply, IGameObject source, int count = 1, bool isBought = false); bool Gain(ISupply supply, Type type, IGameObject source, DeckLocation location, DeckPosition position = DeckPosition.Automatic, bool isBought = false); bool Gain(Trash trash, Card card, IGameObject source, DeckLocation location = DeckLocation.Discard, DeckPosition position = DeckPosition.Automatic); XmlNode GenerateXml(XmlDocument doc); IEnumerable GetEnumeratorIPoints(bool onlyObtainable = false); void GoToActionPhase(); void GoToActionTreasurePhase(); void GoToBuyPhase(); void GoToBuyTreasurePhase(); void GoToNextPhase(); void GoToNightPhase(); void IterateAll(Action action, Predicate predicate = null); bool KeepBoon(IBoonSupply boonSupply, IBoon boon); void Lose(Card card); void Lose(ItemCollection cards); ChoiceResult MakeChoice(Choice choice); void MoveInPlayToSetAside(Predicate match); void PlayCard(Card card, DeckLocation destination = DeckLocation.InPlay); void PlayCard(Card card, PlayerMode previousPlayerModeToRestore); void PlayCardInternal(Card card, DeckLocation destination = DeckLocation.InPlay, string modifier = ""); void PlayCards(ItemCollection cards, DeckLocation destination = DeckLocation.InPlay); void PlayCardsInternal(ItemCollection cards, DeckLocation destination = DeckLocation.InPlay, string modifier = ""); void PlayNothing(string modifier = ""); void PlayTokens(IGame game, Type token, int count); void PlayTreasures(IGame game); PlayerMode PutCardIntoPlay(Card card, string modifier = ""); void Receive(IPlayer fromPlayer, Card card, DeckLocation location, DeckPosition position); void ReceiveBenefit(ICardBase sourceOfBenefit, CardBenefit benefit, bool isInternal = false); void ReceiveBenefit(Token sourceOfBenefit, CardBenefit benefit); void RemoveBenefit(Card sourceOfBenefit, CardBenefit benefit, bool isInternal); void RemoveToken(Token token); void RemoveTokens(Type tokenType, int count); void Reset(); IPile ResolveDeck(DeckLocation location); Card RetrieveCardFrom(DeckLocation location, Card card); Card RetrieveCardFrom(DeckLocation location, Type type); Card RetrieveCardFrom(Type deckType, Card card); ItemCollection RetrieveCardsFrom(DeckLocation location); ItemCollection RetrieveCardsFrom(DeckLocation location, Categories category, int count = -1); ItemCollection RetrieveCardsFrom(DeckLocation location, ItemCollection cards); ItemCollection RetrieveCardsFrom(DeckLocation location, Predicate match, int count = -1); ItemCollection RetrieveCardsFrom(DeckLocation location, Type type, int count); ItemCollection RetrieveCardsFrom(Type deckType); void ReturnBoon(IBoonSupply boonSupply, IBoon boon); void ReturnBoon(IBoonSupply boonSupply, ItemCollection boons); void Return(Type takeableType); void ReturnHand(ItemCollection hand); ItemCollection RevealHand(); void SetCurrentTurn(Turn turn); void Setup(IGame game); void SetupDeckAs(IPlayer player); void ShuffleDrawPile(); void SpendCurrency(Currency currency); void Start(Turn turn); void StartAsync(); double SumAll(IPlayer fromPlayer, Predicate filterPredicate, Func sumSelector, bool onlyObtainable = true, bool onlyCurrentlyDrawable = false); int SumAll(IPlayer fromPlayer, Predicate filterPredicate, Func sumSelector, bool onlyObtainable = true, bool onlyCurrentlyDrawable = false); IBoon TakeBoon(IBoonSupply boonSupply); ItemCollection TakeBoon(IBoonSupply boonSupply, int count); void Take(Type takeableType); void TearDown(IGame game); void TestFireAllEvents(); bool TokenActOn(IPlayer actor, Card actingCard); void Trash(IGameObject source, Card card); void Trash(IGameObject source, DeckLocation location, Card card); void Trash(IGameObject source, ItemCollection cards); void Trash(IGameObject source, ISupply supply); void UndoActionPlayed(); void UndoPhaseChange(PhaseEnum newPhase); void UndoPlayCard(Card card); #endregion } }