< Summary

Class:LandController
Assembly:BuilderProjectsPanel
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/BuilderProjectsPanel/Scripts/LandController/LandController.cs
Covered lines:0
Uncovered lines:8
Coverable lines:8
Total lines:32
Line coverage:0% (0 of 8)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
SetLands(...)0%6200%
AddListener(...)0%2100%
RemoveListener(...)0%2100%
GetLands()0%2100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/BuilderProjectsPanel/Scripts/LandController/LandController.cs

#LineLine coverage
 1using System;
 2
 3internal interface ILandController
 4{
 5    event Action<LandWithAccess[]> OnLandsSet;
 6    void SetLands(LandWithAccess[] lands);
 7    void AddListener(ILandsListener listener);
 8    void RemoveListener(ILandsListener listener);
 9    LandWithAccess[] GetLands();
 10}
 11
 12internal class LandController : ILandController
 13{
 14    public event Action<LandWithAccess[]> OnLandsSet;
 15
 16    private LandWithAccess[] userLands = null;
 17
 18    void ILandController.SetLands(LandWithAccess[] lands)
 19    {
 020        userLands = lands;
 021        OnLandsSet?.Invoke(lands);
 022    }
 23
 24    void ILandController.AddListener(ILandsListener listener)
 25    {
 026        OnLandsSet += listener.OnSetLands;
 027        listener.OnSetLands(userLands);
 028    }
 29
 030    void ILandController.RemoveListener(ILandsListener listener) { OnLandsSet -= listener.OnSetLands; }
 031    public LandWithAccess[] GetLands() { return userLands; }
 32}