< Summary

Class:ActionAdapter
Assembly:BuilderInWorld
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/BuilderMode/ActionController/ActionAdapter.cs
Covered lines:0
Uncovered lines:16
Coverable lines:16
Total lines:52
Line coverage:0% (0 of 16)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
SetContent(...)0%42600%
RefreshIsDone()0%2100%
Selected()0%6200%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/BuilderMode/ActionController/ActionAdapter.cs

#LineLine coverage
 1using System.Collections;
 2using System.Collections.Generic;
 3using TMPro;
 4using UnityEngine;
 5using UnityEngine.UI;
 6
 7public class ActionAdapter : MonoBehaviour
 8{
 9    public Image actionImg, notDoneImg;
 10
 11    public Sprite moveSprite,
 12                  rotateSprite,
 13                  scaleSprite,
 14                  createdSprite;
 15
 16    public TextMeshProUGUI actionTitle;
 17    public System.Action<BuildInWorldCompleteAction, ActionAdapter> OnActionSelected;
 18
 19    BuildInWorldCompleteAction action;
 20
 21    public void SetContent(BuildInWorldCompleteAction action)
 22    {
 023        this.action = action;
 24
 025        switch (this.action.actionType)
 26        {
 27            case BuildInWorldCompleteAction.ActionType.MOVE:
 028                actionImg.sprite = moveSprite;
 029                break;
 30            case BuildInWorldCompleteAction.ActionType.ROTATE:
 031                actionImg.sprite = rotateSprite;
 032                break;
 33            case BuildInWorldCompleteAction.ActionType.SCALE:
 034                actionImg.sprite = scaleSprite;
 035                break;
 36            case BuildInWorldCompleteAction.ActionType.CREATE:
 037                actionImg.sprite = createdSprite;
 038                break;
 39
 40            default:
 041                actionImg.enabled = false;
 42                break;
 43        }
 44
 045        actionTitle.text = this.action.actionType.ToString().Replace("_", " ");
 046        RefreshIsDone();
 047    }
 48
 049    public void RefreshIsDone() { notDoneImg.enabled = !action.isDone; }
 50
 051    public void Selected() { OnActionSelected?.Invoke(action, this); }
 52}