添加 .editorconfig + dotnet format 格式化全部代码

This commit is contained in:
tian 2026-06-11 16:48:22 +08:00
parent cde7702b12
commit 2697225aff
19 changed files with 255 additions and 63 deletions

19
.editorconfig Normal file
View File

@ -0,0 +1,19 @@
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = crlf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.cs]
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_space_after_cast = false
csharp_space_after_keywords_in_control_flow_statements = true

View File

@ -9,8 +9,8 @@ namespace CounterDrone.Core.Algorithms
private static readonly Dictionary<Type, Func<object>> _registry = new() private static readonly Dictionary<Type, Func<object>> _registry = new()
{ {
[typeof(ICloudDispersionModel)] = () => new GaussianPuffDispersion(), [typeof(ICloudDispersionModel)] = () => new GaussianPuffDispersion(),
[typeof(IDamageModel)] = () => new DamageModelRouter(), [typeof(IDamageModel)] = () => new DamageModelRouter(),
[typeof(IDefenseAdvisor)] = () => new DefaultDefenseAdvisor(null), [typeof(IDefenseAdvisor)] = () => new DefaultDefenseAdvisor(null),
}; };
public static void Register<TInterface>(Func<object> factory) public static void Register<TInterface>(Func<object> factory)

View File

@ -167,7 +167,8 @@ namespace CounterDrone.Core.Algorithms
{ {
AerosolType = (int)aerosolType, AerosolType = (int)aerosolType,
PositionX = start.X + (end.X - start.X) * 0.25f, PositionX = start.X + (end.X - start.X) * 0.25f,
PositionY = start.Y, PositionZ = start.Z, PositionY = start.Y,
PositionZ = start.Z,
DisperseHeight = (float)target.TypicalAltitude, DisperseHeight = (float)target.TypicalAltitude,
Duration = (int)maxDur, Duration = (int)maxDur,
Source = "Algorithm", Source = "Algorithm",

View File

@ -3,7 +3,7 @@ using CounterDrone.Core.Models;
namespace CounterDrone.Core.Algorithms namespace CounterDrone.Core.Algorithms
{ {
/// <summary>云团扩散模型接口</summary> /// <summary>云团扩散模型接口</summary>
public interface ICloudDispersionModel public interface ICloudDispersionModel
{ {
void Initialize(AmmunitionSpec ammo, CombatScene env, Vector3 releasePos, float releaseTime); void Initialize(AmmunitionSpec ammo, CombatScene env, Vector3 releasePos, float releaseTime);
void Tick(float deltaTime, float windSpeed, WindDirection windDir); void Tick(float deltaTime, float windSpeed, WindDirection windDir);

View File

@ -3,7 +3,7 @@ using CounterDrone.Core.Models;
namespace CounterDrone.Core.Algorithms namespace CounterDrone.Core.Algorithms
{ {
/// <summary>毁伤模型接口</summary> /// <summary>毁伤模型接口</summary>
public interface IDamageModel public interface IDamageModel
{ {
float CalculateDamage(TargetType droneType, PowerType powerType, float CalculateDamage(TargetType droneType, PowerType powerType,
AerosolType aerosolType, float cloudDensity, float exposureTime, float deltaTime); AerosolType aerosolType, float cloudDensity, float exposureTime, float deltaTime);

View File

@ -3,7 +3,7 @@ using CounterDrone.Core.Models;
namespace CounterDrone.Core.Algorithms namespace CounterDrone.Core.Algorithms
{ {
/// <summary>防御推荐接口 — 威胁驱动</summary> /// <summary>防御推荐接口 — 威胁驱动</summary>
public interface IDefenseAdvisor public interface IDefenseAdvisor
{ {
DefenseRecommendation Recommend(ThreatProfile threat); DefenseRecommendation Recommend(ThreatProfile threat);
} }

View File

@ -4,7 +4,7 @@ using CounterDrone.Core.Models;
namespace CounterDrone.Core.Services namespace CounterDrone.Core.Services
{ {
/// <summary>模型管理服务 — 3D 模型的导入、删除、查询</summary> /// <summary>模型管理服务 — 3D 模型的导入、删除、查询</summary>
public interface IModelService public interface IModelService
{ {
ModelInfo ImportModel(string filePath, string name); ModelInfo ImportModel(string filePath, string name);
void DeleteModel(string id); void DeleteModel(string id);

View File

@ -5,7 +5,7 @@ using SimEvent = CounterDrone.Core.Simulation.SimEvent;
namespace CounterDrone.Core.Services namespace CounterDrone.Core.Services
{ {
/// <summary>报告服务</summary> /// <summary>报告服务</summary>
public interface IReportService public interface IReportService
{ {
SimulationReport Generate(string taskId, TaskFullConfig config, SimulationReport Generate(string taskId, TaskFullConfig config,
List<SimEvent> events, string finalDroneStatus, float duration); List<SimEvent> events, string finalDroneStatus, float duration);

View File

@ -4,7 +4,7 @@ using CounterDrone.Core.Models;
namespace CounterDrone.Core.Services namespace CounterDrone.Core.Services
{ {
/// <summary>想定管理服务</summary> /// <summary>想定管理服务</summary>
public interface IScenarioService public interface IScenarioService
{ {
SimTask CreateTask(string name, string taskNumber); SimTask CreateTask(string name, string taskNumber);
void DeleteTask(string id); void DeleteTask(string id);

View File

@ -74,7 +74,10 @@ namespace CounterDrone.Core.Services
return new PagedResult<SimulationReport> return new PagedResult<SimulationReport>
{ {
Items = items, TotalCount = total, Page = page, PageSize = pageSize, Items = items,
TotalCount = total,
Page = page,
PageSize = pageSize,
}; };
} }

View File

@ -20,7 +20,7 @@ namespace CounterDrone.Core.Simulation
/// <summary>仿真引擎 — 纯执行器,不包含任何决策逻辑</summary> /// <summary>仿真引擎 — 纯执行器,不包含任何决策逻辑</summary>
/// <summary>仿真引擎 — 纯执行器,接收发射计划按时间表执行</summary> /// <summary>仿真引擎 — 纯执行器,接收发射计划按时间表执行</summary>
public class SimulationEngine public class SimulationEngine
{ {
private readonly IScenarioService _scenarioService; private readonly IScenarioService _scenarioService;
private readonly FrameDataStore _frameStore; private readonly FrameDataStore _frameStore;
@ -162,8 +162,10 @@ public class SimulationEngine
_munitions.Add(m); _munitions.Add(m);
frameEvents.Add(new SimEvent frameEvents.Add(new SimEvent
{ {
Type = SimEventType.MunitionLaunched, OccurredAt = SimulationTime, Type = SimEventType.MunitionLaunched,
SourceId = platform.Id, Description = $"计划发射 {m.Id}", OccurredAt = SimulationTime,
SourceId = platform.Id,
Description = $"计划发射 {m.Id}",
}); });
} }
} }
@ -181,7 +183,8 @@ public class SimulationEngine
_munitions.Remove(m); _munitions.Remove(m);
frameEvents.Add(new SimEvent frameEvents.Add(new SimEvent
{ {
Type = SimEventType.CloudGenerated, OccurredAt = SimulationTime, Type = SimEventType.CloudGenerated,
OccurredAt = SimulationTime,
Description = $"云团生成", Description = $"云团生成",
}); });
} }
@ -209,8 +212,10 @@ public class SimulationEngine
if (drone.Status == DroneStatus.Destroyed) if (drone.Status == DroneStatus.Destroyed)
frameEvents.Add(new SimEvent frameEvents.Add(new SimEvent
{ {
Type = SimEventType.DroneDestroyed, OccurredAt = SimulationTime, Type = SimEventType.DroneDestroyed,
TargetId = drone.Id, Description = $"无人机 {drone.Id} 被摧毁", OccurredAt = SimulationTime,
TargetId = drone.Id,
Description = $"无人机 {drone.Id} 被摧毁",
}); });
} }
} }
@ -223,8 +228,10 @@ public class SimulationEngine
if (drone.Status == DroneStatus.ReachedTarget) if (drone.Status == DroneStatus.ReachedTarget)
frameEvents.Add(new SimEvent frameEvents.Add(new SimEvent
{ {
Type = SimEventType.DroneReachedTarget, OccurredAt = SimulationTime, Type = SimEventType.DroneReachedTarget,
SourceId = drone.Id, Description = "到达攻击目标", OccurredAt = SimulationTime,
SourceId = drone.Id,
Description = "到达攻击目标",
}); });
} }
@ -241,8 +248,11 @@ public class SimulationEngine
drone.MarkZoneIntruded(); drone.MarkZoneIntruded();
frameEvents.Add(new SimEvent frameEvents.Add(new SimEvent
{ {
Type = SimEventType.ZoneIntruded, OccurredAt = SimulationTime, Type = SimEventType.ZoneIntruded,
SourceId = drone.Id, TargetId = zone.Id, Description = $"侵入 {zone.Name}", OccurredAt = SimulationTime,
SourceId = drone.Id,
TargetId = zone.Id,
Description = $"侵入 {zone.Name}",
}); });
} }
} }
@ -264,8 +274,11 @@ public class SimulationEngine
return new SimulationFrameResult return new SimulationFrameResult
{ {
EntitySnapshots = snapshots, NewEvents = frameEvents, EntitySnapshots = snapshots,
State = State, FrameIndex = FrameIndex, SimulationTime = SimulationTime, NewEvents = frameEvents,
State = State,
FrameIndex = FrameIndex,
SimulationTime = SimulationTime,
}; };
} }
@ -281,16 +294,22 @@ public class SimulationEngine
var stage = _damageModel.GetDamageStage(1 - d.Hp); var stage = _damageModel.GetDamageStage(1 - d.Hp);
list.Add(new EntitySnapshot list.Add(new EntitySnapshot
{ {
EntityId = d.Id, EntityType = Models.EntityType.Drone, EntityId = d.Id,
PosX = d.PosX, PosY = d.PosY, PosZ = d.PosZ, EntityType = Models.EntityType.Drone,
PosX = d.PosX,
PosY = d.PosY,
PosZ = d.PosZ,
StateData = JsonSerializer.Serialize(new { damageStage = (int)stage, hp = d.Hp }), StateData = JsonSerializer.Serialize(new { damageStage = (int)stage, hp = d.Hp }),
}); });
} }
foreach (var c in _clouds) foreach (var c in _clouds)
list.Add(new EntitySnapshot list.Add(new EntitySnapshot
{ {
EntityId = c.Id, EntityType = Models.EntityType.Cloud, EntityId = c.Id,
PosX = c.Dispersion.Center.X, PosY = c.Dispersion.Center.Y, PosZ = c.Dispersion.Center.Z, EntityType = Models.EntityType.Cloud,
PosX = c.Dispersion.Center.X,
PosY = c.Dispersion.Center.Y,
PosZ = c.Dispersion.Center.Z,
StateData = JsonSerializer.Serialize(new { radius = c.Dispersion.Radius, opacity = c.Dispersion.Particles.Opacity }), StateData = JsonSerializer.Serialize(new { radius = c.Dispersion.Radius, opacity = c.Dispersion.Particles.Opacity }),
}); });
return list; return list;

View File

@ -0,0 +1,47 @@
# 仿真评估报告
**任务名称**:喷气拦截
**任务编号**SIM-20260611-004
**仿真耗时**106.4 秒
## 一、仿真前 — 我方配置
| 配置项 | 值 |
|--------|-----|
| 目标数量 | 1 |
| 发射平台 | 6 台 |
| 探测设备 | 1 台 |
| 气溶胶类型 | ActiveMaterial |
## 二、仿真中 — 关键事件时序
| 时间(s) | 事件 | 描述 |
|---------|------|------|
| 92.2 | MunitionLaunched | 计划发射 mun_1 |
| 92.2 | MunitionLaunched | 计划发射 mun_2 |
| 92.2 | MunitionLaunched | 计划发射 mun_3 |
| 92.2 | MunitionLaunched | 计划发射 mun_4 |
| 92.2 | MunitionLaunched | 计划发射 mun_5 |
| 92.2 | MunitionLaunched | 计划发射 mun_6 |
| 101.8 | CloudGenerated | 云团生成 |
| 101.8 | CloudGenerated | 云团生成 |
| 101.8 | CloudGenerated | 云团生成 |
| 101.8 | CloudGenerated | 云团生成 |
| 101.8 | CloudGenerated | 云团生成 |
| 101.8 | CloudGenerated | 云团生成 |
| 106.4 | DroneDestroyed | 无人机 drone_1 被摧毁 |
| 106.4 | SimulationEnd | |
## 三、仿真后 — 数据统计
| 统计项 | 值 |
|--------|-----|
| 无人机总数 | 1 |
| 被摧毁 | 1 |
| 到达目标 | 0 |
| 侵入管控区 | 0 |
| 弹药发射次数 | 6 |
| 云团生成次数 | 6 |
**对抗结果**:成功拦截

View File

@ -0,0 +1,46 @@
# 仿真评估报告
**任务名称**:活塞拦截
**任务编号**SIM-20260611-041
**仿真耗时**185.6 秒
## 一、仿真前 — 我方配置
| 配置项 | 值 |
|--------|-----|
| 目标数量 | 1 |
| 发射平台 | 5 台 |
| 探测设备 | 1 台 |
| 气溶胶类型 | InertGas |
## 二、仿真中 — 关键事件时序
| 时间(s) | 事件 | 描述 |
|---------|------|------|
| 167.4 | MunitionLaunched | 计划发射 mun_1 |
| 167.4 | MunitionLaunched | 计划发射 mun_2 |
| 167.4 | MunitionLaunched | 计划发射 mun_3 |
| 167.4 | MunitionLaunched | 计划发射 mun_4 |
| 167.4 | MunitionLaunched | 计划发射 mun_5 |
| 177.0 | CloudGenerated | 云团生成 |
| 177.0 | CloudGenerated | 云团生成 |
| 177.0 | CloudGenerated | 云团生成 |
| 177.0 | CloudGenerated | 云团生成 |
| 177.0 | CloudGenerated | 云团生成 |
| 185.6 | DroneDestroyed | 无人机 drone_1 被摧毁 |
| 185.6 | DroneDestroyed | 无人机 drone_1 被摧毁 |
| 185.6 | SimulationEnd | |
## 三、仿真后 — 数据统计
| 统计项 | 值 |
|--------|-----|
| 无人机总数 | 1 |
| 被摧毁 | 2 |
| 到达目标 | 0 |
| 侵入管控区 | 0 |
| 弹药发射次数 | 5 |
| 云团生成次数 | 5 |
**对抗结果**:成功拦截

View File

@ -38,8 +38,10 @@ namespace CounterDrone.Core.Tests
public bool IsDissipated => false; public bool IsDissipated => false;
public void Initialize(CounterDrone.Core.Models.AmmunitionSpec ammo, public void Initialize(CounterDrone.Core.Models.AmmunitionSpec ammo,
CounterDrone.Core.Models.CombatScene env, Vector3 releasePos, float releaseTime) { } CounterDrone.Core.Models.CombatScene env, Vector3 releasePos, float releaseTime)
{ }
public void Tick(float deltaTime, float windSpeed, public void Tick(float deltaTime, float windSpeed,
CounterDrone.Core.Models.WindDirection windDir) { } CounterDrone.Core.Models.WindDirection windDir)
{ }
} }
} }

View File

@ -61,15 +61,18 @@ namespace CounterDrone.Core.Tests
{ {
_repo.Insert(new AmmunitionSpec _repo.Insert(new AmmunitionSpec
{ {
Name = "Inert-A", AerosolType = (int)AerosolType.InertGas Name = "Inert-A",
AerosolType = (int)AerosolType.InertGas
}); });
_repo.Insert(new AmmunitionSpec _repo.Insert(new AmmunitionSpec
{ {
Name = "Inert-B", AerosolType = (int)AerosolType.InertGas Name = "Inert-B",
AerosolType = (int)AerosolType.InertGas
}); });
_repo.Insert(new AmmunitionSpec _repo.Insert(new AmmunitionSpec
{ {
Name = "Active-A", AerosolType = (int)AerosolType.ActiveMaterial Name = "Active-A",
AerosolType = (int)AerosolType.ActiveMaterial
}); });
var inertSpecs = _repo.GetByAerosolType((int)AerosolType.InertGas); var inertSpecs = _repo.GetByAerosolType((int)AerosolType.InertGas);

View File

@ -28,9 +28,13 @@ namespace CounterDrone.Core.Tests
_db.Insert(new AmmunitionSpec _db.Insert(new AmmunitionSpec
{ {
AerosolType = (int)AerosolType.InertGas, InitialRadius = 50, AerosolType = (int)AerosolType.InertGas,
CoreDensity = 1.0, DispersionRateBase = 5, MaxRadius = 500, InitialRadius = 50,
MaxDuration = 120, EffectiveConcentration = 0.05, CoreDensity = 1.0,
DispersionRateBase = 5,
MaxRadius = 500,
MaxDuration = 120,
EffectiveConcentration = 0.05,
}); });
_scenario = new ScenarioService( _scenario = new ScenarioService(
@ -55,8 +59,10 @@ namespace CounterDrone.Core.Tests
_scenario.SaveScene(_taskId, new CombatScene { WindSpeed = 0 }); _scenario.SaveScene(_taskId, new CombatScene { WindSpeed = 0 });
_scenario.SaveTarget(_taskId, new TargetConfig _scenario.SaveTarget(_taskId, new TargetConfig
{ {
TargetType = (int)TargetType.Piston, Quantity = 1, TargetType = (int)TargetType.Piston,
TypicalSpeed = 100, TypicalAltitude = 300, Quantity = 1,
TypicalSpeed = 100,
TypicalAltitude = 300,
}); });
_scenario.SaveDeployment(_taskId, new List<EquipmentDeployment>()); _scenario.SaveDeployment(_taskId, new List<EquipmentDeployment>());
_scenario.SaveCloudDispersal(_taskId, new CloudDispersal()); _scenario.SaveCloudDispersal(_taskId, new CloudDispersal());
@ -95,7 +101,8 @@ namespace CounterDrone.Core.Tests
}); });
_scenario.SaveTarget(_taskId, new TargetConfig _scenario.SaveTarget(_taskId, new TargetConfig
{ {
TargetType = (int)TargetType.Piston, Quantity = 1, TargetType = (int)TargetType.Piston,
Quantity = 1,
TypicalSpeed = 600, // 高速对抗强风 TypicalSpeed = 600, // 高速对抗强风
}); });
_scenario.SaveDeployment(_taskId, new List<EquipmentDeployment>()); _scenario.SaveDeployment(_taskId, new List<EquipmentDeployment>());
@ -132,7 +139,8 @@ namespace CounterDrone.Core.Tests
_scenario.SaveScene(_taskId, new CombatScene { WindSpeed = 0 }); _scenario.SaveScene(_taskId, new CombatScene { WindSpeed = 0 });
_scenario.SaveTarget(_taskId, new TargetConfig _scenario.SaveTarget(_taskId, new TargetConfig
{ {
TargetType = (int)TargetType.HighSpeed, Quantity = 1, TargetType = (int)TargetType.HighSpeed,
Quantity = 1,
TypicalSpeed = 500, TypicalSpeed = 500,
}); });
_scenario.SaveDeployment(_taskId, new List<EquipmentDeployment>()); _scenario.SaveDeployment(_taskId, new List<EquipmentDeployment>());

View File

@ -32,23 +32,38 @@ namespace CounterDrone.Core.Tests
_mainDb.Insert(new AmmunitionSpec _mainDb.Insert(new AmmunitionSpec
{ {
Id = "ammo-inert", AerosolType = (int)AerosolType.InertGas, Id = "ammo-inert",
Name = "惰性气体弹", InitialRadius = 50, CoreDensity = 1.0, AerosolType = (int)AerosolType.InertGas,
DispersionRateBase = 5, MaxRadius = 500, MaxDuration = 120, Name = "惰性气体弹",
InitialRadius = 50,
CoreDensity = 1.0,
DispersionRateBase = 5,
MaxRadius = 500,
MaxDuration = 120,
EffectiveConcentration = 0.05, EffectiveConcentration = 0.05,
}); });
_mainDb.Insert(new AmmunitionSpec _mainDb.Insert(new AmmunitionSpec
{ {
Id = "ammo-active", AerosolType = (int)AerosolType.ActiveMaterial, Id = "ammo-active",
Name = "活性材料弹", InitialRadius = 30, CoreDensity = 2.0, AerosolType = (int)AerosolType.ActiveMaterial,
DispersionRateBase = 3, MaxRadius = 400, MaxDuration = 90, Name = "活性材料弹",
InitialRadius = 30,
CoreDensity = 2.0,
DispersionRateBase = 3,
MaxRadius = 400,
MaxDuration = 90,
EffectiveConcentration = 0.1, EffectiveConcentration = 0.1,
}); });
_mainDb.Insert(new AmmunitionSpec _mainDb.Insert(new AmmunitionSpec
{ {
Id = "ammo-fuel", AerosolType = (int)AerosolType.ActiveFuel, Id = "ammo-fuel",
Name = "活性燃料弹", InitialRadius = 40, CoreDensity = 1.5, AerosolType = (int)AerosolType.ActiveFuel,
DispersionRateBase = 4, MaxRadius = 450, MaxDuration = 100, Name = "活性燃料弹",
InitialRadius = 40,
CoreDensity = 1.5,
DispersionRateBase = 4,
MaxRadius = 450,
MaxDuration = 100,
EffectiveConcentration = 0.03, EffectiveConcentration = 0.03,
}); });
@ -150,7 +165,9 @@ namespace CounterDrone.Core.Tests
{ {
FireTime = fireTime, FireTime = fireTime,
PlatformIndex = r % platforms.Count, PlatformIndex = r % platforms.Count,
TargetX = tx, TargetY = ty, TargetZ = tz, TargetX = tx,
TargetY = ty,
TargetZ = tz,
MuzzleVelocity = muzzleV, MuzzleVelocity = muzzleV,
}); });
} }
@ -193,7 +210,9 @@ namespace CounterDrone.Core.Tests
{ {
EquipmentRole = (int)EquipmentRole.Detection, EquipmentRole = (int)EquipmentRole.Detection,
Quantity = d.Quantity, Quantity = d.Quantity,
PositionX = d.Position.X, PositionY = d.Position.Y, PositionZ = d.Position.Z, PositionX = d.Position.X,
PositionY = d.Position.Y,
PositionZ = d.Position.Z,
DetectionRadius = d.DetectionRadius, DetectionRadius = d.DetectionRadius,
}); });
foreach (var p in rec.Best.Platforms) foreach (var p in rec.Best.Platforms)
@ -202,7 +221,9 @@ namespace CounterDrone.Core.Tests
EquipmentRole = (int)EquipmentRole.LaunchPlatform, EquipmentRole = (int)EquipmentRole.LaunchPlatform,
PlatformType = (int)p.Type, PlatformType = (int)p.Type,
Quantity = p.Quantity, Quantity = p.Quantity,
PositionX = p.Position.X, PositionY = p.Position.Y, PositionZ = p.Position.Z, PositionX = p.Position.X,
PositionY = p.Position.Y,
PositionZ = p.Position.Z,
AerosolType = (int)rec.Best.RecommendedAerosolType, AerosolType = (int)rec.Best.RecommendedAerosolType,
MunitionCount = p.MunitionCount, MunitionCount = p.MunitionCount,
Cooldown = p.Cooldown, Cooldown = p.Cooldown,
@ -243,7 +264,9 @@ namespace CounterDrone.Core.Tests
{ {
TargetType = (int)TargetType.FixedWing, TargetType = (int)TargetType.FixedWing,
PowerType = (int)PowerType.Jet, PowerType = (int)PowerType.Jet,
Quantity = 1, TypicalSpeed = 600, TypicalAltitude = 400, Quantity = 1,
TypicalSpeed = 600,
TypicalAltitude = 400,
}); });
_scenario.SaveRoute(_taskId, new RoutePlan { FormationMode = (int)FormationMode.Single }, _scenario.SaveRoute(_taskId, new RoutePlan { FormationMode = (int)FormationMode.Single },
new List<Waypoint> new List<Waypoint>
@ -273,7 +296,9 @@ namespace CounterDrone.Core.Tests
{ {
TargetType = (int)TargetType.Electric, TargetType = (int)TargetType.Electric,
PowerType = (int)PowerType.Electric, PowerType = (int)PowerType.Electric,
Quantity = 1, TypicalSpeed = 300, TypicalAltitude = 300, Quantity = 1,
TypicalSpeed = 300,
TypicalAltitude = 300,
}); });
_scenario.SaveRoute(_taskId, new RoutePlan { FormationMode = (int)FormationMode.Single }, _scenario.SaveRoute(_taskId, new RoutePlan { FormationMode = (int)FormationMode.Single },
new List<Waypoint> new List<Waypoint>
@ -309,13 +334,16 @@ namespace CounterDrone.Core.Tests
_scenario.SaveScene(_taskId, new CombatScene _scenario.SaveScene(_taskId, new CombatScene
{ {
WindSpeed = 3, WindDirection = (int)WindDirection.W, WindSpeed = 3,
WindDirection = (int)WindDirection.W,
}); });
_scenario.SaveTarget(_taskId, new TargetConfig _scenario.SaveTarget(_taskId, new TargetConfig
{ {
TargetType = (int)TargetType.Piston, TargetType = (int)TargetType.Piston,
PowerType = (int)PowerType.Piston, PowerType = (int)PowerType.Piston,
Quantity = 1, TypicalSpeed = 200, TypicalAltitude = 500, Quantity = 1,
TypicalSpeed = 200,
TypicalAltitude = 500,
}); });
_scenario.SaveRoute(_taskId, new RoutePlan { FormationMode = (int)FormationMode.Single }, _scenario.SaveRoute(_taskId, new RoutePlan { FormationMode = (int)FormationMode.Single },
new List<Waypoint> new List<Waypoint>
@ -380,7 +408,9 @@ namespace CounterDrone.Core.Tests
{ {
TargetType = (int)TargetType.HighSpeed, TargetType = (int)TargetType.HighSpeed,
PowerType = (int)PowerType.Jet, PowerType = (int)PowerType.Jet,
Quantity = 1, TypicalSpeed = 500, TypicalAltitude = 800, Quantity = 1,
TypicalSpeed = 500,
TypicalAltitude = 800,
}); });
_scenario.SaveRoute(_taskId, new RoutePlan { FormationMode = (int)FormationMode.Single }, _scenario.SaveRoute(_taskId, new RoutePlan { FormationMode = (int)FormationMode.Single },
new List<Waypoint> new List<Waypoint>

View File

@ -426,7 +426,9 @@ namespace CounterDrone.Core.Tests
AerosolType = (int)AerosolType.ActiveMaterial, AerosolType = (int)AerosolType.ActiveMaterial,
TriggerMode = (int)TriggerMode.Area, TriggerMode = (int)TriggerMode.Area,
Duration = 50.0, Duration = 50.0,
PositionX = 3000, PositionY = 0, PositionZ = 300, PositionX = 3000,
PositionY = 0,
PositionZ = 300,
}); });
_service.UpdateStep(task.Id, 4); _service.UpdateStep(task.Id, 4);

View File

@ -30,9 +30,14 @@ namespace CounterDrone.Core.Tests
_mainDb.Insert(new AmmunitionSpec _mainDb.Insert(new AmmunitionSpec
{ {
AerosolType = (int)AerosolType.InertGas, Name = "Test Ammo", AerosolType = (int)AerosolType.InertGas,
InitialRadius = 50, CoreDensity = 1.0, DispersionRateBase = 5, Name = "Test Ammo",
MaxRadius = 500, MaxDuration = 120, EffectiveConcentration = 0.05, InitialRadius = 50,
CoreDensity = 1.0,
DispersionRateBase = 5,
MaxRadius = 500,
MaxDuration = 120,
EffectiveConcentration = 0.05,
}); });
_scenarioService = new ScenarioService( _scenarioService = new ScenarioService(
@ -59,8 +64,10 @@ namespace CounterDrone.Core.Tests
_scenarioService.SaveScene(_taskId, new CombatScene { WindSpeed = 0 }); _scenarioService.SaveScene(_taskId, new CombatScene { WindSpeed = 0 });
_scenarioService.SaveTarget(_taskId, new TargetConfig _scenarioService.SaveTarget(_taskId, new TargetConfig
{ {
TargetType = (int)TargetType.Piston, Quantity = 1, TargetType = (int)TargetType.Piston,
PowerType = (int)PowerType.Piston, TypicalSpeed = 60, Quantity = 1,
PowerType = (int)PowerType.Piston,
TypicalSpeed = 60,
}); });
_scenarioService.SaveDeployment(_taskId, new List<EquipmentDeployment> _scenarioService.SaveDeployment(_taskId, new List<EquipmentDeployment>
{ {
@ -74,8 +81,13 @@ namespace CounterDrone.Core.Tests
}); });
_scenarioService.SaveCloudDispersal(_taskId, new CloudDispersal _scenarioService.SaveCloudDispersal(_taskId, new CloudDispersal
{ {
AerosolType = (int)AerosolType.InertGas, DisperseHeight = 300, Duration = 60, AerosolType = (int)AerosolType.InertGas,
RecommendedTiming = 10, PositionX = 1000, PositionY = 300, PositionZ = 0, DisperseHeight = 300,
Duration = 60,
RecommendedTiming = 10,
PositionX = 1000,
PositionY = 300,
PositionZ = 0,
PositionMode = (int)PositionMode.AlgorithmRecommended, PositionMode = (int)PositionMode.AlgorithmRecommended,
}); });
_scenarioService.SaveRoute(_taskId, new RoutePlan { FormationMode = (int)FormationMode.Single }, _scenarioService.SaveRoute(_taskId, new RoutePlan { FormationMode = (int)FormationMode.Single },