wxr
2020-08-11 2bec9c838d2d688025698de8ec1de401ffd7dd1f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
using System;
using System.Collections.Generic;
 
namespace HDL_ON.Entity
{
 
 
    /// <summary>
    /// 房间对象
    /// </summary>
    [Serializable]
    public class Floor
    {
        /// <summary>
        /// 楼层名称
        /// </summary>
        public string name = "1 F";
        /// <summary>
        /// 楼层ID
        /// </summary>
        public string sid;
    }
 
 
    /// <summary>
    /// 房间对象
    /// </summary>
    [Serializable]
    public class Room
    {
        /// <summary>
        /// 房间名
        /// </summary>
        public string name = "Room";
        /// <summary>
        /// 房间ID
        /// </summary>
        public string sid;
        /// <summary>
        /// 楼层索引
        /// </summary>
        public string floorId = "";
 
        /// <summary>
        /// 房间背景
        /// </summary>
        public string backgroundImage = "Classification/Room/Roombg.png";
        /// <summary>
        /// 楼层
        /// </summary>
        public string floor
        {
            get
            {
                if (DB_ResidenceData.residenceData.floors.Count > 0)
                {
                    var f = DB_ResidenceData.residenceData.floors.Find((obj) => obj.sid == floorId);
                    if (f != null)
                    {
                        return f.name;
                    }
                }
                return "";
            }
        }
 
 
        /// <summary>
        /// 房间功能列表
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public List<Function> functions = new List<Function>();
 
        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;
        }
    }
}