< Summary

Class:ECSTransformUtils
Assembly:DCL.ECSComponents.Transform.Utils
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/ECS7/ECSComponents/Transform/Utils/ECSTransformUtils.cs
Covered lines:13
Uncovered lines:0
Coverable lines:13
Total lines:40
Line coverage:100% (13 of 13)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
OrphanEntity(...)0%110100%
SetParent(...)0%330100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/ECS7/ECSComponents/Transform/Utils/ECSTransformUtils.cs

#LineLine coverage
 1using DCL.Controllers;
 2using DCL.Models;
 3
 4public static class ECSTransformUtils
 5{
 6    public readonly struct OrphanEntity
 7    {
 8        public readonly IParcelScene scene;
 9        public readonly IDCLEntity entity;
 10        public readonly long parentId;
 11
 12        public OrphanEntity(IParcelScene scene, IDCLEntity entity, long parentId)
 13        {
 414            this.scene = scene;
 415            this.entity = entity;
 416            this.parentId = parentId;
 417        }
 18    }
 19
 20    public static KeyValueSet<IDCLEntity, OrphanEntity> orphanEntities = null;
 21
 22    public static bool SetParent(IParcelScene scene, IDCLEntity child, long parentId)
 23    {
 824        if (parentId == (long)SpecialEntityId.SCENE_ROOT_ENTITY)
 25        {
 126            child.SetParent(null);
 127            child.gameObject.transform.SetParent(scene.GetSceneTransform(), false);
 128            return true;
 29        }
 30
 731        IDCLEntity parent = scene.GetEntityById(parentId);
 732        if (parent != null)
 33        {
 334            child.SetParent(parent);
 335            return true;
 36        }
 37
 438        return false;
 39    }
 40}