|
@@ -37,12 +37,12 @@ public class CreateMHTaskEventHandler : AEvent<CreateMHTask>
|
|
|
foreach (MHTask mhTask in config.MHTaskConfig.mHTask)
|
|
|
{
|
|
|
Log.Info($"创建灭火任务 : {mhTask.missionInformation.MissionName}");
|
|
|
- if(mhTask.missionInformation.AircraftInfos == null) continue;
|
|
|
- for (int i = 0; i < mhTask.missionInformation.AircraftInfos.Length; i++)
|
|
|
+ if(mhTask.missionInformation.aircraftInfos == null) continue;
|
|
|
+ for (int i = 0; i < mhTask.missionInformation.aircraftInfos.Length; i++)
|
|
|
{
|
|
|
//飞机参数
|
|
|
var aircraftParameter = config.EditorConfig.aircraftParameters.Find(
|
|
|
- a => a.AircraftID == mhTask.missionInformation.AircraftInfos[i]);
|
|
|
+ a => a.AircraftID == mhTask.missionInformation.aircraftInfos[i].AircraftType);
|
|
|
//基地
|
|
|
var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
|
|
|
|
|
@@ -51,8 +51,8 @@ public class CreateMHTaskEventHandler : AEvent<CreateMHTask>
|
|
|
|
|
|
AircraftMH aircraft = ComponentFactory.Create<AircraftMH, FlightPlanEditor>( flightPlanEditor);
|
|
|
|
|
|
- aircraft.Name = mhTask.missionInformation.AircraftInfos[i];
|
|
|
- aircraft.AircraftId = mhTask.missionInformation.AircraftId[i];
|
|
|
+ aircraft.Name = mhTask.missionInformation.aircraftInfos[i].AircraftType;
|
|
|
+ aircraft.AircraftId = mhTask.missionInformation.aircraftInfos[i].AircraftId;
|
|
|
|
|
|
aircraft.fireGround = fireGround;
|
|
|
aircraft.mhRescueMission = mission;
|
|
@@ -71,12 +71,12 @@ public class CreateMHTaskEventHandler : AEvent<CreateMHTask>
|
|
|
foreach (DMMHTask dmmhTask in config.MHTaskConfig.dMMHTask)
|
|
|
{
|
|
|
Log.Info($"创建地面灭火任务 : {dmmhTask.missionInformation.MissionName}");
|
|
|
- if(dmmhTask.missionInformation.AircraftInfos == null) continue;
|
|
|
- for (int i = 0; i < dmmhTask.missionInformation.AircraftInfos.Length; i++)
|
|
|
+ if(dmmhTask.missionInformation.aircraftInfos == null) continue;
|
|
|
+ for (int i = 0; i < dmmhTask.missionInformation.aircraftInfos.Length; i++)
|
|
|
{
|
|
|
//飞机参数
|
|
|
var aircraftParameter = config.EditorConfig.aircraftParameters.Find(
|
|
|
- a => a.AircraftID == dmmhTask.missionInformation.AircraftInfos[i]);
|
|
|
+ a => a.AircraftID == dmmhTask.missionInformation.aircraftInfos[i].AircraftType);
|
|
|
//基地
|
|
|
var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
|
|
|
|
|
@@ -85,7 +85,7 @@ public class CreateMHTaskEventHandler : AEvent<CreateMHTask>
|
|
|
|
|
|
AircraftMHWithPersion aircraftWithPerson = ComponentFactory.Create<AircraftMHWithPersion, FlightPlanEditor>( flightPlanEditor);
|
|
|
mission.End += aircraftWithPerson.End;
|
|
|
- aircraftWithPerson.Name = dmmhTask.missionInformation.AircraftInfos[i];
|
|
|
+ aircraftWithPerson.Name = dmmhTask.missionInformation.aircraftInfos[i].AircraftType;
|
|
|
aircraftWithPerson.fireGround = fireGround;
|
|
|
aircraftWithPerson.mhRescueMission = mission;
|
|
|
aircraftWithPerson.GroundPersonnel = (int)dmmhTask.GroundPersonnel;
|
|
@@ -93,7 +93,7 @@ public class CreateMHTaskEventHandler : AEvent<CreateMHTask>
|
|
|
aircraftWithPerson.NextMissionId = dmmhTask.NextTaskId;
|
|
|
aircraftWithPerson.TaskName = dmmhTask.missionInformation.MissionName;
|
|
|
aircraftWithPerson.TaskReadyTime = dmmhTask.missionInformation.TakeoffPreparationTime;
|
|
|
- aircraftWithPerson.AircraftId = dmmhTask.missionInformation.AircraftId[i];
|
|
|
+ aircraftWithPerson.AircraftId = dmmhTask.missionInformation.aircraftInfos[i].AircraftId;
|
|
|
|
|
|
mission.aircrafts.Add(aircraftWithPerson);
|
|
|
Log.Info($"创建机型 : {flightPlanEditor.aircraftparameter.AircraftID}");
|
|
@@ -103,12 +103,12 @@ public class CreateMHTaskEventHandler : AEvent<CreateMHTask>
|
|
|
foreach (SHJTask shjTask in config.MHTaskConfig.sHJTask)
|
|
|
{
|
|
|
Log.Info($"创建索滑降任务 : {shjTask.missionInformation.MissionName}");
|
|
|
- if(shjTask.missionInformation.AircraftInfos == null) continue;
|
|
|
- for (int i = 0; i < shjTask.missionInformation.AircraftInfos.Length; i++)
|
|
|
+ if(shjTask.missionInformation.aircraftInfos == null) continue;
|
|
|
+ for (int i = 0; i < shjTask.missionInformation.aircraftInfos.Length; i++)
|
|
|
{
|
|
|
//飞机参数
|
|
|
var aircraftParameter = config.EditorConfig.aircraftParameters.Find(
|
|
|
- a => a.AircraftID == shjTask.missionInformation.AircraftInfos[i]);
|
|
|
+ a => a.AircraftID == shjTask.missionInformation.aircraftInfos[i].AircraftType);
|
|
|
//基地
|
|
|
var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
|
|
|
|
|
@@ -117,7 +117,7 @@ public class CreateMHTaskEventHandler : AEvent<CreateMHTask>
|
|
|
|
|
|
AircraftSHJ aircraftSHJ = ComponentFactory.Create<AircraftSHJ, FlightPlanEditor,SHJTask>( flightPlanEditor, shjTask);
|
|
|
mission.End += aircraftSHJ.End;
|
|
|
- aircraftSHJ.AircraftId = shjTask.missionInformation.AircraftId[i];
|
|
|
+ aircraftSHJ.AircraftId = shjTask.missionInformation.aircraftInfos[i].AircraftId;
|
|
|
aircraftSHJ.TaskReadyTime = shjTask.missionInformation.TakeoffPreparationTime;
|
|
|
mission.aircrafts.Add(aircraftSHJ);
|
|
|
Log.Info($"创建机型 : {flightPlanEditor.aircraftparameter.AircraftID}");
|
|
@@ -139,11 +139,11 @@ public class CreateZCTaskEventHandler : AEvent<CreateZCTask>
|
|
|
|
|
|
FirePoint point = config.EditorConfig.firePoints.Find(f => f.FirePointId == config.ZCTask.FirePointId);
|
|
|
|
|
|
- for (int i = 0; i < config.ZCTask.missionInformation.AircraftInfos.Length; i++)
|
|
|
+ for (int i = 0; i < config.ZCTask.missionInformation.aircraftInfos.Length; i++)
|
|
|
{
|
|
|
//飞机参数
|
|
|
var aircraftParameter = config.EditorConfig.aircraftParameters.Find(
|
|
|
- a => a.AircraftID == config.ZCTask.missionInformation.AircraftInfos[i]);
|
|
|
+ a => a.AircraftID == config.ZCTask.missionInformation.aircraftInfos[i].AircraftType);
|
|
|
//基地
|
|
|
var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
|
|
|
|
|
@@ -182,11 +182,11 @@ public class CreateXHTaskEventHandler : AEvent<CreateXHTask>
|
|
|
FirePoint point = config.EditorConfig.firePoints.Find(f => f.FirePointId == config.XHTask.FirePointId);
|
|
|
|
|
|
mission.FireGround = ComponentFactory.Create<FireGround, FirePoint>(point);
|
|
|
- for (int i = 0; i < config.XHTask.missionInformation.AircraftInfos.Length; i++)
|
|
|
+ for (int i = 0; i < config.XHTask.missionInformation.aircraftInfos.Length; i++)
|
|
|
{
|
|
|
//飞机参数
|
|
|
var aircraftParameter = config.EditorConfig.aircraftParameters.Find(
|
|
|
- a => a.AircraftID == config.XHTask.missionInformation.AircraftInfos[i]);
|
|
|
+ a => a.AircraftID == config.XHTask.missionInformation.aircraftInfos[i].AircraftType);
|
|
|
//基地
|
|
|
var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
|
|
|
|
|
@@ -216,13 +216,13 @@ public class CreateXHTaskEventHandler : AEvent<CreateXHTask>
|
|
|
var flightPlanEditor = FlightPlanEditor.Create(aircraftParameter, config.EditorConfig.cityWeather,originBase,airRoutes,config.XHTask.MissionPoints[0], new []{point});
|
|
|
|
|
|
AircraftXH aircraft = ComponentFactory.Create<AircraftXH, FlightPlanEditor,string,string>( flightPlanEditor,
|
|
|
- config.XHTask.missionInformation.AircraftInfos[i],config.XHTask.missionInformation.AircraftId[i]);
|
|
|
+ config.XHTask.missionInformation.aircraftInfos[i].AircraftType,config.XHTask.missionInformation.aircraftInfos[i].AircraftId);
|
|
|
|
|
|
aircraft.TaskReadyTime = config.XHTask.missionInformation.TakeoffPreparationTime;
|
|
|
|
|
|
|
|
|
|
|
|
- Log.Info($"Name:{config.XHTask.missionInformation.MissionName} AircraftId:{config.XHTask.missionInformation.AircraftId[i]}");
|
|
|
+ Log.Info($"Name:{config.XHTask.missionInformation.MissionName} AircraftId:{config.XHTask.missionInformation.aircraftInfos[i].AircraftId}");
|
|
|
|
|
|
mission.AircraftXHs.Add(aircraft);
|
|
|
|
|
@@ -247,11 +247,11 @@ public class CreateSeaSJEventHandler : AEvent<CreateSeaSJTask>
|
|
|
mission.MissionId = $"海上搜索救援任务 {config.SeaSJTask.missionInformation.MissionName}";
|
|
|
mission.ExecutionContext = config.EditorConfig.runCounts;
|
|
|
mission.AddComponent<SJTotalTaskPerformanceComponent>();
|
|
|
- for (int i = 0; i < config.SeaSJTask.missionInformation.AircraftInfos.Length; i++)
|
|
|
+ for (int i = 0; i < config.SeaSJTask.missionInformation.aircraftInfos.Length; i++)
|
|
|
{
|
|
|
//飞机参数
|
|
|
var aircraftParameter = config.EditorConfig.aircraftParameters.Find(
|
|
|
- a => a.AircraftID == config.SeaSJTask.missionInformation.AircraftInfos[i]);
|
|
|
+ a => a.AircraftID == config.SeaSJTask.missionInformation.aircraftInfos[i].AircraftType);
|
|
|
//基地
|
|
|
var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
|
|
|
|
|
@@ -262,11 +262,11 @@ public class CreateSeaSJEventHandler : AEvent<CreateSeaSJTask>
|
|
|
|
|
|
|
|
|
AircraftSJ aircraft = ComponentFactory.Create<AircraftSJ, FlightPlanEditor>( flightPlanEditor);
|
|
|
- aircraft.Name = config.SeaSJTask.missionInformation.AircraftInfos[i];
|
|
|
+ aircraft.Name = config.SeaSJTask.missionInformation.aircraftInfos[i].AircraftType;
|
|
|
aircraft.TaskReadyTime = config.SeaSJTask.missionInformation.TakeoffPreparationTime;
|
|
|
mission.aircrafts.Add(aircraft);
|
|
|
aircraft.taskContent = config.SeaSJTask;
|
|
|
- aircraft.AircraftId = config.SeaSJTask.missionInformation.AircraftId[i];
|
|
|
+ aircraft.AircraftId = config.SeaSJTask.missionInformation.aircraftInfos[i].AircraftId;
|
|
|
aircraft.AddComponent<SJStaticCapacityComponent>();
|
|
|
Log.Info($"创建机型 : {flightPlanEditor.aircraftparameter.AircraftID}");
|
|
|
}
|
|
@@ -286,11 +286,11 @@ public class CreateLandSJEventHandler : AEvent<CreateLandSJTask>
|
|
|
mission.MissionId = $"陆上搜索救援任务 {config.LandSJTask.missionInformation.MissionName}";
|
|
|
mission.ExecutionContext = config.EditorConfig.runCounts;
|
|
|
//mission.AddComponent<SJTotalTaskPerformanceComponent>();
|
|
|
- for (int i = 0; i < config.LandSJTask.missionInformation.AircraftInfos.Length; i++)
|
|
|
+ for (int i = 0; i < config.LandSJTask.missionInformation.aircraftInfos.Length; i++)
|
|
|
{
|
|
|
//飞机参数
|
|
|
var aircraftParameter = config.EditorConfig.aircraftParameters.Find(
|
|
|
- a => a.AircraftID == config.LandSJTask.missionInformation.AircraftInfos[i]);
|
|
|
+ a => a.AircraftID == config.LandSJTask.missionInformation.aircraftInfos[i].AircraftType);
|
|
|
//基地
|
|
|
var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
|
|
|
|
|
@@ -299,11 +299,11 @@ public class CreateLandSJEventHandler : AEvent<CreateLandSJTask>
|
|
|
var flightPlanEditor = FlightPlanEditor.Create(aircraftParameter, config.EditorConfig.cityWeather, originBase, new TargetPoint[] { targetPoint });
|
|
|
|
|
|
AircraftLandSJ aircraft = ComponentFactory.Create<AircraftLandSJ, FlightPlanEditor>(flightPlanEditor);
|
|
|
- aircraft.Name = config.LandSJTask.missionInformation.AircraftInfos[i];
|
|
|
+ aircraft.Name = config.LandSJTask.missionInformation.aircraftInfos[i].AircraftType;
|
|
|
aircraft.TaskReadyTime = config.LandSJTask.missionInformation.TakeoffPreparationTime;
|
|
|
mission.aircrafts.Add(aircraft);
|
|
|
aircraft.taskContent = config.LandSJTask;
|
|
|
- aircraft.AircraftId = config.LandSJTask.missionInformation.AircraftId[i];
|
|
|
+ aircraft.AircraftId = config.LandSJTask.missionInformation.aircraftInfos[i].AircraftId;
|
|
|
aircraft.AddComponent<SJStaticCapacityComponent>(); // 陆上搜救是否需要新建SJStaticCapacityComponent?
|
|
|
Log.Info($"创建机型 : {flightPlanEditor.aircraftparameter.AircraftID}");
|
|
|
}
|