< Summary

Information
Class: CounterDrone.Core.Simulation.CloudEntity
Assembly: CounterDrone.Core
File(s): C:\Users\Tellme\apps\CounterDroneBackend\src\CounterDrone.Core\Simulation\CloudEntity.cs
Line coverage
95%
Covered lines: 22
Uncovered lines: 1
Coverable lines: 23
Total lines: 38
Line coverage: 95.6%
Branch coverage
50%
Covered branches: 1
Total branches: 2
Branch coverage: 50%
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_Dispersion()100%11100%
get_AerosolType()100%11100%
get_CreatedAt()100%210%
get_IsDissipated()100%11100%
.ctor(...)100%11100%
Tick(...)100%11100%
ContainsPoint(...)50%22100%

File(s)

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

#LineLine coverage
 1using System;
 2using CounterDrone.Core.Algorithms;
 3using CounterDrone.Core.Models;
 4
 5namespace CounterDrone.Core.Simulation
 6{
 7    public class CloudEntity
 8    {
 3649        public string Id { get; }
 439310        public ICloudDispersionModel Dispersion { get; }
 2511        public AerosolType AerosolType { get; }
 012        public float CreatedAt { get; }
 72813        public bool IsDissipated => Dispersion.IsDissipated;
 14
 1115        public CloudEntity(string id, AerosolType aerosolType, ICloudDispersionModel dispersion, float createdAt)
 1116        {
 1117            Id = id;
 1118            AerosolType = aerosolType;
 1119            Dispersion = dispersion;
 1120            CreatedAt = createdAt;
 1121        }
 22
 23        public void Tick(float deltaTime, float windSpeed, WindDirection windDir)
 36424        {
 36425            Dispersion.Tick(deltaTime, windSpeed, windDir);
 36426        }
 27
 28        public bool ContainsPoint(float x, float y, float z)
 36429        {
 36430            if (IsDissipated) return false;
 36431            var dx = x - Dispersion.Center.X;
 36432            var dy = y - Dispersion.Center.Y;
 36433            var dz = z - Dispersion.Center.Z;
 36434            var dist = (float)Math.Sqrt(dx * dx + dy * dy + dz * dz);
 36435            return dist <= Dispersion.EffectiveRadius;
 36436        }
 37    }
 38}