< Summary

Class:KernelConfigurationTypes.Comms
Assembly:KernelConfiguration
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/KernelConfiguration/KernelConfigTypes.cs
Covered lines:3
Uncovered lines:1
Coverable lines:4
Total lines:92
Line coverage:75% (3 of 4)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Comms()0%2100%
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
 10        public bool Equals(Features other) { return enableBuilderInWorld == other?.enableBuilderInWorld; }
 11
 12        public Features Clone()
 13        {
 14            Features clone = (Features) this.MemberwiseClone();
 15            return clone;
 16        }
 17    }
 18
 19    [Serializable]
 20    public class Comms
 21    {
 022        public float commRadius = 4;
 23        public bool voiceChatEnabled = false;
 24
 25        public bool Equals(Comms other)
 26        {
 527            return commRadius == other?.commRadius &&
 28                   voiceChatEnabled == other?.voiceChatEnabled;
 29        }
 30
 31        public Comms Clone()
 32        {
 233            Comms clone = (Comms) this.MemberwiseClone();
 234            return clone;
 35        }
 36    }
 37
 38    [Serializable]
 39    public class Profiles
 40    {
 41        public string nameValidCharacterRegex = "";
 42        public string nameValidRegex = "";
 43
 44        public bool Equals(Profiles other)
 45        {
 46            return nameValidCharacterRegex == other?.nameValidCharacterRegex &&
 47                   nameValidRegex == other?.nameValidRegex;
 48        }
 49
 50        public Profiles Clone()
 51        {
 52            Profiles clone = (Profiles) this.MemberwiseClone();
 53            return clone;
 54        }
 55    }
 56
 57    [Serializable]
 58    public class WorldRange
 59    {
 60        public int xMin = 0;
 61        public int xMax = 0;
 62        public int yMin = 0;
 63        public int yMax = 0;
 64
 65        public bool Equals(WorldRange other)
 66        {
 67            return xMin == other?.xMin &&
 68                   xMax == other?.xMax &&
 69                   yMin == other?.yMin &&
 70                   yMax == other?.yMax;
 71        }
 72
 73        public WorldRange Clone()
 74        {
 75            WorldRange clone = (WorldRange) this.MemberwiseClone();
 76            return clone;
 77        }
 78        public WorldRange(int xMin, int yMin, int xMax, int yMax)
 79        {
 80            this.xMin = xMin;
 81            this.yMin = yMin;
 82            this.xMax = xMax;
 83            this.yMax = yMax;
 84        }
 85
 86        public bool Contains(int x, int y)
 87        {
 88            return x >= xMin && x <= xMax &&
 89                   y >= yMin && y <= yMax;
 90        }
 91    }
 92}