From ae40a4d6cc0a7d0be070dee5db13b1c3c67c805d Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期一, 25 二月 2019 21:45:18 +0800
Subject: [PATCH] 3335 新版装备开发。

---
 System/Equip/EquipSet.cs   |    3 +
 System/Equip/EquipModel.cs |  102 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 103 insertions(+), 2 deletions(-)

diff --git a/System/Equip/EquipModel.cs b/System/Equip/EquipModel.cs
index c26a29d..a8e1af4 100644
--- a/System/Equip/EquipModel.cs
+++ b/System/Equip/EquipModel.cs
@@ -11,7 +11,10 @@
 
         public override void Init()
         {
-
+            for (var i = 0; i < 20; i++)
+            {
+                equipSets[i + 1] = new EquipSet(i + 1);
+            }
         }
 
         public override void UnInit()
@@ -19,6 +22,103 @@
 
         }
 
+
+        public void UnLock(int level)
+        {
+            if (!equipSets.ContainsKey(level))
+            {
+                return;
+            }
+
+            equipSets[level].UnLock();
+        }
+
+        public bool IsEquipSetUnLocked(int level)
+        {
+            if (!equipSets.ContainsKey(level))
+            {
+                return false;
+            }
+
+            return equipSets[level].unLocked;
+        }
+
+        public void PutOn(ItemModel item)
+        {
+            if (item == null)
+            {
+                return;
+            }
+
+            var level = item.config.LV;
+            if (!equipSets.ContainsKey(level))
+            {
+                return;
+            }
+
+            var set = equipSets[level];
+            if (!set.unLocked)
+            {
+                return;
+            }
+
+            set.PutOn(item);
+        }
+
+        public void TakeOff(int level, int place)
+        {
+            if (!equipSets.ContainsKey(level))
+            {
+                return;
+            }
+
+            var slot = equipSets[level];
+            slot.TakeOff(place);
+        }
+
+        public void UpdateStarLevel(int level, int place, int starLevel)
+        {
+            if (!equipSets.ContainsKey(level))
+            {
+                return;
+            }
+
+            var set = equipSets[level];
+            set.UpdateStarLevel(place, starLevel);
+        }
+
+        public void UnLockSlot(int level, int place)
+        {
+            if (!equipSets.ContainsKey(place))
+            {
+                return;
+            }
+
+            var set = equipSets[level];
+            if (set.unLocked)
+            {
+                return;
+            }
+
+            set.UnLockSlot(place);
+        }
+
+        public bool IsBetterThanCurrent(ItemModel item)
+        {
+            if (item == null)
+            {
+                return false;
+            }
+
+            var level = item.config.LV;
+            if (!equipSets.ContainsKey(level))
+            {
+                return false;
+            }
+
+            var set = equipSets[level];
+            return set.IsBetterThanCurrent(item);
+        }
     }
 }
 
diff --git a/System/Equip/EquipSet.cs b/System/Equip/EquipSet.cs
index 2464fc4..55e95ce 100644
--- a/System/Equip/EquipSet.cs
+++ b/System/Equip/EquipSet.cs
@@ -57,13 +57,14 @@
             return equipSlots[place].equip;
         }
 
-        public void PutOn(int place, ItemModel item)
+        public void PutOn(ItemModel item)
         {
             if (item == null)
             {
                 return;
             }
 
+            var place = item.equipPlace;
             if (!equipSlots.ContainsKey(place))
             {
                 return;

--
Gitblit v1.8.0