|
@@ -14,30 +14,30 @@ public class CreateMHTaskEventHandler : AEvent<CreateMHTask>
|
|
|
{
|
|
|
// TODO 创建灭火任务
|
|
|
var taskSys = Game.Scene.GetComponent<TaskComponent>();
|
|
|
-
|
|
|
+
|
|
|
FirePoint point = config.EditorConfig.firePoints.Find(fire => fire.FirePointId == config.MHTaskConfig.FirePointId);
|
|
|
-
|
|
|
+
|
|
|
// 创建火点
|
|
|
- var fireGround = ComponentFactory.Create<FireGround,FirePoint>(point);
|
|
|
+ var fireGround = ComponentFactory.Create<FireGround, FirePoint>(point);
|
|
|
fireGround.FirePointName = point.FirePointId;
|
|
|
// 创建灭火任务
|
|
|
- var mission = ComponentFactory.Create<MHRescueMission,FireGround,double>(fireGround,point.InitialArea);
|
|
|
+ var mission = ComponentFactory.Create<MHRescueMission, FireGround, double>(fireGround, point.InitialArea);
|
|
|
mission.AddComponent<TotalEconomicalComponent>();
|
|
|
mission.AddComponent<TotalTaskPerformanceComponent>();
|
|
|
mission.AddComponent<EquipmentComponent>();
|
|
|
mission.MissionId = "灭火任务 " + config.MHTaskConfig.TotalMHId;
|
|
|
taskSys.MHRescueMissions.Add(mission);
|
|
|
-
|
|
|
+
|
|
|
//查询坡度
|
|
|
mission.slope = Util.GetSlope(point.FirePointLongitude,
|
|
|
point.FirePointLatitude, 30);
|
|
|
-
|
|
|
+
|
|
|
Log.Info($"创建任务 : {config.MHTaskConfig.TotalMHId}");
|
|
|
//创建吊桶灭火任务
|
|
|
foreach (MHTask mhTask in config.MHTaskConfig.mHTask)
|
|
|
{
|
|
|
Log.Info($"创建灭火任务 : {mhTask.missionInformation.MissionName}");
|
|
|
- if(mhTask.missionInformation.aircraftInfos == null) continue;
|
|
|
+ if (mhTask.missionInformation.aircraftInfos == null) continue;
|
|
|
for (int i = 0; i < mhTask.missionInformation.aircraftInfos.Length; i++)
|
|
|
{
|
|
|
//飞机参数
|
|
@@ -45,15 +45,15 @@ public class CreateMHTaskEventHandler : AEvent<CreateMHTask>
|
|
|
a => a.AircraftID == mhTask.missionInformation.aircraftInfos[i].AircraftType);
|
|
|
//基地
|
|
|
var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
|
|
|
-
|
|
|
+
|
|
|
//创建飞行计划编辑器
|
|
|
- var flightPlanEditor = FlightPlanEditor.Create(aircraftParameter, config.EditorConfig.cityWeather,originBase,mhTask.MissionPoints[0], new []{point});
|
|
|
-
|
|
|
- AircraftMH aircraft = ComponentFactory.Create<AircraftMH, FlightPlanEditor>( flightPlanEditor);
|
|
|
-
|
|
|
+ var flightPlanEditor = FlightPlanEditor.Create(aircraftParameter, config.EditorConfig.cityWeather, originBase, mhTask.MissionPoints[0], new[] { point });
|
|
|
+
|
|
|
+ AircraftMH aircraft = ComponentFactory.Create<AircraftMH, FlightPlanEditor>(flightPlanEditor);
|
|
|
+
|
|
|
aircraft.Name = mhTask.missionInformation.aircraftInfos[i].AircraftType;
|
|
|
aircraft.AircraftId = mhTask.missionInformation.aircraftInfos[i].AircraftId;
|
|
|
-
|
|
|
+
|
|
|
aircraft.fireGround = fireGround;
|
|
|
aircraft.mhRescueMission = mission;
|
|
|
mission.aircrafts.Add(aircraft);
|
|
@@ -71,7 +71,7 @@ public class CreateMHTaskEventHandler : AEvent<CreateMHTask>
|
|
|
foreach (DMMHTask dmmhTask in config.MHTaskConfig.dMMHTask)
|
|
|
{
|
|
|
Log.Info($"创建地面灭火任务 : {dmmhTask.missionInformation.MissionName}");
|
|
|
- if(dmmhTask.missionInformation.aircraftInfos == null) continue;
|
|
|
+ if (dmmhTask.missionInformation.aircraftInfos == null) continue;
|
|
|
for (int i = 0; i < dmmhTask.missionInformation.aircraftInfos.Length; i++)
|
|
|
{
|
|
|
//飞机参数
|
|
@@ -79,11 +79,11 @@ public class CreateMHTaskEventHandler : AEvent<CreateMHTask>
|
|
|
a => a.AircraftID == dmmhTask.missionInformation.aircraftInfos[i].AircraftType);
|
|
|
//基地
|
|
|
var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
|
|
|
-
|
|
|
+
|
|
|
//创建飞行计划编辑器
|
|
|
- var flightPlanEditor = FlightPlanEditor.Create(aircraftParameter, config.EditorConfig.cityWeather,originBase,dmmhTask.MissionPoints[0], new []{point});
|
|
|
-
|
|
|
- AircraftMHWithPersion aircraftWithPerson = ComponentFactory.Create<AircraftMHWithPersion, FlightPlanEditor>( flightPlanEditor);
|
|
|
+ var flightPlanEditor = FlightPlanEditor.Create(aircraftParameter, config.EditorConfig.cityWeather, originBase, dmmhTask.MissionPoints[0], new[] { point });
|
|
|
+
|
|
|
+ AircraftMHWithPersion aircraftWithPerson = ComponentFactory.Create<AircraftMHWithPersion, FlightPlanEditor>(flightPlanEditor);
|
|
|
mission.End += aircraftWithPerson.End;
|
|
|
aircraftWithPerson.Name = dmmhTask.missionInformation.aircraftInfos[i].AircraftType;
|
|
|
aircraftWithPerson.fireGround = fireGround;
|
|
@@ -94,7 +94,7 @@ public class CreateMHTaskEventHandler : AEvent<CreateMHTask>
|
|
|
aircraftWithPerson.TaskName = dmmhTask.missionInformation.MissionName;
|
|
|
aircraftWithPerson.TaskReadyTime = dmmhTask.missionInformation.TakeoffPreparationTime;
|
|
|
aircraftWithPerson.AircraftId = dmmhTask.missionInformation.aircraftInfos[i].AircraftId;
|
|
|
-
|
|
|
+
|
|
|
mission.aircrafts.Add(aircraftWithPerson);
|
|
|
Log.Info($"创建机型 : {flightPlanEditor.aircraftparameter.AircraftID}");
|
|
|
}
|
|
@@ -103,7 +103,7 @@ public class CreateMHTaskEventHandler : AEvent<CreateMHTask>
|
|
|
foreach (SHJTask shjTask in config.MHTaskConfig.sHJTask)
|
|
|
{
|
|
|
Log.Info($"创建索滑降任务 : {shjTask.missionInformation.MissionName}");
|
|
|
- if(shjTask.missionInformation.aircraftInfos == null) continue;
|
|
|
+ if (shjTask.missionInformation.aircraftInfos == null) continue;
|
|
|
for (int i = 0; i < shjTask.missionInformation.aircraftInfos.Length; i++)
|
|
|
{
|
|
|
//飞机参数
|
|
@@ -111,11 +111,11 @@ public class CreateMHTaskEventHandler : AEvent<CreateMHTask>
|
|
|
a => a.AircraftID == shjTask.missionInformation.aircraftInfos[i].AircraftType);
|
|
|
//基地
|
|
|
var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
|
|
|
-
|
|
|
+
|
|
|
//创建飞行计划编辑器
|
|
|
- var flightPlanEditor = FlightPlanEditor.Create(aircraftParameter, config.EditorConfig.cityWeather,originBase,shjTask.MissionPoints[0], new []{point});
|
|
|
+ var flightPlanEditor = FlightPlanEditor.Create(aircraftParameter, config.EditorConfig.cityWeather, originBase, shjTask.MissionPoints[0], new[] { point });
|
|
|
|
|
|
- AircraftSHJ aircraftSHJ = ComponentFactory.Create<AircraftSHJ, FlightPlanEditor,SHJTask>( flightPlanEditor, shjTask);
|
|
|
+ AircraftSHJ aircraftSHJ = ComponentFactory.Create<AircraftSHJ, FlightPlanEditor, SHJTask>(flightPlanEditor, shjTask);
|
|
|
mission.End += aircraftSHJ.End;
|
|
|
aircraftSHJ.AircraftId = shjTask.missionInformation.aircraftInfos[i].AircraftId;
|
|
|
aircraftSHJ.TaskReadyTime = shjTask.missionInformation.TakeoffPreparationTime;
|
|
@@ -136,9 +136,9 @@ public class CreateZCTaskEventHandler : AEvent<CreateZCTask>
|
|
|
ZCRescueMission mission = ComponentFactory.Create<ZCRescueMission>();
|
|
|
taskSys.ZCRescueMissions.Add(mission);
|
|
|
mission.MissionId = $"侦擦任务 {config.ZCTask.missionInformation.MissionName}";
|
|
|
-
|
|
|
+
|
|
|
FirePoint point = config.EditorConfig.firePoints.Find(f => f.FirePointId == config.ZCTask.FirePointId);
|
|
|
-
|
|
|
+
|
|
|
for (int i = 0; i < config.ZCTask.missionInformation.aircraftInfos.Length; i++)
|
|
|
{
|
|
|
//飞机参数
|
|
@@ -146,13 +146,13 @@ public class CreateZCTaskEventHandler : AEvent<CreateZCTask>
|
|
|
a => a.AircraftID == config.ZCTask.missionInformation.aircraftInfos[i].AircraftType);
|
|
|
//基地
|
|
|
var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
|
|
|
-
|
|
|
+
|
|
|
//创建飞行计划编辑器
|
|
|
- var flightPlanEditor = FlightPlanEditor.Create(aircraftParameter, config.EditorConfig.cityWeather,originBase,config.ZCTask.MissionPoints[0], new []{point});
|
|
|
+ var flightPlanEditor = FlightPlanEditor.Create(aircraftParameter, config.EditorConfig.cityWeather, originBase, config.ZCTask.MissionPoints[0], new[] { point });
|
|
|
|
|
|
//创建飞机
|
|
|
int index = i;
|
|
|
- AircraftZC aircraft = ComponentFactory.Create<AircraftZC, FlightPlanEditor,ZCTask,int>( flightPlanEditor, config.ZCTask,index);
|
|
|
+ AircraftZC aircraft = ComponentFactory.Create<AircraftZC, FlightPlanEditor, ZCTask, int>(flightPlanEditor, config.ZCTask, index);
|
|
|
aircraft.AddComponent<StaticCapacityComponent>();
|
|
|
aircraft.AddComponent<TaskPerformanceComponent>();
|
|
|
aircraft.AddComponent<EconomicalComponent>();
|
|
@@ -160,7 +160,7 @@ public class CreateZCTaskEventHandler : AEvent<CreateZCTask>
|
|
|
Log.Info($"创建机型 : {flightPlanEditor.aircraftparameter.AircraftID}");
|
|
|
mission.AircraftZCs.Add(aircraft);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
return UniTask.CompletedTask;
|
|
|
}
|
|
|
}
|
|
@@ -172,13 +172,13 @@ public class CreateXHTaskEventHandler : AEvent<CreateXHTask>
|
|
|
{
|
|
|
// TODO 创建巡护任务
|
|
|
var taskSys = Game.Scene.GetComponent<TaskComponent>();
|
|
|
-
|
|
|
+
|
|
|
XHRescueMission mission = ComponentFactory.Create<XHRescueMission>();
|
|
|
mission.AddComponent<XHTotalTaskPerformanceComponent>();
|
|
|
mission.AddComponent<EquipmentComponent>();
|
|
|
mission.MissionId = $"巡护任务 {config.XHTask.missionInformation.MissionId}";
|
|
|
taskSys.XHRescueMissions.Add(mission);
|
|
|
-
|
|
|
+
|
|
|
FirePoint point = config.EditorConfig.firePoints.Find(f => f.FirePointId == config.XHTask.FirePointId);
|
|
|
|
|
|
mission.FireGround = ComponentFactory.Create<FireGround, FirePoint>(point);
|
|
@@ -189,8 +189,8 @@ public class CreateXHTaskEventHandler : AEvent<CreateXHTask>
|
|
|
a => a.AircraftID == config.XHTask.missionInformation.aircraftInfos[i].AircraftType);
|
|
|
//基地
|
|
|
var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
|
|
|
-
|
|
|
- string content = HttpManager.Get(HttpInterface.routes ,new List<string>
|
|
|
+
|
|
|
+ string content = HttpManager.Get(HttpInterface.routes, new List<string>
|
|
|
{
|
|
|
"fName"
|
|
|
}, new List<string>
|
|
@@ -198,7 +198,7 @@ public class CreateXHTaskEventHandler : AEvent<CreateXHTask>
|
|
|
config.XHTask.airroute[0].AirRouteName
|
|
|
});
|
|
|
var routes = JsonHelper.FromJson<RouteDB>(content);
|
|
|
-
|
|
|
+
|
|
|
//routes.data.lstPoints => AirRoute[]
|
|
|
AirRoute[] airRoutes = new AirRoute[routes.data[0].lstPoints.Count];
|
|
|
for (int j = 0; j < routes.data[0].lstPoints.Count; j++)
|
|
@@ -210,28 +210,28 @@ public class CreateXHTaskEventHandler : AEvent<CreateXHTask>
|
|
|
AirRouteHeight = routes.data[0].lstPoints[j].dem
|
|
|
};
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
//创建飞行计划编辑器
|
|
|
- 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].AircraftType,config.XHTask.missionInformation.aircraftInfos[i].AircraftId);
|
|
|
-
|
|
|
+ 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].AircraftType, config.XHTask.missionInformation.aircraftInfos[i].AircraftId);
|
|
|
+
|
|
|
aircraft.TaskReadyTime = config.XHTask.missionInformation.TakeoffPreparationTime;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
Log.Info($"Name:{config.XHTask.missionInformation.MissionName} AircraftId:{config.XHTask.missionInformation.aircraftInfos[i].AircraftId}");
|
|
|
-
|
|
|
+
|
|
|
mission.AircraftXHs.Add(aircraft);
|
|
|
-
|
|
|
+
|
|
|
mission.End += aircraft.End;
|
|
|
aircraft.AddComponent<XHStaticCapacityComponent>();
|
|
|
aircraft.AddComponent<XHEconomicalComponent>();
|
|
|
Log.Info($"创建机型 : {flightPlanEditor.aircraftparameter.AircraftID}");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
return UniTask.CompletedTask;
|
|
|
}
|
|
|
}
|
|
@@ -254,14 +254,14 @@ public class CreateSeaSJEventHandler : AEvent<CreateSeaSJTask>
|
|
|
a => a.AircraftID == config.SeaSJTask.missionInformation.aircraftInfos[i].AircraftType);
|
|
|
//基地
|
|
|
var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
|
|
|
-
|
|
|
- TargetPoint targetPoint = config.EditorConfig.targetPoints.Find( t => t.TargetPointId == config.SeaSJTask.TargetPointId);
|
|
|
+
|
|
|
+ TargetPoint targetPoint = config.EditorConfig.targetPoints.Find(t => t.TargetPointId == config.SeaSJTask.TargetPointId);
|
|
|
//创建飞行计划编辑器
|
|
|
- var flightPlanEditor = FlightPlanEditor.Create(aircraftParameter, config.EditorConfig.cityWeather,originBase, new TargetPoint[]{ targetPoint });
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- AircraftSJ aircraft = ComponentFactory.Create<AircraftSJ, FlightPlanEditor>( flightPlanEditor);
|
|
|
+ var flightPlanEditor = FlightPlanEditor.Create(aircraftParameter, config.EditorConfig.cityWeather, originBase, new TargetPoint[] { targetPoint });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ AircraftSJ aircraft = ComponentFactory.Create<AircraftSJ, FlightPlanEditor>(flightPlanEditor);
|
|
|
aircraft.Name = config.SeaSJTask.missionInformation.aircraftInfos[i].AircraftType;
|
|
|
aircraft.TaskReadyTime = config.SeaSJTask.missionInformation.TakeoffPreparationTime;
|
|
|
mission.aircrafts.Add(aircraft);
|
|
@@ -270,7 +270,7 @@ public class CreateSeaSJEventHandler : AEvent<CreateSeaSJTask>
|
|
|
aircraft.AddComponent<SJStaticCapacityComponent>();
|
|
|
Log.Info($"创建机型 : {flightPlanEditor.aircraftparameter.AircraftID}");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
return UniTask.CompletedTask;
|
|
|
}
|
|
|
}
|
|
@@ -304,6 +304,13 @@ public class CreateLandSJEventHandler : AEvent<CreateLandSJTask>
|
|
|
mission.aircrafts.Add(aircraft);
|
|
|
aircraft.taskContent = config.LandSJTask;
|
|
|
aircraft.AircraftId = config.LandSJTask.missionInformation.aircraftInfos[i].AircraftId;
|
|
|
+ aircraft.MissionEndPoint = new MissionEndPoint
|
|
|
+ {
|
|
|
+ MissionEndPointLongitude = targetPoint.TargetPointLongitude,
|
|
|
+ MissionEndPointLatitude = targetPoint.TargetPointLatitude,
|
|
|
+ MissionEndPointHeight = targetPoint.TargetPointHeight
|
|
|
+ };
|
|
|
+
|
|
|
aircraft.AddComponent<SJStaticCapacityComponent>(); // 陆上搜救是否需要新建SJStaticCapacityComponent?
|
|
|
Log.Info($"创建机型 : {flightPlanEditor.aircraftparameter.AircraftID}");
|
|
|
}
|