Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ChiamataLibrary.ArtificialIntelligence"/> class.
        /// </summary>
        /// <param name="me">The <see cref="ChiamataLibrary.Player"/> instance representing the AI.</param>
        /// <param name="bid">The implementation of <see cref="ChiamataLibrary.IAIBidChooser"/> that will be used to choose the bids for this AI.</param>
        /// <param name="seme">The implementation of <see cref="ChiamataLibrary.IAISemeChooser"/> that will be used to choose the seme for this AI.</param>
        /// <param name="card">The implementation of <see cref="ChiamataLibrary.IAICardChooser"/> that will be used to choose the cards played by this AI.</param>
        public AIPlayerController(Player me, IAIBidChooser bid, IAISemeChooser seme, IAICardChooser card)
        {
            this.me           = me;
            this._cardChooser = card;
            this._semeChooser = seme;
            this._bidChooser  = bid;

            me.Controller = this;

            Board.Instance.eventAuctionStart  += StartAuction;
            Board.Instance.eventPlaytimeStart += StartGame;
        }
Beispiel #2
0
        /// <summary>
        /// Initializes this instance.
        /// </summary>
        /// <param name="me">The <see cref="ChiamataLibrary.Player"/> instance representing the AI.</param>
        public void Setup(Player me)
        {
            this._me = me;
            if (me.Role == EnRole.CHIAMANTE)
            {
                _cardChooser = new AICChiamanteTakeAll(10, 25, 3);
            }
            else if (me.Role == EnRole.SOCIO)
            {
                _cardChooser = new AICSocioNascosto(10, 25, 3);
            }
            else
            {
                _cardChooser = new AICAltriCargaOsti(10, 20, 3);
            }

            _cardChooser.Setup(me);
        }