Esempio n. 1
0
 private void SetStartPositions()
 {
     SetDefaultStartPosition();
     LastHighlighted = DefaultStartOnThisNode;
     LastSelected    = DefaultStartOnThisNode;
     if (_groupsList.Count <= 1)
     {
         return;
     }
     GroupIndex = BranchGroups.SetGroupIndex(DefaultStartOnThisNode, _groupsList);
 }
Esempio n. 2
0
    private void SetHighlightedNode()
    {
        if (LastHighlighted.IsNull())
        {
            return;
        }

        if (_canActivateBranch)
        {
            LastHighlighted.SetNodeAsActive();
        }

        GroupIndex = BranchGroups.SetGroupIndex(LastHighlighted, _groupsList);
    }
Esempio n. 3
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);
    }
Esempio n. 4
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);
        }
    }
Esempio n. 5
0
 private void CheckForControlBar() => BranchGroups.AddControlBarToGroupList(_groupsList, _myHub.HomeBranches, this);