/// <summary> /// Deal card to specific player of specific amount /// Overload used inside DealCard() /// </summary> /// <param name="player"></param> /// <param name="amount">2p = 5, 3p = 4 then 3</param> private void DealCard(IHanafudaPlayer player, int amount = 5) { IEnumerable <Hanafuda> draws = DeckCollection.Instance.DrawCard(amount); DealCardEventArgs args = new DealCardEventArgs(); args.Player = player; args.Cards = draws; OnCardsDealt(args); }
/// <summary> /// Spread cards on dictionary of cards based on their month /// </summary> /// <param name="amount">2p = 4, 3p = 3</param> protected void DealCardsOnField(int amount = 4) { IEnumerable <Hanafuda> draws = DeckCollection.Instance.DrawCard(amount); DealCardEventArgs args = new DealCardEventArgs(); args.Cards = draws; // update board manager's field OnCardsOnField(args); }
protected virtual void OnCardsDealt(DealCardEventArgs args) { CardsDealt?.Invoke(this, args); }
protected virtual void OnCardsOnField(DealCardEventArgs args) { CardsOnField?.Invoke(this, args); }