gxc
2020-02-28 66a9965c44ecc32a6696abca876ab9d1cd091584
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
using System;
using System.Collections.Generic;
using Shared.Phone.Device.Category;
 
namespace Shared.Common
{
    /// <summary>
    /// 在分类场景中使用,展示要加上房间的名称
    /// </summary>
    [System.Serializable]
    public class SceneRoomUI
    {
        /// <summary>
        /// 场景信息
        /// </summary>
        public SceneUI sceneUI;
        /// <summary>
        /// 房间
        /// </summary>
        public Room room;
 
        /// <summary>
        /// 所有的场景和房间信息
        /// </summary>
        public static void GetAllSceneRoomUIList()
        {
            //选择场景--所有房间的所有场景
            AllSceneRoomUIList.Clear();
            List<int> sceneIdList = new List<int> { };
            foreach (var r in Shared.Common.Room.Lists)
            {
                if (r.SceneUIList.Count == 0)
                {
                    continue;
                }
                foreach (var scene in r.SceneUIList)
                {
                    if (scene == null)
                    {
                        continue;
                    }
                    if(!sceneIdList.Contains(scene.Id))
                    {
                        var sceneRoomUI = new SceneRoomUI { sceneUI = scene, room = r };
                        sceneIdList.Add(scene.Id);
                        AllSceneRoomUIList.Add(sceneRoomUI);
                    }
                }
            }
        }
 
        /// <summary>
        /// 所有的场景和房间信息 -请先调用 GetAllSceneRoomUIList
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public static List<SceneRoomUI> AllSceneRoomUIList = new List<SceneRoomUI> { };
 
        
    }
}