private void SaveAllowKeys(IAllowKeys args) { _allowKeys = args.CanAllowKeys; if (!_allowKeys) { _currentSwitchFunction = SwitchFunction.Unset; } }
private bool MustActivateKeysFirst_GOUI() { if (_currentSwitchFunction != SwitchFunction.GOUI) { _currentSwitchFunction = SwitchFunction.GOUI; SwitchType = SwitchType.Activate; ChangeControls?.Invoke(this); _switcher.UseGOUISwitcher(SwitchType); return(true); } return(false); }
private bool MustActivateKeysFirst_Switch() { if (_currentSwitchFunction != SwitchFunction.UI) { _currentSwitchFunction = SwitchFunction.UI; SwitchType = SwitchType.Activate; ChangeControls?.Invoke(this); _homeGroup.SwitchHomeGroups(SwitchType); return(true); } return(false); }
private bool MustActivateKeysFirst_Branch() { if (_currentSwitchFunction != SwitchFunction.Branch) { _currentSwitchFunction = SwitchFunction.Branch; SwitchType = SwitchType.Activate; ChangeControls?.Invoke(this); var activeBranch = _myDataHub.ActiveBranch; activeBranch.GroupIndex = BranchGroups.SwitchBranchGroup(activeBranch.BranchGroupsList, activeBranch.GroupIndex, SwitchType.Activate); return(true); } return(false); }
/***Float Switch Activated***/ public static bool GetWaterLevelGroupSwitchesActivated(string name, SwitchFunction function = SwitchFunction.ATO) { CheckWaterLevelGroupKey(name); bool activated = true; foreach (var switchName in waterLevelGroups[name].floatSwitches) { var floatSwitch = Sensors.FloatSwitches.GetGadget(switchName) as FloatSwitch; if (floatSwitch.switchFuntion == function) { // Using AND because we want all the switches to be activated activated &= floatSwitch.activated; } } return(activated); }
private void SaveOnHomeScreen(IOnHomeScreen args) { _currentSwitchFunction = SwitchFunction.Unset; _onHomeScreen = args.OnHomeScreen; }