< Summary

Class:DCL.SettingsCommon.SettingsControllers.SpecificControllers.ScenesLoadRadiusControlController
Assembly:SettingsControllers
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/Settings/SettingsControllers/SpecificControllers/ScenesLoadRadiusControlController.cs
Covered lines:10
Uncovered lines:0
Coverable lines:10
Total lines:32
Line coverage:100% (10 of 10)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Initialize()0%110100%
GetStoredValue()0%110100%
UpdateSetting(...)0%110100%
ApplyAndReportScenesLoadRadius(...)0%330100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/Settings/SettingsControllers/SpecificControllers/ScenesLoadRadiusControlController.cs

#LineLine coverage
 1using DCL.Interface;
 2using DCL.SettingsCommon.SettingsControllers.BaseControllers;
 3using UnityEngine;
 4
 5namespace DCL.SettingsCommon.SettingsControllers.SpecificControllers
 6{
 7    [CreateAssetMenu(menuName = "Settings/Controllers/Controls/Scenes Load Radius", fileName = "ScenesLoadRadiusControlC
 8    public class ScenesLoadRadiusControlController : SliderSettingsControlController
 9    {
 10        public override void Initialize()
 11        {
 112            base.Initialize();
 13
 114            ApplyAndReportScenesLoadRadius(currentGeneralSettings.scenesLoadRadius, true);
 115        }
 16
 117        public override object GetStoredValue() { return currentGeneralSettings.scenesLoadRadius; }
 18
 219        public override void UpdateSetting(object newValue) { ApplyAndReportScenesLoadRadius((float)newValue); }
 20
 21        private void ApplyAndReportScenesLoadRadius(float newRadius, bool forceApply = false)
 22        {
 223            if (!forceApply && newRadius == currentGeneralSettings.scenesLoadRadius)
 124                return;
 25
 126            currentGeneralSettings.scenesLoadRadius = newRadius;
 27
 28            // trigger LOS update and re-load of surrounding parcels in Kernel
 129            WebInterface.SetScenesLoadRadius(newRadius);
 130        }
 31    }
 32}