< Summary

Class:DCL.Components.SmartItemActionable
Assembly:SmartItemCommon
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Components/SmartItem/SmartItemCommon/SmartItemCommon.cs
Covered lines:0
Uncovered lines:1
Coverable lines:1
Total lines:74
Line coverage:0% (0 of 1)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
SmartItemActionable()0%2100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Components/SmartItem/SmartItemCommon/SmartItemCommon.cs

#LineLine coverage
 1using System;
 2using System.Collections;
 3using System.Collections.Generic;
 4using UnityEngine;
 5
 6namespace DCL.Components
 7{
 8    [System.Serializable]
 9    public class SmartItemActionable
 10    {
 11        [NonSerialized]
 12        public string actionableId;
 13        public string entityId;
 14        public string actionId;
 015        public Dictionary<object, object> values = new Dictionary<object, object>();
 16    }
 17
 18    [System.Serializable]
 19    public class SmartItemAction
 20    {
 21        public string id;
 22        public string label;
 23        public SmartItemParameter[] parameters;
 24    }
 25
 26    [System.Serializable]
 27    public class SmartItemParameter
 28    {
 29        public enum ParameterType
 30        {
 31            BOOLEAN,
 32            TEXT,
 33            TEXTAREA,
 34            FLOAT,
 35            INTEGER,
 36            SLIDER,
 37            OPTIONS,
 38            ENTITY,
 39            ACTIONS
 40        }
 41
 42        public string id;
 43        public string label;
 44        public string type;
 45        public string @default;
 46        public string min;
 47        public string max;
 48        public string step;
 49        public OptionsParameter[] options;
 50
 51        private ParameterType enumType;
 52        private bool enumCached = false;
 53
 54        [System.Serializable]
 55        public class OptionsParameter
 56        {
 57            public string label;
 58            public string value;
 59        }
 60
 61        public ParameterType GetParameterType()
 62        {
 63            if (enumCached)
 64                return enumType;
 65
 66            if (!Enum.TryParse(type.ToUpper(), out ParameterType myStatus))
 67                Debug.Log($"Error parsing the smart item parameter type: {type}, The parameter doesn't exist!");
 68
 69            enumType = myStatus;
 70            enumCached = true;
 71            return enumType;
 72        }
 73    }
 74}

Methods/Properties

SmartItemActionable()