Răsfoiți Sursa

添加执行次数

zansimple 9 luni în urmă
părinte
comite
f5594e1088

+ 2 - 0
Models/SimulationCommon/TaskConfig.cs

@@ -132,6 +132,8 @@ public class MHTaskConfig
     public int TotalMHId;
     [JsonProperty("火点ID")]
     public int FirePointId;
+    [JsonProperty("执行次数")]
+    public int RunTimes;
     [JsonProperty("吊桶洒水灭火任务")]
     public List<MHTask> mHTask = new List<MHTask>();
     [JsonProperty("机降灭火任务")]

+ 1 - 1
SimulationServer/EventHandler/ServerStartEventHandler.cs

@@ -53,7 +53,7 @@ public class ServerStartEventHandler : AEvent<ServerStart>
         foreach (MHTaskConfig mHTaskConfig in taskConfig.mHTaskConfigs)
         {
             MHRescueMission mission = ComponentFactory.Create<MHRescueMission>();
-
+            mission.ExecutionContext = mHTaskConfig.RunTimes;
             mission.AddComponent<TotalTaskPerformanceComponent>();
             mission.AddComponent<TotalEconomicalComponent>();
             mission.AddComponent<EquipmentComponent>();

+ 2 - 0
SimulationServer/bin/Debug/net7.0/Missions/task_config.json

@@ -3,6 +3,7 @@
     {
       "总灭火任务编号": 1,
       "火点ID": 1,
+      "执行次数": 10,
       "吊桶洒水灭火任务": [
         {
           "任务信息": {
@@ -116,6 +117,7 @@
     {
       "总灭火任务编号": 2,
       "火点ID": 2,
+      "执行次数": 10,
       "吊桶洒水灭火任务": [
         {
           "任务信息": {