public UnityStatRandomizer([NotNull] ICardSettings cardSettings, [NotNull] IReadOnlyReactiveCollection <Card> cards) { this.cardSettings = cardSettings ?? throw new ArgumentNullException(nameof(cardSettings)); this.cards = cards ?? throw new ArgumentNullException(nameof(cards)); subscription = cards.ObserveRemove().Subscribe(OnRemoved); }
public PlayerHand([NotNull] IEnumerable <Card> cards, [NotNull] ICardSettings cardSettings) { if (cards == null) { throw new ArgumentNullException(nameof(cards)); } this.cardSettings = cardSettings ?? throw new ArgumentNullException(nameof(cardSettings)); Cards = new ReactiveCollection <Card>(cards); Cards.ObserveRemove().Subscribe(OnRemoved).AddTo(collectionSubscriptions); foreach (Card card in Cards) { SubscribeToCard(card); } }
public CardGenerator([NotNull] ICardSettings cardSettings) { this.cardSettings = cardSettings ?? throw new ArgumentNullException(nameof(cardSettings)); }