< Summary

Class:DCL.RealmsInfoHandler
Assembly:RealmsInfoBridge
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Bridges/RealmsInfoBridge/RealmsInfoHandler.cs
Covered lines:9
Uncovered lines:1
Coverable lines:10
Total lines:36
Line coverage:90% (9 of 10)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
RealmsInfoHandler()0%2100%
Set(...)0%110100%
Set(...)0%440100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Bridges/RealmsInfoBridge/RealmsInfoHandler.cs

#LineLine coverage
 1using UnityEngine;
 2using System;
 3using Variables.RealmsInfo;
 4using System.Collections.Generic;
 5using System.Linq;
 6
 7namespace DCL
 8{
 9    public class RealmsInfoHandler
 10    {
 011        private RealmsInfoModel model = new RealmsInfoModel();
 12
 113        public CurrentRealmVariable playerRealm => DataStore.i.realm.playerRealm;
 114        public BaseCollection<RealmModel> realmsInfo => DataStore.i.realm.realmsInfo;
 15
 16        public void Set(string json)
 17        {
 218            JsonUtility.FromJsonOverwrite(json, model);
 219            Set(model);
 220        }
 21
 22        public void Set(RealmsInfoModel newModel)
 23        {
 524            model = newModel;
 525            DataStore.i.realm.playerRealm.Set(model.current?.Clone());
 526            DataStore.i.realm.realmsInfo.Set(newModel.realms != null ? newModel.realms.ToList() : new List<RealmModel>()
 527        }
 28    }
 29
 30    [Serializable]
 31    public class RealmsInfoModel
 32    {
 33        public CurrentRealmModel current;
 34        public RealmModel[] realms;
 35    }
 36}