< Summary

Class:AvatarModelDTO
Assembly:AvatarModel
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Models/AvatarModel/AvatarModelDTO.cs
Covered lines:0
Uncovered lines:8
Coverable lines:8
Total lines:65
Line coverage:0% (0 of 8)
Covered branches:0
Total branches:0
Covered methods:0
Total methods:3
Method coverage:0% (0 of 3)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
AvatarModelDTO()0%2100%
ToAvatarModel()0%2100%
FromAvatarModel(...)0%2100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Models/AvatarModel/AvatarModelDTO.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using System.Linq;
 4using UnityEngine;
 5
 6[Serializable]
 7public class AvatarModelDTO
 8{
 9    public string id;
 10    public string name;
 11    public string bodyShape;
 12    public Color skinColor;
 13    public Color hairColor;
 14    public Color eyeColor;
 015    public List<string> wearables = new List<string>();
 016    public List<string> forceRender = new List<string>();
 17
 018    public List<AvatarModel.AvatarEmoteEntry> emotes = new List<AvatarModel.AvatarEmoteEntry>();
 19
 20    public string expressionTriggerId = null;
 021    public long expressionTriggerTimestamp = -1;
 22    public bool talking = false;
 23
 24    public AvatarModel ToAvatarModel()
 25    {
 026        AvatarModel avatarModel = new AvatarModel
 27        {
 28            id = this.id,
 29            name = this.name,
 30            bodyShape = this.bodyShape,
 31            skinColor = this.skinColor,
 32            hairColor = this.hairColor,
 33            eyeColor = this.eyeColor,
 34            wearables = this.wearables,
 35            forceRender = new HashSet<string>(this.forceRender),
 36            emotes = this.emotes,
 37            expressionTriggerId = this.expressionTriggerId,
 38            expressionTriggerTimestamp = this.expressionTriggerTimestamp,
 39            talking = this.talking,
 40        };
 41
 042        return avatarModel;
 43    }
 44
 45    public static AvatarModelDTO FromAvatarModel(AvatarModel model)
 46    {
 047        AvatarModelDTO avatarModelDto = new AvatarModelDTO
 48        {
 49            id = model.id,
 50            name = model.name,
 51            bodyShape = model.bodyShape,
 52            skinColor = model.skinColor,
 53            hairColor = model.hairColor,
 54            eyeColor = model.eyeColor,
 55            wearables = model.wearables,
 56            forceRender = model.forceRender.ToList(),
 57            emotes = model.emotes,
 58            expressionTriggerId = model.expressionTriggerId,
 59            expressionTriggerTimestamp = model.expressionTriggerTimestamp,
 60            talking = model.talking,
 61        };
 62
 063        return avatarModelDto;
 64    }
 65}