< 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:94
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        public bool enableAvatarLODs = false;
 10        public bool enableTutorial = true;
 11
 12        public bool Equals(Features other) { return enableBuilderInWorld == other?.enableBuilderInWorld; }
 13
 14        public Features Clone()
 15        {
 16            Features clone = (Features) this.MemberwiseClone();
 17            return clone;
 18        }
 19    }
 20
 21    [Serializable]
 22    public class Comms
 23    {
 24        public float commRadius = 4;
 25        public bool voiceChatEnabled = false;
 26
 27        public bool Equals(Comms other)
 28        {
 29            return commRadius == other?.commRadius &&
 30                   voiceChatEnabled == other?.voiceChatEnabled;
 31        }
 32
 33        public Comms Clone()
 34        {
 35            Comms clone = (Comms) this.MemberwiseClone();
 36            return clone;
 37        }
 38    }
 39
 40    [Serializable]
 41    public class Profiles
 42    {
 43        public string nameValidCharacterRegex = "";
 44        public string nameValidRegex = "";
 45
 46        public bool Equals(Profiles other)
 47        {
 48            return nameValidCharacterRegex == other?.nameValidCharacterRegex &&
 49                   nameValidRegex == other?.nameValidRegex;
 50        }
 51
 52        public Profiles Clone()
 53        {
 54            Profiles clone = (Profiles) this.MemberwiseClone();
 55            return clone;
 56        }
 57    }
 58
 59    [Serializable]
 60    public class WorldRange
 61    {
 62        public int xMin = 0;
 63        public int xMax = 0;
 64        public int yMin = 0;
 65        public int yMax = 0;
 66
 67        public bool Equals(WorldRange other)
 68        {
 169            return xMin == other?.xMin &&
 70                   xMax == other?.xMax &&
 71                   yMin == other?.yMin &&
 72                   yMax == other?.yMax;
 73        }
 74
 75        public WorldRange Clone()
 76        {
 077            WorldRange clone = (WorldRange) this.MemberwiseClone();
 078            return clone;
 79        }
 22580        public WorldRange(int xMin, int yMin, int xMax, int yMax)
 81        {
 22582            this.xMin = xMin;
 22583            this.yMin = yMin;
 22584            this.xMax = xMax;
 22585            this.yMax = yMax;
 22586        }
 87
 88        public bool Contains(int x, int y)
 89        {
 090            return x >= xMin && x <= xMax &&
 91                   y >= yMin && y <= yMax;
 92        }
 93    }
 94}