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