コード例 #1
0
        public bool RollSuccess(DepositMiningDifficulty difficulty)
        {
            var successValue = GetSuccessValue(difficulty);
            var rollValue    = _dice.Roll2D6();

            return(rollValue >= successValue);
        }
コード例 #2
0
        public PropDepositModule(IPropContainer propContainer,
                                 IDropTableScheme dropTableScheme,
                                 IDropResolver dropResolver,
                                 string[] toolTags,
                                 int exhaustingValue,
                                 DepositMiningDifficulty depositMiningDifficulty)
        {
            _propContainer   = propContainer ?? throw new ArgumentNullException(nameof(propContainer));
            _dropTableScheme = dropTableScheme ?? throw new ArgumentNullException(nameof(dropTableScheme));
            _dropResolver    = dropResolver ?? throw new ArgumentNullException(nameof(dropResolver));
            _toolTags        = toolTags ?? throw new ArgumentNullException(nameof(toolTags));

            _exhaustingValue   = exhaustingValue;
            _exhaustingCounter = exhaustingValue;
            Difficulty         = depositMiningDifficulty;
        }
コード例 #3
0
        private static int GetSuccessValue(DepositMiningDifficulty difficulty)
        {
            switch (difficulty)
            {
            case DepositMiningDifficulty.Easy:
                return(3);

            case DepositMiningDifficulty.Moderately:
                return(6);

            case DepositMiningDifficulty.Hard:
                return(9);

            case DepositMiningDifficulty.Impossible:
                return(13);

            case DepositMiningDifficulty.Undefined:
            default:
                throw new InvalidOperationException($"Неизвестная сложность добычи {difficulty}");
            }
        }