< Summary

Class:DCLPlugins.RealmPlugin.RealmMinimapModifier
Assembly:DCL.Plugins.RealmsPlugin
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/RealmsPlugin/RealmMinimapModifier.cs
Covered lines:8
Uncovered lines:0
Coverable lines:8
Total lines:30
Line coverage:100% (8 of 8)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
RealmMinimapModifier(...)0%110100%
Dispose()0%110100%
OnEnteredRealm(...)0%110100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/RealmsPlugin/RealmMinimapModifier.cs

#LineLine coverage
 1using DCL;
 2using static Decentraland.Bff.AboutResponse.Types;
 3
 4namespace DCLPlugins.RealmPlugin
 5{
 6    /// <summary>
 7    /// Toggles the state of the minimap depending on the value of the AboutConfiguration.Minimap.Enabled we just entere
 8    /// It also toggles the visibility of a Jump To Home button, which is required every time going into a world.
 9    /// If the minimap and the jump home button is visible, they can both co-exist on an ON state.
 10    /// </summary>
 11    public class RealmMinimapModifier : IRealmModifier
 12    {
 13        private readonly BaseVariable<bool> minimapVisible;
 14        private readonly BaseVariable<bool> jumpHomeButtonVisible;
 15
 816        public RealmMinimapModifier(DataStore_HUDs dataStoreHUDs)
 17        {
 818            minimapVisible = dataStoreHUDs.minimapVisible;
 819            jumpHomeButtonVisible = dataStoreHUDs.jumpHomeButtonVisible;
 820        }
 21
 222        public void Dispose() { }
 23
 24        public void OnEnteredRealm(bool isWorld, AboutConfiguration realmConfiguration)
 25        {
 226            minimapVisible.Set(realmConfiguration.Minimap.Enabled);
 227            jumpHomeButtonVisible.Set(isWorld);
 228        }
 29    }
 30}