< Summary

Class:TacticalSymbol
Assembly:bamlab.micromissiles
File(s):/github/workspace/Assets/Scripts/UI/TacticalSymbol.cs
Covered lines:0
Uncovered lines:55
Coverable lines:55
Total lines:84
Line coverage:0% (0 of 55)
Covered branches:0
Total branches:0
Covered methods:0
Total methods:11
Method coverage:0% (0 of 11)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
TacticalSymbol()0%2100%
SetSprite(...)0%12300%
SetDirectionArrowRotation(...)0%6200%
DisableDirectionArrow()0%6200%
SetUniqueDesignator(...)0%2100%
SetIFF(...)0%2100%
SetType(...)0%2100%
SetSpeedAlt(...)0%2100%
SetAdditionalInfo(...)0%2100%
Awake()0%2100%
SetText(...)0%6200%

File(s)

/github/workspace/Assets/Scripts/UI/TacticalSymbol.cs

#LineLine coverage
 1using TMPro;
 2using UnityEngine;
 3using UnityEngine.UI;
 4
 5public class TacticalSymbol : MonoBehaviour {
 6  [SerializeField]
 07  private GameObject _directionArrow = null!;
 8
 9  [SerializeField]
 010  private TextMeshProUGUI _uniqueDesignatorText = null!;
 11
 12  [SerializeField]
 013  private TextMeshProUGUI _iffText = null!;
 14
 15  [SerializeField]
 016  private TextMeshProUGUI _typeText = null!;
 17
 18  [SerializeField]
 019  private TextMeshProUGUI _speedAltText = null!;
 20
 21  [SerializeField]
 022  private TextMeshProUGUI _additionalInfoText = null!;
 23
 024  public void SetSprite(string spriteName) {
 025    spriteName = spriteName.ToUpper();
 26    // Update main symbol image.
 027    Image symbolImage = GetComponent<Image>();
 028    if (symbolImage != null) {
 029      Sprite symbolSprite = SpriteManager.LoadSymbolSprite(spriteName);
 030      if (symbolSprite != null) {
 031        symbolImage.sprite = symbolSprite;
 032      }
 033    }
 034  }
 35
 036  public void SetDirectionArrowRotation(float rotationDegrees) {
 037    if (_directionArrow != null) {
 038      _directionArrow.GetComponent<RectTransform>().rotation =
 39          Quaternion.Euler(0, 0, rotationDegrees);
 040    }
 041  }
 42
 043  public void DisableDirectionArrow() {
 044    if (_directionArrow != null) {
 045      _directionArrow.SetActive(false);
 046    } else {
 047      Debug.LogWarning($"Direction arrow not found on TacticalSymbol {name}.");
 048    }
 049  }
 50
 051  public void SetUniqueDesignator(string text) {
 052    SetText(_uniqueDesignatorText, text);
 053  }
 54
 055  public void SetIFF(string text) {
 056    SetText(_iffText, text);
 057  }
 58
 059  public void SetType(string text) {
 060    SetText(_typeText, text);
 061  }
 62
 063  public void SetSpeedAlt(string text) {
 064    SetText(_speedAltText, text);
 065  }
 66
 067  public void SetAdditionalInfo(string text) {
 068    SetText(_additionalInfoText, text);
 069  }
 70
 071  private void Awake() {
 072    _uniqueDesignatorText.text = "";
 073    _iffText.text = "";
 074    _typeText.text = "";
 075    _speedAltText.text = "";
 076    _additionalInfoText.text = "";
 077  }
 78
 079  private void SetText(TextMeshProUGUI textComponent, string text) {
 080    if (textComponent != null) {
 081      textComponent.text = text.ToUpper();
 082    }
 083  }
 84}