< Summary

Class:MinimapMetadataController
Assembly:MapRenderer
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/MapRenderer/MinimapMetadataController.cs
Covered lines:6
Uncovered lines:9
Coverable lines:15
Total lines:40
Line coverage:40% (6 of 15)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Awake()0%110100%
UpdateMinimapSceneInformation(...)0%6200%
UpdateMinimapUserInformation(...)0%5.673033.33%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/MapRenderer/MinimapMetadataController.cs

#LineLine coverage
 1using DCL.Helpers;
 2using UnityEngine;
 3
 4public class MinimapMetadataController : MonoBehaviour
 5{
 1056    private MinimapMetadata minimapMetadata => MinimapMetadata.GetMetadata();
 07    public static MinimapMetadataController i { get; private set; }
 8
 9    public void Awake()
 10    {
 10511        i = this;
 10512        minimapMetadata.Clear();
 10513    }
 14
 15    public void UpdateMinimapSceneInformation(string scenesInfoJson)
 16    {
 017        var scenesInfo = Utils.ParseJsonArray<MinimapMetadata.MinimapSceneInfo[]>(scenesInfoJson);
 18
 019        foreach (var sceneInfo in scenesInfo)
 20        {
 021            minimapMetadata.AddSceneInfo(sceneInfo);
 22        }
 023    }
 24
 25    /// <summary>
 26    /// Updates the information of an user in the minimap.
 27    /// </summary>
 28    /// <param name="userInfo">User info model</param>
 29    /// <param name="isRemoved">True for remove the user info</param>
 30    public void UpdateMinimapUserInformation(MinimapMetadata.MinimapUserInfo userInfo, bool isRemoved = false)
 31    {
 332        if (string.IsNullOrEmpty(userInfo.userId))
 333            return;
 34
 035        if (!isRemoved)
 036            minimapMetadata.AddOrUpdateUserInfo(userInfo);
 37        else
 038            minimapMetadata.RemoveUserInfo(userInfo.userId);
 039    }
 40}