< Summary

Class:DCL.SettingsControls.SkyboxTimeControlController
Assembly:SettingsControllers
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/Settings/SettingsControllers/SpecificControllers/SkyboxTimeControlController.cs
Covered lines:15
Uncovered lines:0
Coverable lines:15
Total lines:35
Line coverage:100% (15 of 15)
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%

File(s)

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

#LineLine coverage
 1using DCL.SettingsCommon.SettingsControllers.BaseControllers;
 2using UnityEngine;
 3
 4namespace DCL.SettingsControls
 5{
 6    [CreateAssetMenu(menuName = "Settings/Controllers/Controls/Skybox Time", fileName = "SkyboxTime")]
 7    public class SkyboxTimeControlController : SliderSettingsControlController
 8    {
 9        public override void Initialize()
 10        {
 111            base.Initialize();
 112            UpdateSetting(currentGeneralSettings.skyboxTime);
 113        }
 14
 115        public override object GetStoredValue() { return currentGeneralSettings.skyboxTime; }
 16
 17        public override void UpdateSetting(object newValue)
 18        {
 219            float valueAsFloat = (float)newValue;
 20
 221            valueAsFloat = Mathf.Clamp(valueAsFloat, 0, 23.998f);
 22
 223            currentGeneralSettings.skyboxTime = valueAsFloat;
 224            DataStore.i.skyboxConfig.fixedTime.Set(valueAsFloat);
 225            int hourSection = (int)valueAsFloat;
 226            float minuteSection = valueAsFloat - hourSection;
 227            minuteSection = minuteSection * 60;
 228            minuteSection = (int)minuteSection;
 29
 230            string sliderTxt = hourSection.ToString("00") + ":" + minuteSection.ToString("00");
 31
 232            RaiseOnIndicatorLabelChange(sliderTxt);
 233        }
 34    }
 35}