Example #1
0
        /// <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);
        }
Example #2
0
        /// <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);
        }
Example #3
0
 protected virtual void OnCardsDealt(DealCardEventArgs args)
 {
     CardsDealt?.Invoke(this, args);
 }
Example #4
0
 protected virtual void OnCardsOnField(DealCardEventArgs args)
 {
     CardsOnField?.Invoke(this, args);
 }