Esempio n. 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;
            }
        }
Esempio n. 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);
        }
Esempio n. 3
0
 public void CollectTokens(TokenCollection tokens) => _tokensInternal.AddTokens(tokens);
Esempio n. 4
0
 public bool TryTakeTokensFormBoard(TokenCollection tokensToGetFromBoard) => _boardTokensInternal.TryTake(tokensToGetFromBoard);
Esempio n. 5
0
 public void AddTokensToBoard(TokenCollection tokensToReturnToBoard) => _boardTokensInternal.AddTokens(tokensToReturnToBoard);
Esempio n. 6
0
 public TakeTwoSameAction(TokenCollection tokensToTake)
 {
     _tokensInternal = tokensToTake;
 }
Esempio n. 7
0
 public Noble(uint prestige, TokenCollection cost) : this(prestige, new NobleCost(cost))
 {
 }