public void AddState(TState stateId, IState stateObj) { ValidateDoesNotContainsStateId(stateId); ValidateStateObjectIsNotNull(stateObj); var node = new StateHierarchyNode(stateId, stateObj, _stateComparer); _states.Add(stateId, node); _roots.Add(stateId, node); if (StateCount == 1) { InitialState = stateId; } }
private bool HasParent(StateHierarchyNode node) { return(node.Parent != null); }