Ejemplo n.º 1
0
 private void BreakPicklock(Picklock picklock)
 {
     if (_randomizer.NextDouble() < BreakageChanceProvider.GetBreakageChance(_difficultyLevel))
     {
         picklock.IsBroken = true;
     }
 }
Ejemplo n.º 2
0
        public bool Pick(Picklock picklock)
        {
            if (picklock.IsBroken)
            {
                throw new Exception("Attempt to pick lock with broken picklock.");
            }

            if (!IsOpened)
            {
                IsOpened = _successZone.IsSuccess(picklock.TiltAngle);
            }

            if (!IsOpened)
            {
                BreakPicklock(picklock);
            }

            return(IsOpened);
        }