< Summary

Class:DCL.Huds.QuestsPanel.QuestsPanelTaskFactory
Assembly:QuestsPanelHUD
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/QuestsPanelHUD/QuestsPanelTaskFactory.cs
Covered lines:1
Uncovered lines:0
Coverable lines:1
Total lines:21
Line coverage:100% (1 of 1)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
GetPrefab(...)0%220100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/QuestsPanelHUD/QuestsPanelTaskFactory.cs

#LineLine coverage
 1using System;
 2using System.Linq;
 3using UnityEngine;
 4
 5namespace DCL.Huds.QuestsPanel
 6{
 7    [CreateAssetMenu(menuName = "Variables/QuestPanelTaskFactory", fileName = "QuestPanelTaskFactory", order = 0)]
 8    public class QuestsPanelTaskFactory : ScriptableObject
 9    {
 10        [Serializable]
 11        public class Entry
 12        {
 13            public string type;
 14            public GameObject prefab;
 15        }
 16
 17        [SerializeField] private Entry[] entries;
 18
 1619        public GameObject GetPrefab(string type) { return entries.FirstOrDefault(x => x.type == type)?.prefab; }
 20    }
 21}

Methods/Properties

GetPrefab(System.String)