public bool IsValidSwitchTo(TState stateId, out TState activeSibling) { for (int i = 0; i < _activeHierarchyPath.Count; i++) { if (AreEquals(_activeHierarchyPath[i].Key, stateId) || _stateHierarchy.AreSiblings(_activeHierarchyPath[i].Key, stateId)) { activeSibling = _activeHierarchyPath[i].Key; return(true); } } activeSibling = default; return(false); }
private bool TargetIsSiblingOfSource(TState sourceState, TState targetState) { return(_stateHierarchy.AreSiblings(sourceState, targetState)); }