From 576b92fd82f568572bc4beb125fa0ba0191a602f Mon Sep 17 00:00:00 2001
From: asmrobot <asmrobot@hotmail.com>
Date: Wed, 13 Nov 2019 14:59:52 +0000
Subject: [PATCH] add map editor

---
 src/RichCreator/Jobs/JobMonitor.cs |   27 +++++----------------------
 1 files changed, 5 insertions(+), 22 deletions(-)

diff --git a/src/RichCreator/Jobs/JobMonitor.cs b/src/RichCreator/Jobs/JobMonitor.cs
index 9dd7238..7a77f18 100644
--- a/src/RichCreator/Jobs/JobMonitor.cs
+++ b/src/RichCreator/Jobs/JobMonitor.cs
@@ -18,6 +18,7 @@
 using System.Threading.Tasks;
 using ZTImage.Configuration;
 using RichCreator.Maps;
+using RichCreator.Utility.Maps;
 
 namespace RichCreator
 {
@@ -30,15 +31,15 @@
         private WeGameJob wegameJob;
         private JobBase dnfJob;
 
-        private Int32 taskIndex;
+        private MapType mapType;
 
         Int32 runningStep = RunningStep.None;
 
-        public JobMonitor(Int32 taskIndex)
+        public JobMonitor(MapType maptype)
         {
             this.config = ConfigHelper.GetInstance<RichCreatorConfig>();
             this.cancelTokenSource = new CancellationTokenSource();
-            this.taskIndex = taskIndex;
+            this.mapType = maptype;
         }
 
         /// <summary>
@@ -109,7 +110,7 @@
 
                 //设为顶层
                 WindowUtils.SetDnfToTop();
-                this.dnfJob = GetDNFJob();
+                this.dnfJob = new DNFJob(this.mapType, this.config);
                 jobResult = this.dnfJob.Do(this.cancelTokenSource.Token, runningStep);
                 if (jobResult != ZTResult.Success)
                 {
@@ -158,23 +159,5 @@
             ProcessUtils.CloseWeGame();
         }
 
-        /// <summary>
-        /// 根据当前选择的地图实例化DNF地图
-        /// </summary>
-        /// <param name="config"></param>
-        /// <returns></returns>
-        private JobBase GetDNFJob()
-        {
-            switch (this.taskIndex)
-            {
-                case 0:
-                    return new DNFJob<LindongMap>(this.config);
-                case 1:
-                    return new DNFJob<SkillMap>(this.config);
-                case 2:
-                    return new DNFJob<TestMap>(this.config);
-            }
-            throw new Exception("this task index is error");
-        }
     }
 }

--
Gitblit v1.9.3