Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
 public CardGenerator([NotNull] ICardSettings cardSettings)
 {
     this.cardSettings = cardSettings ?? throw new ArgumentNullException(nameof(cardSettings));
 }