< 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:145
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 enableTutorial = true;
 10        public bool enablePeopleCounter = false;
 11        public bool enableExploreV2 = false;
 12
 13        public override bool Equals(object obj) { return obj is Features other && Equals(other); }
 14        protected bool Equals(Features other)
 15        {
 16            return enableBuilderInWorld == other.enableBuilderInWorld
 17                   && enableTutorial == other.enableTutorial
 18                   && enablePeopleCounter == other.enablePeopleCounter
 19                   && enableExploreV2 == other.enableExploreV2;
 20        }
 21        public Features Clone()
 22        {
 23            Features clone = (Features)this.MemberwiseClone();
 24            return clone;
 25        }
 26    }
 27
 28    [Serializable]
 29    public class Comms
 30    {
 31        public float commRadius = 4;
 32        public bool voiceChatEnabled = false;
 33
 34        public bool Equals(Comms other)
 35        {
 36            return commRadius == other?.commRadius &&
 37                   voiceChatEnabled == other?.voiceChatEnabled;
 38        }
 39
 40        public Comms Clone()
 41        {
 42            Comms clone = (Comms)this.MemberwiseClone();
 43            return clone;
 44        }
 45    }
 46
 47    [Serializable]
 48    public class Profiles
 49    {
 50        public string nameValidCharacterRegex = "";
 51        public string nameValidRegex = "";
 52
 53        public bool Equals(Profiles other)
 54        {
 55            return nameValidCharacterRegex == other?.nameValidCharacterRegex &&
 56                   nameValidRegex == other?.nameValidRegex;
 57        }
 58
 59        public Profiles Clone()
 60        {
 61            Profiles clone = (Profiles)this.MemberwiseClone();
 62            return clone;
 63        }
 64    }
 65
 66    [Serializable]
 67    public class WorldRange
 68    {
 69        public int xMin = 0;
 70        public int xMax = 0;
 71        public int yMin = 0;
 72        public int yMax = 0;
 73
 74        public bool Equals(WorldRange other)
 75        {
 176            return xMin == other?.xMin &&
 77                   xMax == other?.xMax &&
 78                   yMin == other?.yMin &&
 79                   yMax == other?.yMax;
 80        }
 81
 82        public WorldRange Clone()
 83        {
 084            WorldRange clone = (WorldRange)this.MemberwiseClone();
 085            return clone;
 86        }
 1687        public WorldRange(int xMin, int yMin, int xMax, int yMax)
 88        {
 1689            this.xMin = xMin;
 1690            this.yMin = yMin;
 1691            this.xMax = xMax;
 1692            this.yMax = yMax;
 1693        }
 94
 95        public bool Contains(int x, int y)
 96        {
 097            return x >= xMin && x <= xMax &&
 98                   y >= yMin && y <= yMax;
 99        }
 100    }
 101
 102    [Serializable]
 103    public class Debugging
 104    {
 105        public bool sceneDebugPanelEnabled = false;
 106        public int sceneDebugPanelTargetSceneNumber = -1;
 107        public int sceneLimitsWarningSceneNumber = -1;
 108
 109        public bool Equals(Debugging other)
 110        {
 111            return sceneDebugPanelEnabled == other?.sceneDebugPanelEnabled &&
 112                   sceneDebugPanelTargetSceneNumber == other?.sceneDebugPanelTargetSceneNumber &&
 113                   sceneLimitsWarningSceneNumber == other?.sceneLimitsWarningSceneNumber;
 114        }
 115
 116        public Debugging Clone()
 117        {
 118            Debugging clone = (Debugging)this.MemberwiseClone();
 119            return clone;
 120        }
 121    }
 122
 123    [Serializable]
 124    public class ProceduralSkybox
 125    {
 126        public string configToLoad = "Generic_Skybox";
 127        public float lifecycleDuration = 120;
 128        public float fixedTime = -1;
 129        public bool disableReflection = false;
 130        public float updateReflectionTime = -1;     // in mins
 131
 132        public bool Equals(ProceduralSkybox other)
 133        {
 134            return configToLoad == other?.configToLoad &&
 135                   lifecycleDuration == other?.lifecycleDuration &&
 136                   fixedTime == other?.fixedTime;
 137        }
 138
 139        public ProceduralSkybox Clone()
 140        {
 141            ProceduralSkybox clone = (ProceduralSkybox)this.MemberwiseClone();
 142            return clone;
 143        }
 144    }
 145}