< Summary

Class:DCLServices.MapRendererV2.CoordsUtils.CoordsExtensions
Assembly:MapRendererV2
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLServices/MapRendererV2/CoordsUtils/CoordsExtensions.cs
Covered lines:3
Uncovered lines:4
Coverable lines:7
Total lines:27
Line coverage:42.8% (3 of 7)
Covered branches:0
Total branches:0
Covered methods:1
Total methods:3
Method coverage:33.3% (1 of 3)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
PivotPosition(...)0%2100%
CoordsToPosition(...)0%2100%
SetObjectScale(...)0%110100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLServices/MapRendererV2/CoordsUtils/CoordsExtensions.cs

#LineLine coverage
 1using DCLServices.MapRendererV2.MapLayers;
 2using UnityEngine;
 3
 4namespace DCLServices.MapRendererV2.CoordsUtils
 5{
 6    internal static class CoordsExtensions
 7    {
 8        public static Vector3 PivotPosition(this ICoordsUtils coordsUtils, IMapRendererMarker marker, Vector3 objPositio
 9        {
 010            Vector2 obj2dPos = objPosition;
 011            obj2dPos -= (Vector2.one - marker.Pivot) * coordsUtils.ParcelSize;
 012            return new Vector3(obj2dPos.x, obj2dPos.y, objPosition.z);
 13        }
 14
 15        /// <summary>
 16        /// Translates Coords into position and makes an offset according to the object's pivot
 17        /// </summary>
 18        public static Vector3 CoordsToPosition(this ICoordsUtils coordsUtils, Vector2Int coords, IMapRendererMarker mark
 019            coordsUtils.PivotPosition(marker, coordsUtils.CoordsToPosition(coords));
 20
 21        public static void SetObjectScale(this ICoordsUtils coordsUtils, MonoBehaviour obj)
 22        {
 2596923            var parcelSize = coordsUtils.ParcelSize;
 2596924            obj.transform.localScale = new Vector3(parcelSize, parcelSize, 1);
 2596925        }
 26    }
 27}