コード例 #1
0
        public void InitializeScenes(LightSystemSettings systemSettings)
        {
            foreach (SerializationScene scene in systemSettings.scenes)
            {
                var id = SettingsManager.ConvertStringNumberToInt(scene.id);

                Scene lightScene = new Scene(id, scene.name);

                if (scene.wholeHome)
                {
                    lightScene.WholeHome = true;
                }

                foreach (SerializationLoadState loadState in scene.loadStates)
                {
                    var level = SettingsManager.ConvertUnsignedStringNumber(loadState.level);

                    List <int> loadIds = null;

                    if (loadState.loadList == "all")
                    {
                        loadIds = _loadManager.GetLoads().Select(x => x.LoadID).ToList <int>();
                    }
                    else
                    {
                        loadIds = new List <int>(loadState.loadList.Split(',').Select(s => int.Parse(s)));
                    }

                    foreach (int loadID in loadIds)
                    {
                        LoadState state = new LoadState((ushort)level, LoadManager.GetLoad(loadID));
                        lightScene.AddLoadState(state);
                    }
                }

                _sceneManager.AddScene(lightScene);
            }
        }
コード例 #2
0
 public LightingSystem(ControlSystem system, SettingsManager settingsManager, RoomManager roomManager, SceneManager sceneManager, LoadManager loadManager, TouchPanelManager touchPanelManager)
 {
     _system            = system;
     _settingsManager   = settingsManager;
     _roomManager       = roomManager;
     _sceneManager      = sceneManager;
     _loadManager       = loadManager;
     _touchPanelManager = touchPanelManager;
 }