< Summary

Information
Class: CounterDrone.Core.Simulation.EventQueue
Assembly: CounterDrone.Core
File(s): C:\Users\Tellme\apps\CounterDroneBackend\src\CounterDrone.Core\Simulation\SimTypes.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 6
Coverable lines: 6
Total lines: 56
Line coverage: 0%
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
.ctor()100%210%
Enqueue(...)100%210%
Dequeue()100%210%
get_Count()100%210%
get_HasEvents()100%210%
Clear()100%210%

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    {
 12        public Models.SimEventType Type { get; set; }
 13        public float OccurredAt { get; set; }
 14        public string SourceId { get; set; } = string.Empty;
 15        public string TargetId { get; set; } = string.Empty;
 16        public string DataJson { get; set; } = "{}";
 17        public string Description { get; set; } = string.Empty;
 18    }
 19
 20    public class EventQueue
 21    {
 022        private readonly Queue<SimEvent> _queue = new();
 023        public void Enqueue(SimEvent e) => _queue.Enqueue(e);
 024        public SimEvent Dequeue() => _queue.Dequeue();
 025        public int Count => _queue.Count;
 026        public bool HasEvents => _queue.Count > 0;
 027        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}