示例#1
0
    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);
    }
示例#2
0
    public bool BranchGroupSwitchProcess()
    {
        if (_myDataHub.ActiveBranch.BranchGroupsList.Count <= 1)
        {
            return(false);
        }

        if (_inputScheme.PressedPositiveSwitch())
        {
            if (MustActivateKeysFirst_Branch())
            {
                return(true);
            }
            DoSwitch(SwitchType.Positive, BranchSwitch);
            return(true);
        }

        if (_inputScheme.PressedNegativeSwitch())
        {
            if (MustActivateKeysFirst_Branch())
            {
                return(true);
            }
            DoSwitch(SwitchType.Negative, BranchSwitch);
            return(true);
        }

        return(false);

        void BranchSwitch()
        {
            var activeBranch = _myDataHub.ActiveBranch;

            activeBranch.GroupIndex = BranchGroups.SwitchBranchGroup(activeBranch.BranchGroupsList,
                                                                     activeBranch.GroupIndex,
                                                                     SwitchType);
        }
    }