From 7167334c0e89dd84827d59e726123d14776e3a09 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期二, 16 六月 2020 11:14:13 +0800
Subject: [PATCH] 2020-06-16-1

---
 HDL_ON/Entity/Room.cs |   47 ++++++++++++++++++++++++++++++-----------------
 1 files changed, 30 insertions(+), 17 deletions(-)

diff --git a/HDL_ON/Entity/Room.cs b/HDL_ON/Entity/Room.cs
index 2e23cd7..7884d78 100644
--- a/HDL_ON/Entity/Room.cs
+++ b/HDL_ON/Entity/Room.cs
@@ -14,11 +14,15 @@
         /// <summary>
         /// 鎴块棿鍚�
         /// </summary>
-        public string name;
+        public string name = "Room";
         /// <summary>
         /// 鎴块棿ID
         /// </summary>
         public string sid;
+        /// <summary>
+        /// 妤煎眰绱㈠紩
+        /// </summary>
+        public int floorIndex = -1;
 
         /// <summary>
         /// 鎴块棿鑳屾櫙
@@ -27,28 +31,37 @@
         /// <summary>
         /// 妤煎眰
         /// </summary>
-        public string floor = "";
+        public string floor {
+            get
+            {
+                string str = "";
+                if (floorIndex != -1)
+                {
+                    if (floorIndex < DB_ResidenceData.residenceData.floors.Count)
+                        str = DB_ResidenceData.residenceData.floors[floorIndex];
+                }
+                return str;
+            }
+        }
+       
 
-        /// <summary>
-        /// 鎴块棿娣诲姞鐨勫姛鑳藉垪琛�
-        /// 淇濆瓨鍔熻兘ID
-        /// </summary>
-        public List<string> roomFunctionList = new List<string>();
         /// <summary>
         /// 鎴块棿鍔熻兘鍒楄〃
         /// </summary>
         [Newtonsoft.Json.JsonIgnore]
         public List<Function> functions = new List<Function>();
 
-        /// <summary>
-        /// 鎴块棿娣诲姞鐨勫満鏅垪琛�
-        /// 淇濆瓨鍦烘櫙ID
-        /// </summary>
-        public List<string> roomSceneList = new List<string>();
-        /// <summary>
-        /// 鎴块棿鍦烘櫙鍒楄〃
-        /// </summary>
-        [Newtonsoft.Json.JsonIgnore]
-        public List<Scene> scenes = new List<Scene>();
+        public void RefreshFunctions()
+        {
+            List<Function> funcList = new List<Function>();
+            foreach (var f in DB_ResidenceData.residenceData.functionList.functions)
+            {
+                if (f.roomIdList.Contains(sid) && sid != null)
+                {
+                    funcList.Add(f);
+                }
+            }
+            functions = funcList;
+        }
     }
 }

--
Gitblit v1.8.0