< Summary

Class:Variables.RealmsInfo.CurrentRealmVariable
Assembly:DataStore
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/DataStore/Variables/RealmsInfo/CurrentRealmVariable.cs
Covered lines:3
Uncovered lines:0
Coverable lines:3
Total lines:56
Line coverage:100% (3 of 3)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Equals(...)0%220100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/DataStore/Variables/RealmsInfo/CurrentRealmVariable.cs

#LineLine coverage
 1using System;
 2
 3namespace Variables.RealmsInfo
 4{
 5    public class CurrentRealmVariable : BaseVariable<CurrentRealmModel>
 6    {
 7        public override bool Equals(CurrentRealmModel other)
 8        {
 79            if (value == null)
 10            {
 311                return other == null;
 12            }
 13
 414            return value.Equals(other);
 15        }
 16    }
 17
 18    [Serializable]
 19    public class CurrentRealmModel
 20    {
 21        public string layer;
 22        public string serverName;
 23        public string domain = string.Empty;
 24        public string contentServerUrl = string.Empty;
 25
 26        public bool isArchipelagoRealm => string.IsNullOrEmpty(layer);
 27
 28        public bool Equals(CurrentRealmModel other)
 29        {
 30            if (other == null)
 31                return false;
 32            return Equals(other.serverName, other.layer, other.domain, other.contentServerUrl);
 33        }
 34
 35        public bool Equals(string serverName, string layer, string domain, string contentServerUrl) { return Equals(serv
 36
 37        public bool Equals(string serverName, string layer)
 38        {
 39            if (isArchipelagoRealm)
 40                return this.serverName == serverName;
 41            else
 42                return this.serverName == serverName && this.layer == layer;
 43        }
 44
 45        public CurrentRealmModel Clone()
 46        {
 47            return new CurrentRealmModel()
 48            {
 49                serverName = serverName,
 50                layer = layer,
 51                domain = domain,
 52                contentServerUrl = contentServerUrl
 53            };
 54        }
 55    }
 56}