< Summary

Class:ExtraActionsController
Assembly:BuildModeHUD
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/BuilderInWorld/HUD/BuildModeHUD/Scripts/GodMode/TopActionsButtons/ExtraActionsController.cs
Covered lines:29
Uncovered lines:3
Coverable lines:32
Total lines:88
Line coverage:90.6% (29 of 32)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Initialize(...)0%110100%
Dispose()0%110100%
SetActive(...)0%220100%
ResetClicked()0%6200%
ControlsClicked()0%220100%
HideUIClicked()0%220100%
TutorialClicked()0%220100%
ResetCameraClicked()0%220100%
SetResetButtonInteractable(...)0%110100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/BuilderInWorld/HUD/BuildModeHUD/Scripts/GodMode/TopActionsButtons/ExtraActionsController.cs

#LineLine coverage
 1using System;
 2
 3public interface IExtraActionsController
 4{
 5    event Action OnControlsClick,
 6                 OnHideUIClick,
 7                 OnTutorialClick,
 8                 OnResetClick,
 9                 OnResetCameraClick;
 10
 11    void Initialize(IExtraActionsView extraActionsView);
 12    void Dispose();
 13    void SetActive(bool isActive);
 14    void ControlsClicked();
 15    void HideUIClicked();
 16    void TutorialClicked();
 17    void ResetCameraClicked();
 18    void SetResetButtonInteractable(bool isEnabled);
 19}
 20
 21public class ExtraActionsController : IExtraActionsController
 22{
 23    public event Action OnControlsClick,
 24                        OnHideUIClick,
 25                        OnTutorialClick,
 26                        OnResetClick,
 27                        OnResetCameraClick;
 28
 29    internal IExtraActionsView extraActionsView;
 30
 31    public void Initialize(IExtraActionsView extraActionsView)
 32    {
 833        this.extraActionsView = extraActionsView;
 34
 835        extraActionsView.OnControlsClicked += ControlsClicked;
 836        extraActionsView.OnHideUIClicked += HideUIClicked;
 837        extraActionsView.OnTutorialClicked += TutorialClicked;
 838        extraActionsView.OnResetClicked += ResetClicked;
 839        extraActionsView.OnResetCameraClicked += ResetCameraClicked;
 840    }
 41
 42    public void Dispose()
 43    {
 844        extraActionsView.OnControlsClicked -= ControlsClicked;
 845        extraActionsView.OnHideUIClicked -= HideUIClicked;
 846        extraActionsView.OnTutorialClicked -= TutorialClicked;
 847        extraActionsView.OnResetClicked -= ResetClicked;
 848        extraActionsView.OnResetCameraClicked -= ResetCameraClicked;
 849    }
 50
 51    public void SetActive(bool isActive)
 52    {
 2453        if (extraActionsView != null)
 654            extraActionsView.SetActive(isActive);
 2455    }
 56
 57    public void ResetClicked()
 58    {
 059        OnResetClick?.Invoke();
 060        SetActive(false);
 061    }
 62
 63    public void ControlsClicked()
 64    {
 165        OnControlsClick?.Invoke();
 166        SetActive(false);
 167    }
 68
 69    public void HideUIClicked()
 70    {
 171        OnHideUIClick?.Invoke();
 172        SetActive(false);
 173    }
 74
 75    public void TutorialClicked()
 76    {
 177        OnTutorialClick?.Invoke();
 178        SetActive(false);
 179    }
 80
 81    public void ResetCameraClicked()
 82    {
 183        OnResetCameraClick?.Invoke();
 184        SetActive(false);
 185    }
 86
 487    public void SetResetButtonInteractable(bool isInteractable) { extraActionsView.SetResetButtonInteractable(isInteract
 88}