示例#1
0
 public DiceGameSettings(RoundStartSettings roundStartSettings, DiceSettings diceSettings, PlayerSettings playerSettings, RuleSettings ruleSettings)
 {
     _startSettings        = roundStartSettings;
     _diceSettings         = diceSettings;
     _playerPlayerSettings = playerSettings;
     _ruleSettings         = ruleSettings;
 }
示例#2
0
    /// <summary>
    /// Zapisuje odpowiednie ustawienia do obiektu GameSave znajdującego się w klasie GameplayController
    /// </summary>
    public void SaveProgress(ref GameSave save)
    {
        DiceSettings ds = new DiceSettings();
        ds.amountOfRolls = dice.amountOfRolls;
        ds.currentPlayer = dice.currentPlayer;
        ds.last1 = dice.last1;
        ds.last2 = dice.last2;
        ds.round = dice.round;

        save.tiers = tiers;
        save.places = new Dictionary<int, System.Tuple<int, string>>();
        for (int i = 0; i < places.Keys.Count; i++) save.places.Add(i, new System.Tuple<int, string>(places[i], GetField(i).name));

        save.dice = ds;
    }
示例#3
0
        public void DiceSettingsSet_DiceRolled_ValueWithinGivenSettings(int minDiceValue, int maxDiceValue)
        {
            // Arrange
            var diceSettings = new DiceSettings {
                MinValue = minDiceValue, MaxValue = maxDiceValue
            };

            var dice = new Dice(diceSettings);

            // Act
            var diceResult = dice.Roll();

            // Assert
            Assert.True(minDiceValue <= diceResult);
            Assert.True(maxDiceValue >= diceResult);
        }
示例#4
0
 public Dice(DiceSettings diceSettings)
 {
     _diceSettings = diceSettings;
 }