示例#1
0
 public Command(Room room, Device device, EDeviceCapabilities action)
 {
     mAction = action;
     mDevice = device;
     mRoom = room;
     mHasData = true;
 }
示例#2
0
文件: World.cs 项目: kingtut666/holly
        public static TheWorld CreateTestWorld()
        {
            Room livingroom = new Room("living room");
            Room study = new Room("study");
            Room bedroom = new Room("bedroom");
            Room corridor = new Room("corridor");
            corridor.AddDoorway(livingroom);
            corridor.AddDoorway(study);
            corridor.AddDoorway(bedroom);

            Device study_light = new Device("R1D1", "study light", EDeviceClass.Light, EDeviceProtocol.LWRF,
                new DeviceCapabilities("Dimmer"), null);
            Device bedroom_light = new Device("R2D1", "bedroom light", EDeviceClass.Light, EDeviceProtocol.LWRF,
                new DeviceCapabilities("Dimmer"), null);
            Device study_kinect = new Device("192.168.1.32", "study kinect", EDeviceClass.Kinect, EDeviceProtocol.AudioProto,
                new DeviceCapabilities("AudioIn"), null);
            Device bedroom_kinect = new Device("192.168.1.191", "bedroom kinect", EDeviceClass.Kinect, EDeviceProtocol.AudioProto,
                new DeviceCapabilities("AudioIn"), null);
            Device living_kinect = new Device("192.168.1.190", "living room kinect", EDeviceClass.Kinect, EDeviceProtocol.AudioProto,
                new DeviceCapabilities("AudioIn"), null);
            Dictionary<string,string> study_xbmc_args = new Dictionary<string,string>();
            study_xbmc_args.Add("port", "8080");
            study_xbmc_args.Add("user", "xbmc");
            study_xbmc_args.Add("pass", "test");
            Device study_xbmc = new Device("192.168.1.130", "study xbmc", EDeviceClass.XBMC, EDeviceProtocol.XBMC,
                new DeviceCapabilities("XBMC"), study_xbmc_args);
            Dictionary<string, string> bedroom_xbmc_args = new Dictionary<string, string>();
            bedroom_xbmc_args.Add("port", "8080");
            bedroom_xbmc_args.Add("user", "xbmc");
            bedroom_xbmc_args.Add("pass", "xbmc");
            Device bedroom_xbmc = new Device("192.168.1.191", "bedroom xbmc", EDeviceClass.XBMC, EDeviceProtocol.XBMC,
                new DeviceCapabilities("XBMC"), bedroom_xbmc_args);
            Dictionary<string, string> living_xbmc_args = new Dictionary<string, string>();
            living_xbmc_args.Add("port", "8080");
            living_xbmc_args.Add("user", "xbmc");
            living_xbmc_args.Add("pass", "xbmc");
            Device living_xbmc = new Device("192.168.1.190", "living room xbmc", EDeviceClass.XBMC, EDeviceProtocol.XBMC,
                new DeviceCapabilities("XBMC"), living_xbmc_args);

            study.AddDevice(study_xbmc);
            study.AddDevice(study_kinect);
            study.AddDevice(study_light);
            bedroom.AddDevice(bedroom_xbmc);
            bedroom.AddDevice(bedroom_kinect);
            bedroom.AddDevice(bedroom_light);
            livingroom.AddDevice(living_xbmc);
            livingroom.AddDevice(living_kinect);

            TheWorld ret = new TheWorld();
            ret.AddRoom(livingroom);
            ret.AddRoom(study);
            ret.AddRoom(bedroom);
            ret.AddRoom(corridor);

            ret.CurrentLocation = study;

            return ret;
        }