Example #1
0
        private void InitTokens(PlayerCount playerCount)
        {
            switch (playerCount)
            {
            case PlayerCount.Four:
                _boardTokensInternal = new TokenCollection(7, 7, 7, 7, 7, 5);
                break;

            case PlayerCount.Three:
                _boardTokensInternal = new TokenCollection(5, 5, 5, 5, 5, 5);
                break;

            case PlayerCount.Two:
            default:
                _boardTokensInternal = new TokenCollection(4, 4, 4, 4, 4, 5);
                break;
            }
        }
Example #2
0
        public static TokenCollection ToCollection(string input)
        {
            var output = new TokenCollection();

            foreach (char c in input)
            {
                var element = char.ToLower(c);
                if (!_register.Keys.Contains(element))
                {
                    var allowedElements = string.Join(",", _register.Keys);
                    var msg             = $"Input sequence contains invalid element, accepted elements are [{allowedElements}]";
                    throw new ArgumentException(msg, nameof(input));
                }

                output.AddTokens(_register[element], 1);
            }

            return(output);
        }
Example #3
0
 public void CollectTokens(TokenCollection tokens) => _tokensInternal.AddTokens(tokens);
Example #4
0
 public bool TryTakeTokensFormBoard(TokenCollection tokensToGetFromBoard) => _boardTokensInternal.TryTake(tokensToGetFromBoard);
Example #5
0
 public void AddTokensToBoard(TokenCollection tokensToReturnToBoard) => _boardTokensInternal.AddTokens(tokensToReturnToBoard);
 public TakeTwoSameAction(TokenCollection tokensToTake)
 {
     _tokensInternal = tokensToTake;
 }
Example #7
0
 public Noble(uint prestige, TokenCollection cost) : this(prestige, new NobleCost(cost))
 {
 }