< Summary

Information
Class: CounterDrone.Core.Simulation.PlatformEntity
Assembly: CounterDrone.Core
File(s): C:\Users\Tellme\apps\CounterDroneBackend\src\CounterDrone.Core\Simulation\PlatformEntity.cs
Line coverage
96%
Covered lines: 30
Uncovered lines: 1
Coverable lines: 31
Total lines: 44
Line coverage: 96.7%
Branch coverage
62%
Covered branches: 5
Total branches: 8
Branch coverage: 62.5%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Id()100%11100%
get_Role()100%210%
get_PlatformType()100%11100%
get_PosX()100%11100%
get_PosY()100%11100%
get_PosZ()100%11100%
get_AerosolType()100%11100%
get_MunitionCount()100%11100%
get_Cooldown()100%11100%
get_CooldownRemaining()100%11100%
get_Ready()50%22100%
.ctor(...)50%44100%
Update(...)100%22100%
Fire()100%11100%

File(s)

C:\Users\Tellme\apps\CounterDroneBackend\src\CounterDrone.Core\Simulation\PlatformEntity.cs

#LineLine coverage
 1using CounterDrone.Core.Models;
 2
 3namespace CounterDrone.Core.Simulation
 4{
 5    public class PlatformEntity
 6    {
 117        public string Id { get; }
 08        public EquipmentRole Role { get; }
 119        public PlatformType? PlatformType { get; }
 2710        public float PosX { get; private set; }
 2711        public float PosY { get; private set; }
 2712        public float PosZ { get; private set; }
 1113        public AerosolType? AerosolType { get; }
 4914        public int MunitionCount { get; private set; }
 1115        public float Cooldown { get; }
 843816        public float CooldownRemaining { get; private set; }
 1117        public bool Ready => CooldownRemaining <= 0 && MunitionCount > 0;
 18
 1619        public PlatformEntity(string id, EquipmentDeployment config)
 1620        {
 1621            Id = id;
 1622            Role = (EquipmentRole)config.EquipmentRole;
 1623            PlatformType = config.PlatformType.HasValue ? (PlatformType?)config.PlatformType.Value : null;
 1624            PosX = (float)config.PositionX;
 1625            PosY = (float)config.PositionY;
 1626            PosZ = (float)config.PositionZ;
 1627            AerosolType = config.AerosolType.HasValue ? (AerosolType?)config.AerosolType.Value : null;
 1628            MunitionCount = config.MunitionCount ?? 3;
 1629            Cooldown = (float)config.Cooldown;
 1630        }
 31
 32        public void Update(float deltaTime)
 784433        {
 784434            if (CooldownRemaining > 0)
 28635                CooldownRemaining -= deltaTime;
 784436        }
 37
 38        public void Fire()
 1139        {
 1140            MunitionCount--;
 1141            CooldownRemaining = Cooldown;
 1142        }
 43    }
 44}