< Summary

Information
Class: CounterDrone.Core.Simulation.SimEvent
Assembly: CounterDrone.Core
File(s): C:\Users\Tellme\apps\CounterDroneBackend\src\CounterDrone.Core\Simulation\SimTypes.cs
Line coverage
100%
Covered lines: 6
Uncovered lines: 0
Coverable lines: 6
Total lines: 56
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Type()100%11100%
get_OccurredAt()100%11100%
get_SourceId()100%11100%
get_TargetId()100%11100%
get_DataJson()100%11100%
get_Description()100%11100%

File(s)

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

#LineLine coverage
 1using System.Collections.Generic;
 2
 3namespace CounterDrone.Core.Simulation
 4{
 5    public enum SimulationState
 6    {
 7        Idle, Running, Paused, Stopped, Completed,
 8    }
 9
 10    public class SimEvent
 11    {
 51712        public Models.SimEventType Type { get; set; }
 15413        public float OccurredAt { get; set; }
 5614        public string SourceId { get; set; } = string.Empty;
 4415        public string TargetId { get; set; } = string.Empty;
 4016        public string DataJson { get; set; } = "{}";
 13017        public string Description { get; set; } = string.Empty;
 18    }
 19
 20    public class EventQueue
 21    {
 22        private readonly Queue<SimEvent> _queue = new();
 23        public void Enqueue(SimEvent e) => _queue.Enqueue(e);
 24        public SimEvent Dequeue() => _queue.Dequeue();
 25        public int Count => _queue.Count;
 26        public bool HasEvents => _queue.Count > 0;
 27        public void Clear() => _queue.Clear();
 28    }
 29
 30    public class SimulationFrameResult
 31    {
 32        public List<EntitySnapshot> EntitySnapshots { get; set; } = new();
 33        public List<SimEvent> NewEvents { get; set; } = new();
 34        public SimulationState State { get; set; }
 35        public int FrameIndex { get; set; }
 36        public float SimulationTime { get; set; }
 37    }
 38
 39    public class EntitySnapshot
 40    {
 41        public string EntityId { get; set; } = string.Empty;
 42        public Models.EntityType EntityType { get; set; }
 43        public float PosX { get; set; }
 44        public float PosY { get; set; }
 45        public float PosZ { get; set; }
 46        public float RotX { get; set; }
 47        public float RotY { get; set; }
 48        public float RotZ { get; set; }
 49        public string StateData { get; set; } = "{}";
 50    }
 51
 52    public enum DroneStatus
 53    {
 54        Flying, Destroyed, ReachedTarget, ZoneIntruded,
 55    }
 56}