示例#1
0
        private static void SwitchDeviceType(string devType, BaseDevice curDevice)
        {
            LogUtil.Write("Switching type to " + devType);
            switch (devType)
            {
            case "SideKick": {
                var newDevice = new SideKick(curDevice);
                DataUtil.SetItem("MyDevice", newDevice);
                DataUtil.InsertDsDevice(newDevice);
                break;
            }

            case "DreamScreen4K": {
                var newDevice = new DreamScreen4K(curDevice);
                DataUtil.SetItem("MyDevice", newDevice);
                DataUtil.InsertDsDevice(newDevice);
                break;
            }

            case "Connect": {
                var newDevice = new Connect(curDevice);
                DataUtil.SetItem("MyDevice", newDevice);
                DataUtil.InsertDsDevice(newDevice);
                break;
            }
            }
        }
示例#2
0
 public IActionResult PostSk([FromBody] SideKick skDevice)
 {
     LogUtil.Write(@"Did it work? " + JsonConvert.SerializeObject(skDevice));
     DataUtil.SetItem("MyDevice", skDevice);
     NotifyClients();
     return(Ok("ok"));
 }
 void OnTriggerStay2D(Collider2D other)
 {
     if (other.CompareTag("SideKick"))
     {
         if (controller.isDashing)
         {
             SideKick sideKick = other.GetComponent <SideKick>();
             sideKick.Die();
         }
     }
 }
示例#4
0
        private static DataStore SetDefaults(DataStore store)
        {
            store.InsertItem("dsIp", "0.0.0.0");
            BaseDevice myDevice = new SideKick(GetLocalIpAddress());

            myDevice.Initialize();
            var bList = HueBridge.FindBridges();
            var bData = bList.Select(lb => new BridgeData(lb.IpAddress, lb.BridgeId)).ToList();

            store.InsertItem("myDevice", myDevice);
            store.InsertItem("emuType", "SideKick");
            store.InsertItem("bridges", bData);
            store.InsertItem("devices", Array.Empty <BaseDevice>());
            return(store);
        }
 public IActionResult PostSk([FromBody] SideKick skDevice)
 {
     Console.WriteLine(@"Did it work? " + JsonConvert.SerializeObject(skDevice));
     DreamData.SetItem("myDevice", skDevice);
     return(Ok("ok"));
 }
示例#6
0
 public override void Announce()
 {
     Hero.Introduce("We're Gotham City and our Dark Night is");
     // we can easily do something with our new interface here
     SideKick.Introduce("And the Boy Wonder is");
 }