< Summary

Class:DCL.ECSComponents.MeshRendererRegister
Assembly:DCL.ECSComponents.MeshRenderer
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/ECS7/ECSComponents/MeshRenderer/MeshRendererRegister.cs
Covered lines:12
Uncovered lines:0
Coverable lines:12
Total lines:31
Line coverage:100% (12 of 12)
Covered branches:0
Total branches:0

Metrics

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

File(s)

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

#LineLine coverage
 1using System;
 2using DCL.ECSRuntime;
 3
 4namespace DCL.ECSComponents
 5{
 6    public class MeshRendererRegister : IDisposable
 7    {
 8        private readonly ECSComponentsFactory factory;
 9        private readonly IECSComponentWriter componentWriter;
 10        private readonly int componentId;
 11
 2112        public MeshRendererRegister(int componentId, ECSComponentsFactory factory, IECSComponentWriter componentWriter, 
 13        {
 2114            DataStore_ECS7 dataStoreEcs7 = DataStore.i.ecs7;
 2115            factory.AddOrReplaceComponent(componentId,
 16                ProtoSerialization.Deserialize<PBMeshRenderer>,
 217                () => new MeshRendererHandler(dataStoreEcs7, internalComponents.texturizableComponent, internalComponent
 2118            componentWriter.AddOrReplaceComponentSerializer<PBMeshRenderer>(componentId, ProtoSerialization.Serialize);
 19
 2120            this.factory = factory;
 2121            this.componentWriter = componentWriter;
 2122            this.componentId = componentId;
 2123        }
 24
 25        public void Dispose()
 26        {
 227            factory.RemoveComponent(componentId);
 228            componentWriter.RemoveComponentSerializer(componentId);
 229        }
 30    }
 31}