Example #1
0
 public GameInfo(PlayerInfo whitePlayerInfo, PlayerInfo blackPlayerInfo, GameBoardSize boardSize, RulesetType rulesetType, int numberOfHandicapStones, HandicapPlacementType handicapPlacementType, float komi, CountingType countingType)
 {
     White                  = whitePlayerInfo;
     Black                  = blackPlayerInfo;
     BoardSize              = boardSize;
     RulesetType            = rulesetType;
     NumberOfHandicapStones = numberOfHandicapStones;
     HandicapPlacementType  = handicapPlacementType;
     Komi         = komi;
     CountingType = countingType;
 }
Example #2
0
        public static HandicapPlacementType GetHandicapPlacementType(RulesetType ruleset)
        {
            switch (ruleset)
            {
            case RulesetType.AGA:
            case RulesetType.Japanese:
                return(HandicapPlacementType.Fixed);

            case RulesetType.Chinese:
            default:
                return(HandicapPlacementType.Free);
            }
        }
Example #3
0
        /// <summary>
        /// Calculates the default compensation (komi).
        /// </summary>
        /// <param name="rsType">Type of the ruleset</param>
        /// <param name="gbSize">Game board size</param>
        /// <param name="handicapStoneCount">Handicap stone count</param>
        /// <param name="cType">Counting type</param>
        /// <returns></returns>
        public static float GetDefaultCompensation(RulesetType rsType, GameBoardSize gbSize, int handicapStoneCount, CountingType cType)
        {
            if (rsType == RulesetType.AGA)
            {
                return(AGARuleset.GetAGACompensation(gbSize, handicapStoneCount, cType));
            }
            if (rsType == RulesetType.Chinese)
            {
                return(ChineseRuleset.GetChineseCompensation(gbSize, handicapStoneCount));
            }
            if (rsType == RulesetType.Japanese)
            {
                return(JapaneseRuleset.GetJapaneseCompensation(gbSize, handicapStoneCount));
            }

            return(0);
        }
Example #4
0
        /// <summary>
        /// Factory method that creates a ruleset of given type and gameboard size
        /// </summary>
        /// <param name="ruleset">Ruleset</param>
        /// <param name="gameBoardSize">Gameboard size</param>
        /// <param name="countingType">Counting type (AGA)</param>
        /// <returns>Ruleset</returns>
        public static IRuleset Create(RulesetType ruleset, GameBoardSize gameBoardSize, CountingType countingType = CountingType.Area)
        {
            switch (ruleset)
            {
            case RulesetType.Chinese:
            {
                return(new ChineseRuleset(gameBoardSize));
            }

            case RulesetType.Japanese:
            {
                return(new JapaneseRuleset(gameBoardSize));
            }

            case RulesetType.AGA:
            {
                return(new AGARuleset(gameBoardSize, countingType));
            }

            default:
                throw new ArgumentOutOfRangeException(nameof(ruleset));
            }
        }
Example #5
0
 public IgsGameInfo(
     PlayerInfo whitePlayerInfo,
     PlayerInfo blackPlayerInfo,
     GameBoardSize boardSize,
     RulesetType rulesetType,
     int numberOfHandicapStones,
     HandicapPlacementType handicapPlacementType,
     float komi,
     CountingType countingType,
     int igsIndex,
     int numberOfObservers) :
     base(
         whitePlayerInfo,
         blackPlayerInfo,
         boardSize,
         rulesetType,
         numberOfHandicapStones,
         handicapPlacementType,
         komi,
         countingType)
 {
     NumberOfObservers = numberOfObservers;
     IgsIndex          = igsIndex;
 }
Example #6
0
 protected RemoteGameInfo(PlayerInfo whitePlayerInfo, PlayerInfo blackPlayerInfo, GameBoardSize boardSize, RulesetType rulesetType, int numberOfHandicapStones, HandicapPlacementType handicapPlacementType, float komi, CountingType countingType) : base(whitePlayerInfo, blackPlayerInfo, boardSize, rulesetType, numberOfHandicapStones, handicapPlacementType, komi, countingType)
 {
 }
Example #7
0
 public KgsGameInfo(PlayerInfo whitePlayerInfo, PlayerInfo blackPlayerInfo, GameBoardSize boardSize, RulesetType rulesetType, int numberOfHandicapStones, HandicapPlacementType handicapPlacementType, float komi, CountingType countingType, int channelId) : base(whitePlayerInfo, blackPlayerInfo, boardSize, rulesetType, numberOfHandicapStones, handicapPlacementType, komi, countingType)
 {
     this.ChannelId = channelId;
 }
Example #8
0
 public TBuilderType Ruleset(RulesetType rulesetType)
 {
     _rulesetType = rulesetType;
     return(_concreteBuilderInstance);
 }