public ChangeTrumpCardManager(IDeckState deckState, IGameState gameState, ITrickState trickState, IPlayerActionValidator playerActionValidator) : base(gameState, trickState) { this.deckState = deckState; this.gameState = gameState; this.playerActionValidator = playerActionValidator; }
public CardsDealer(IGameState gameState, IDeckState deckState, ICardsProvider cardsProvider, IAnnounceProvider announceProvider) { this.gameState = gameState; this.deckState = deckState; this.cardsProvider = cardsProvider; this.announceProvider = announceProvider; }
public DeckNotClosedRoundWinner(IGameState gameState, IDeckState deckState, ITrickState trickState) : base(gameState) { this.gameState = gameState; this.deckState = deckState; this.trickState = trickState; }
public AnnounceMarriage(ITrickState trickState, IDeckState deckState, IAnnounceProvider announceProvider, IPlayerActionValidator playerActionValidator) : base(trickState) { this.deckState = deckState; this.announceProvider = announceProvider; this.playerActionValidator = playerActionValidator; }
public PlayCardManager(IDeckState deckState, IGameState gameState, ITrickState trickState, IEnumerable <IPlayCardValidator> playCardValidators) : base(gameState, trickState) { this.deckState = deckState; this.gameState = gameState; this.trickState = trickState; this.playCardValidators = playCardValidators; }
public static TCardState DrawCard <TCardState>(IDeckState <TCardState> deck) where TCardState : ICardState { if (deck.OrderedDeck.Count > 0) { var card = deck.OrderedDeck[0]; deck.OrderedDeck.RemoveAt(0); return(card); } else { return(default(TCardState)); } }
public static IEnumerable <TCardState> DrawCards <TCardState>(IDeckState <TCardState> deck, int numberToDraw) where TCardState : ICardState { for (int i = 0; i < numberToDraw; i++) { var card = DrawCard(deck); if (card != null) { yield return(card); } else { yield break; } } }
public static void Shuffle <TCardState>(IDeckState <TCardState> deck) where TCardState : ICardState { if (deck.OrderedDeck.Count < 2) { return; } for (int i = 1; i < deck.OrderedDeck.Count; i++) { var a = deck.OrderedDeck[i]; var j = Random.Range(0, i); var b = deck.OrderedDeck[j]; deck.OrderedDeck[i] = b; deck.OrderedDeck[j] = a; } }
public PlaySecondFollowingSuitStrategy(IDeckState deckState, ITrickState trickState, IEnumerable <IPlayLogic> playLogics) : base(trickState, playLogics) { this.deckState = deckState; this.trickState = trickState; }
public PlayTrumpCardValidator(IDeckState deckState) { this.deckState = deckState; }
public StatesManager(IGameState gameState, IDeckState deckState, ITrickState trickState) { this.gameState = gameState; this.deckState = deckState; this.trickState = trickState; }
public AnnounceProvider(IDeckState deckState, IPlayerActionValidator playerActionValidator) { this.deckState = deckState; this.playerActionValidator = playerActionValidator; }
public DeckClosedRoundWinner(IGameState gameState, IDeckState deckState) : base(gameState) { this.gameState = gameState; this.deckState = deckState; }
public PlayDifferentCard(ITrickState trickState, IDeckState deckState) : base(trickState) { this.deckState = deckState; }
public ChangeTrumpCard(ITrickState trickState, IDeckState deckState, IPlayerActionValidator playerActionValidator) : base(trickState) { this.deckState = deckState; this.playerActionValidator = playerActionValidator; }
public PlayerActionValidator(IDeckState deckState, ITrickState trickState) { this.deckState = deckState; this.trickState = trickState; }
public PlayTrumpCard(ITrickState trickState, IDeckState deckState) : base(trickState) { this.deckState = deckState; }
public PlayCard(ITrickState trickState, IDeckState deckState, IAnnounceProvider announceProvider) : base(trickState) { this.deckState = deckState; this.announceProvider = announceProvider; }
private PlaySecondFollowingSuitStrategy RegisterPlaySecondFollowingSuitStrategy(IDeckState deckState, ITrickState trickState, IEnumerable <IPlayLogic> playLogics) { List <Type> types = new List <Type>() { typeof(PlayHigherCard), typeof(PlayLowerCard), typeof(PlayTrumpCard), typeof(PlayDifferentCard) }; IEnumerable <IPlayLogic> strategyLogics = GetOrderedPlayLogics(types, playLogics); return(new PlaySecondFollowingSuitStrategy(deckState, trickState, strategyLogics)); }
private PlayFirstFollowingSuitStrategy RegisterPlayFirstFollowingSuitStrategy(IDeckState deckState, ITrickState trickState, IEnumerable <IPlayLogic> playLogics) { List <Type> types = new List <Type>() { typeof(AnnounceMarriage), typeof(PlayCard) }; IEnumerable <IPlayLogic> strategyLogics = GetOrderedPlayLogics(types, playLogics); return(new PlayFirstFollowingSuitStrategy(deckState, trickState, strategyLogics)); }