< Summary

Class:KernelConfigurationTypes.Profiles
Assembly:KernelConfiguration
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/KernelConfiguration/KernelConfigTypes.cs
Covered lines:5
Uncovered lines:0
Coverable lines:5
Total lines:103
Line coverage:100% (5 of 5)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Profiles()0%110100%
Equals(...)0%660100%
Clone()0%110100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/KernelConfiguration/KernelConfigTypes.cs

#LineLine coverage
 1using System;
 2
 3namespace KernelConfigurationTypes
 4{
 5    [Serializable]
 6    public class Features
 7    {
 8        public bool enableBuilderInWorld = false;
 9        public bool enableAvatarLODs = false;
 10        public bool enableTutorial = true;
 11        public bool enablePeopleCounter = false;
 12        public bool enableExploreV2 = false;
 13
 14        public override bool Equals(object obj) { return obj is Features other && Equals(other); }
 15        protected bool Equals(Features other)
 16        {
 17            return enableBuilderInWorld == other.enableBuilderInWorld
 18                   && enableAvatarLODs == other.enableAvatarLODs
 19                   && enableTutorial == other.enableTutorial
 20                   && enablePeopleCounter == other.enablePeopleCounter
 21                   && enableExploreV2 == other.enableExploreV2;
 22        }
 23        public Features Clone()
 24        {
 25            Features clone = (Features) this.MemberwiseClone();
 26            return clone;
 27        }
 28    }
 29
 30    [Serializable]
 31    public class Comms
 32    {
 33        public float commRadius = 4;
 34        public bool voiceChatEnabled = false;
 35
 36        public bool Equals(Comms other)
 37        {
 38            return commRadius == other?.commRadius &&
 39                   voiceChatEnabled == other?.voiceChatEnabled;
 40        }
 41
 42        public Comms Clone()
 43        {
 44            Comms clone = (Comms) this.MemberwiseClone();
 45            return clone;
 46        }
 47    }
 48
 49    [Serializable]
 50    public class Profiles
 51    {
 1152        public string nameValidCharacterRegex = "";
 1153        public string nameValidRegex = "";
 54
 55        public bool Equals(Profiles other)
 56        {
 257            return nameValidCharacterRegex == other?.nameValidCharacterRegex &&
 58                   nameValidRegex == other?.nameValidRegex;
 59        }
 60
 61        public Profiles Clone()
 62        {
 263            Profiles clone = (Profiles) this.MemberwiseClone();
 264            return clone;
 65        }
 66    }
 67
 68    [Serializable]
 69    public class WorldRange
 70    {
 71        public int xMin = 0;
 72        public int xMax = 0;
 73        public int yMin = 0;
 74        public int yMax = 0;
 75
 76        public bool Equals(WorldRange other)
 77        {
 78            return xMin == other?.xMin &&
 79                   xMax == other?.xMax &&
 80                   yMin == other?.yMin &&
 81                   yMax == other?.yMax;
 82        }
 83
 84        public WorldRange Clone()
 85        {
 86            WorldRange clone = (WorldRange) this.MemberwiseClone();
 87            return clone;
 88        }
 89        public WorldRange(int xMin, int yMin, int xMax, int yMax)
 90        {
 91            this.xMin = xMin;
 92            this.yMin = yMin;
 93            this.xMax = xMax;
 94            this.yMax = yMax;
 95        }
 96
 97        public bool Contains(int x, int y)
 98        {
 99            return x >= xMin && x <= xMax &&
 100                   y >= yMin && y <= yMax;
 101        }
 102    }
 103}