< Summary

Class:DCLServices.MapRendererV2.ComponentsFactory.HomePointMarkerInstaller
Assembly:MapRendererV2
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLServices/MapRendererV2/ComponentsFactory/HomePointMarkerInstaller.cs
Covered lines:11
Uncovered lines:0
Coverable lines:11
Total lines:55
Line coverage:100% (11 of 11)
Covered branches:0
Total branches:0
Covered methods:2
Total methods:2
Method coverage:100% (2 of 2)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Install()0%330100%
GetPrefab()0%330100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLServices/MapRendererV2/ComponentsFactory/HomePointMarkerInstaller.cs

#LineLine coverage
 1using Cysharp.Threading.Tasks;
 2using Cysharp.Threading.Tasks.Linq;
 3using DCL;
 4using DCL.Providers;
 5using DCLServices.MapRendererV2.CoordsUtils;
 6using DCLServices.MapRendererV2.Culling;
 7using DCLServices.MapRendererV2.MapLayers;
 8using DCLServices.MapRendererV2.MapLayers.HomePoint;
 9using System.Collections.Generic;
 10using System.Threading;
 11using UnityEngine;
 12
 13namespace DCLServices.MapRendererV2.ComponentsFactory
 14{
 15    internal struct HomePointMarkerInstaller
 16    {
 17        private const string HOME_POINT_MARKER_ADDRESS = "HomePoint";
 18
 19        private Service<IAddressableResourceProvider> addressablesProvider;
 20
 21        public async UniTask Install(
 22            Dictionary<MapLayer, IMapLayerController> writer,
 23            List<IZoomScalingLayer> zoomScalingWriter,
 24            MapRendererConfiguration configuration,
 25            ICoordsUtils coordsUtils,
 26            IMapCullingController cullingController,
 27            CancellationToken cancellationToken
 28        )
 29        {
 9830            var prefab = await GetPrefab(cancellationToken);
 31
 32            IHomePointMarker CreateMarker(Transform parent)
 33            {
 9634                var obj = Object.Instantiate(prefab, configuration.HomePointRoot);
 9635                obj.spriteRenderer.sortingOrder = MapRendererDrawOrder.HOME_POINT;
 9636                coordsUtils.SetObjectScale(obj);
 9637                return new HomePointMarker(obj);
 38            }
 39
 9640            var controller = new HomePointMarkerController(
 41                DataStore.i.HUDs.homePoint,
 42                CreateMarker,
 43                configuration.HomePointRoot,
 44                coordsUtils,
 45                cullingController);
 46
 9647            controller.Initialize();
 9648            writer.Add(MapLayer.HomePoint, controller);
 9649            zoomScalingWriter.Add(controller);
 9650        }
 51
 52        internal async UniTask<HomePointMarkerObject> GetPrefab(CancellationToken cancellationToken) =>
 9853            await addressablesProvider.Ref.GetAddressable<HomePointMarkerObject>(HOME_POINT_MARKER_ADDRESS, cancellation
 54    }
 55}

Methods/Properties

Install()
GetPrefab()