< Summary

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

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Equals(...)0%12120100%
Clone()0%2100%
WorldRange(...)0%110100%
Contains(...)0%20400%

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    {
 22        public float commRadius = 4;
 23        public bool voiceChatEnabled = false;
 24
 25        public bool Equals(Comms other)
 26        {
 27            return commRadius == other?.commRadius &&
 28                   voiceChatEnabled == other?.voiceChatEnabled;
 29        }
 30
 31        public Comms Clone()
 32        {
 33            Comms clone = (Comms) this.MemberwiseClone();
 34            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        {
 167            return xMin == other?.xMin &&
 68                   xMax == other?.xMax &&
 69                   yMin == other?.yMin &&
 70                   yMax == other?.yMax;
 71        }
 72
 73        public WorldRange Clone()
 74        {
 075            WorldRange clone = (WorldRange) this.MemberwiseClone();
 076            return clone;
 77        }
 21778        public WorldRange(int xMin, int yMin, int xMax, int yMax)
 79        {
 21780            this.xMin = xMin;
 21781            this.yMin = yMin;
 21782            this.xMax = xMax;
 21783            this.yMax = yMax;
 21784        }
 85
 86        public bool Contains(int x, int y)
 87        {
 088            return x >= xMin && x <= xMax &&
 89                   y >= yMin && y <= yMax;
 90        }
 91    }
 92}