< Summary

Class:WearableLiterals
Assembly:AvatarAssets
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Models/AvatarAssets/WearableLiterals.cs
Covered lines:2
Uncovered lines:5
Coverable lines:7
Total lines:101
Line coverage:28.5% (2 of 7)
Covered branches:0
Total branches:0
Covered methods:2
Total methods:5
Method coverage:40% (2 of 5)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Categories()0%2100%
DefaultWearables()0%110100%
GetDefaultWearables()0%110100%
GetDefaultWearables(...)0%6200%
GetDefaultWearable(...)0%6200%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Models/AvatarAssets/WearableLiterals.cs

#LineLine coverage
 1using System.Collections.Generic;
 2using System.Collections.ObjectModel;
 3using System.Linq;
 4
 5public static class WearableLiterals
 6{
 7    public static class Tags
 8    {
 9        public const string BASE_WEARABLE = "base-wearable";
 10        public const string EXCLUSIVE = "exclusive";
 11    }
 12
 13    public static class Categories
 14    {
 015        public static readonly IReadOnlyCollection<string> REQUIRED_CATEGORIES = new HashSet<string>
 16        {
 17            EYES,
 18            MOUTH
 19        };
 20
 21        public const string BODY_SHAPE = "body_shape";
 22        public const string UPPER_BODY = "upper_body";
 23        public const string LOWER_BODY = "lower_body";
 24        public const string FEET = "feet";
 25        public const string EYES = "eyes";
 26        public const string EYEBROWS = "eyebrows";
 27        public const string MOUTH = "mouth";
 28        public const string FACIAL = "facial";
 29        public const string HAIR = "hair";
 30        public const string SKIN = "skin";
 31        public const string FACIAL_HAIR = "facial_hair";
 32        public const string EYEWEAR = "eyewear";
 33        public const string TIARA = "tiara";
 34        public const string EARRING = "earring";
 35        public const string HAT = "hat";
 36        public const string TOP_HEAD = "top_head";
 37        public const string HELMET = "helmet";
 38        public const string MASK = "mask";
 39        public const string HANDS = "hands";
 40        public const string HANDS_WEAR = "hands_wear";
 41        public const string HEAD = "head";
 42    }
 43
 44    public static class BodyShapes
 45    {
 46        public const string FEMALE = "urn:decentraland:off-chain:base-avatars:BaseFemale";
 47        public const string MALE = "urn:decentraland:off-chain:base-avatars:BaseMale";
 48    }
 49
 50    public static class ItemRarity
 51    {
 52        public const string RARE = "rare";
 53        public const string EPIC = "epic";
 54        public const string LEGENDARY = "legendary";
 55        public const string MYTHIC = "mythic";
 56        public const string UNIQUE = "unique";
 57        public const string EXOTIC = "exotic";
 58    }
 59
 60    public static class DefaultWearables
 61    {
 162        public static readonly IReadOnlyDictionary<(string, string), string> defaultWearables = new Dictionary<(string, 
 63        {
 64            { (BodyShapes.MALE, Categories.EYES), "urn:decentraland:off-chain:base-avatars:eyes_00" },
 65            { (BodyShapes.MALE, Categories.EYEBROWS), "urn:decentraland:off-chain:base-avatars:eyebrows_00" },
 66            { (BodyShapes.MALE, Categories.MOUTH), "urn:decentraland:off-chain:base-avatars:mouth_00" },
 67            { (BodyShapes.MALE, Categories.HAIR), "urn:decentraland:off-chain:base-avatars:casual_hair_01" },
 68            { (BodyShapes.MALE, Categories.FACIAL), "urn:decentraland:off-chain:base-avatars:beard" },
 69            { (BodyShapes.MALE, Categories.UPPER_BODY), "urn:decentraland:off-chain:base-avatars:green_hoodie" },
 70            { (BodyShapes.MALE, Categories.LOWER_BODY), "urn:decentraland:off-chain:base-avatars:brown_pants" },
 71            { (BodyShapes.MALE, Categories.FEET), "urn:decentraland:off-chain:base-avatars:sneakers" },
 72
 73            { (BodyShapes.FEMALE, Categories.EYES), "urn:decentraland:off-chain:base-avatars:f_eyes_00" },
 74            { (BodyShapes.FEMALE, Categories.EYEBROWS), "urn:decentraland:off-chain:base-avatars:f_eyebrows_00" },
 75            { (BodyShapes.FEMALE, Categories.MOUTH), "urn:decentraland:off-chain:base-avatars:f_mouth_00" },
 76            { (BodyShapes.FEMALE, Categories.HAIR), "urn:decentraland:off-chain:base-avatars:standard_hair" },
 77            { (BodyShapes.FEMALE, Categories.UPPER_BODY), "urn:decentraland:off-chain:base-avatars:f_sweater" },
 78            { (BodyShapes.FEMALE, Categories.LOWER_BODY), "urn:decentraland:off-chain:base-avatars:f_jeans" },
 79            { (BodyShapes.FEMALE, Categories.FEET), "urn:decentraland:off-chain:base-avatars:bun_shoes" },
 80        };
 81
 182        public static string[] GetDefaultWearables() => defaultWearables.Values.Distinct().ToArray();
 083        public static string[] GetDefaultWearables(string bodyShapeId) => defaultWearables.Where(x => x.Key.Item1 == bod
 84
 85        public static string GetDefaultWearable(string bodyShapeId, string category)
 86        {
 087            if (!defaultWearables.ContainsKey((bodyShapeId, category)))
 088                return null;
 89
 090            return defaultWearables[(bodyShapeId, category)];
 91        }
 92    }
 93
 94    public static class DefaultEmotes
 95    {
 96        public const string OUTFIT_SHOES = "Outfit_Shoes_v0";
 97        public const string OUTFIT_LOWER = "Outfit_Lower_v0";
 98        public const string OUTFIT_UPPER = "Outfit_Upper_v0";
 99        public const string OUTFIT_ACCESSORIES = "Outfit_Accessories_v0";
 100    }
 101}