using System;
|
using System.Collections.Generic;
|
|
namespace HDL_ON.Entity
|
{
|
|
/// <summary>
|
/// 房间对象
|
/// 房间命名规则 typeof (Room).Name + "_" + etNameBox.Text.Trim ();
|
/// </summary>
|
[System.Serializable]
|
public class Room
|
{
|
/// <summary>
|
/// 房间名
|
/// </summary>
|
public string name = "Room";
|
/// <summary>
|
/// 房间ID
|
/// </summary>
|
public string sid;
|
|
/// <summary>
|
/// 房间背景
|
/// </summary>
|
public string backgroundImage = "Classification/Room/Roombg.png";
|
/// <summary>
|
/// 楼层
|
/// </summary>
|
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>
|
/// 楼层索引
|
/// </summary>
|
public int floorIndex = -1;
|
|
/// <summary>
|
/// 房间功能列表
|
/// </summary>
|
[Newtonsoft.Json.JsonIgnore]
|
public List<Function> functionData = 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))
|
{
|
funcList.Add(f);
|
}
|
}
|
functionData = funcList;
|
}
|
}
|
}
|