< Summary

Class:DCL.ECSComponents.ECS7ComponentsComposer
Assembly:DCL.Plugins.ECS7Components
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/ECS7/ECSComponents/ECS7ComponentsComposer.cs
Covered lines:51
Uncovered lines:0
Coverable lines:51
Total lines:103
Line coverage:100% (51 of 51)
Covered branches:0
Total branches:0

Metrics

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

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/ECS7/ECSComponents/ECS7ComponentsComposer.cs

#LineLine coverage
 1using System;
 2using DCL.ECS7;
 3using DCL.ECSRuntime;
 4using DCLPlugins.ECSComponents;
 5
 6namespace DCL.ECSComponents
 7{
 8    public class ECS7ComponentsComposer : IDisposable
 9    {
 10        private readonly TransformRegister transformRegister;
 11        private readonly SphereShapeRegister sphereShapeRegister;
 12        private readonly BoxShapeRegister boxShapeRegister;
 13        private readonly PlaneShapeRegister planeShapeRegister;
 14        private readonly CylinderShapeRegister cylinderShapeRegister;
 15        private readonly AudioStreamRegister audioStreamRegister;
 16        private readonly AudioSourceRegister audioSourceRegister;
 17        private readonly GLTFShapeRegister gltfRegister;
 18        private readonly ECSTextShapeRegister textShapeRegister;
 19        private readonly NFTShapeRegister nftRegister;
 20        private readonly OnPointerDownRegister pointerDownRegister;
 21        private readonly OnPointerUpRegister pointerUpRegister;
 22        private readonly AnimatorRegister animatorRegister;
 23        private readonly BillboardRegister billboardRegister;
 24        private readonly CameraModeAreaRegister cameraModeAreaRegister;
 25        private readonly AvatarModifierAreaRegister avatarModifierAreaRegister;
 26        private readonly AvatarAttachRegister avatarAttachRegister;
 27        private readonly MaterialRegister materialRegister;
 28
 29        // UI components
 30        private readonly UITransformRegister uiTransformRegister;
 31        private readonly UITextRegister uiTextRegister;
 32
 33        // Those components are only here to serialize over the wire, we don't need a handler for these
 34        private readonly OnPointerDownResultRegister pointerDownResultRegister;
 35        private readonly OnPointerUpResultRegister pointerUpResultRegister;
 36        private readonly CameraModeRegister cameraModeRegister;
 37        private readonly PointerLockRegister pointerLockRegister;
 38
 839        public ECS7ComponentsComposer(ECSComponentsFactory componentsFactory, IECSComponentWriter componentsWriter, IInt
 40        {
 841            transformRegister = new TransformRegister(ComponentID.TRANSFORM, componentsFactory, componentsWriter);
 842            sphereShapeRegister = new SphereShapeRegister(ComponentID.SPHERE_SHAPE, componentsFactory, componentsWriter,
 843            boxShapeRegister = new BoxShapeRegister(ComponentID.BOX_SHAPE, componentsFactory, componentsWriter, internal
 844            planeShapeRegister = new PlaneShapeRegister(ComponentID.PLANE_SHAPE, componentsFactory, componentsWriter, in
 845            cylinderShapeRegister = new CylinderShapeRegister(ComponentID.CYLINDER_SHAPE, componentsFactory, componentsW
 846            audioStreamRegister = new AudioStreamRegister(ComponentID.AUDIO_STREAM, componentsFactory, componentsWriter)
 847            audioSourceRegister = new AudioSourceRegister(ComponentID.AUDIO_SOURCE, componentsFactory, componentsWriter)
 848            nftRegister = new NFTShapeRegister(ComponentID.NFT_SHAPE, componentsFactory, componentsWriter);
 849            textShapeRegister = new ECSTextShapeRegister(ComponentID.TEXT_SHAPE, componentsFactory, componentsWriter);
 850            gltfRegister = new GLTFShapeRegister(ComponentID.GLTF_SHAPE, componentsFactory, componentsWriter);
 851            pointerDownRegister = new OnPointerDownRegister(ComponentID.ON_POINTER_DOWN, componentsFactory, componentsWr
 852            pointerUpRegister = new OnPointerUpRegister(ComponentID.ON_POINTER_UP, componentsFactory, componentsWriter);
 853            animatorRegister = new AnimatorRegister(ComponentID.ANIMATOR, componentsFactory, componentsWriter);
 854            billboardRegister = new BillboardRegister(ComponentID.BILLBOARD, componentsFactory, componentsWriter);
 855            avatarAttachRegister = new AvatarAttachRegister(ComponentID.AVATAR_ATTACH, componentsFactory, componentsWrit
 856            avatarModifierAreaRegister = new AvatarModifierAreaRegister(ComponentID.AVATAR_MODIFIER_AREA, componentsFact
 857            cameraModeAreaRegister = new CameraModeAreaRegister(ComponentID.CAMERA_MODE_AREA, componentsFactory, compone
 858            materialRegister = new MaterialRegister(ComponentID.MATERIAL, componentsFactory, componentsWriter, internalC
 59
 60            // UI components
 861            uiTransformRegister = new UITransformRegister(ComponentID.UI_TRANSFORM, componentsFactory, componentsWriter)
 862            uiTextRegister = new UITextRegister(ComponentID.UI_TEXT, componentsFactory, componentsWriter);
 63
 64            // Components without a handler
 865            pointerDownResultRegister = new OnPointerDownResultRegister(ComponentID.ON_POINTER_DOWN_RESULT, componentsFa
 866            pointerUpResultRegister = new OnPointerUpResultRegister(ComponentID.ON_POINTER_UP_RESULT, componentsFactory,
 867            cameraModeRegister = new CameraModeRegister(ComponentID.CAMERA_MODE, componentsFactory, componentsWriter);
 868            pointerLockRegister = new PointerLockRegister(ComponentID.POINTER_LOCK, componentsFactory, componentsWriter)
 869        }
 70
 71        public void Dispose()
 72        {
 873            transformRegister.Dispose();
 874            sphereShapeRegister.Dispose();
 875            boxShapeRegister.Dispose();
 876            billboardRegister.Dispose();
 877            planeShapeRegister.Dispose();
 878            cylinderShapeRegister.Dispose();
 879            audioStreamRegister.Dispose();
 880            audioSourceRegister.Dispose();
 881            textShapeRegister.Dispose();
 882            nftRegister.Dispose();
 883            gltfRegister.Dispose();
 884            animatorRegister.Dispose();
 885            avatarAttachRegister.Dispose();
 886            avatarModifierAreaRegister.Dispose();
 887            pointerDownRegister.Dispose();
 888            pointerUpRegister.Dispose();
 889            cameraModeAreaRegister.Dispose();
 890            materialRegister.Dispose();
 91
 92            // UI components
 893            uiTransformRegister.Dispose();
 894            uiTextRegister.Dispose();
 95
 96            // Components without a handler
 897            pointerDownResultRegister.Dispose();
 898            pointerUpResultRegister.Dispose();
 899            cameraModeRegister.Dispose();
 8100            pointerLockRegister.Dispose();
 8101        }
 102    }
 103}