< Summary

Class:DCL.SettingsCommon.SettingsControllers.SpecificControllers.InvertYAxisControlController
Assembly:SettingsControllers
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/Settings/SettingsControllers/SpecificControllers/InvertYAxisControlController.cs
Covered lines:10
Uncovered lines:0
Coverable lines:10
Total lines:31
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%
InvertYAxisChanged(...)0%110100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/Settings/SettingsControllers/SpecificControllers/InvertYAxisControlController.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/Invert Y Axis", fileName = "InvertYAxisControlController"
 8    public class InvertYAxisControlController : ToggleSettingsControlController
 9    {
 10
 11        public override void Initialize()
 12        {
 213            base.Initialize();
 214            DataStore.i.camera.invertYAxis.OnChange += InvertYAxisChanged;
 215        }
 16
 217        public override object GetStoredValue() { return currentGeneralSettings.invertYAxis; }
 18
 19        public override void UpdateSetting(object newValue)
 20        {
 221            currentGeneralSettings.invertYAxis = (bool)newValue;
 222            DataStore.i.camera.invertYAxis.Set((bool)newValue);
 223        }
 24
 25        private void InvertYAxisChanged(bool current, bool previous)
 26        {
 127            currentGeneralSettings.invertYAxis = current;
 128            ApplySettings();
 129        }
 30    }
 31}