예제 #1
0
        /// <summary>
        ///     Uses the command "match" to challenge a player.
        /// </summary>
        /// <param name="opponent">The opponent to play against.</param>
        /// <param name="yourColor">Your color.</param>
        /// <param name="boardSize">Size of the square board.</param>
        /// <param name="mainTime">The main time, in minutes.</param>
        /// <param name="byoyomiMinutes">Time for each period of 25 moves, in minutes, for Canadian byoyomi.</param>
        /// <returns></returns>
        public async Task <bool> RequestBasicMatchAsync(
            string opponent,
            StoneColor yourColor,
            int boardSize,
            int mainTime,
            int byoyomiMinutes)
        {
            var lines = await
                        MakeRequestAsync("match " + opponent + " " + yourColor.ToIgsCharacterString() + " " + boardSize +
                                         " " + mainTime + " " + byoyomiMinutes);

            return(!lines.IsError);
        }
예제 #2
0
 public static IgsMatchRequest FromOldStyleResponse(string opponentName, StoneColor yourColor,
                                                    int boardSize,
                                                    int canadianMainTime,
                                                    int canadianOvertimeMinutes)
 {
     return(new IgsMatchRequest(
                "match " + opponentName + " " + yourColor.ToIgsCharacterString() + " " + boardSize + " " +
                canadianMainTime + " " + canadianOvertimeMinutes,
                "decline " + opponentName,
                yourColor,
                opponentName,
                boardSize,
                canadianMainTime,
                canadianOvertimeMinutes));
 }
예제 #3
0
        public override GamePlayer Build(StoneColor color, TimeControlSettingsViewModel timeSettings, PlayerSettingsViewModel settings)
        {
            IAIProgram newInstance = (IAIProgram)Activator.CreateInstance(_ai.GetType());

            if (settings.IsFuego)
            {
                Fuego fuego = (Fuego)newInstance;
                fuego.Ponder      = settings.FuegoPonder;
                fuego.AllowResign = settings.FuegoResign;
                fuego.MaxGames    = settings.FuegoMaxGames;
            }
            else if (settings.IsFluffy)
            {
                Fluffy fluffy = (Fluffy)newInstance;
                fluffy.TreeDepth = settings.FluffyTreeDepth;
            }
            return(new AiPlayerBuilder(color)
                   .Name(this._aiLocalizedMetadata.Name + "(" + color.ToIgsCharacterString() + ")")
                   .Rank("NR")
                   .Clock(timeSettings.Build())
                   .AiProgram(newInstance)
                   .Build());
        }