private bool IsBlockingState(Relation.RelationType type) { if (type == Relation.RelationType.Condition) { return(!Excluded && !Executed); } if (type == Relation.RelationType.Milestone) { return(!Excluded && Pending); } return(false); // Others can't block execution }
private void ChangeState(Relation.RelationType type) { switch (type) { case Relation.RelationType.Include: Excluded = false; break; case Relation.RelationType.Exclude: Excluded = true; break; case Relation.RelationType.Response: Pending = true; break; } }
private void TryDischarge(Relation.RelationType type) { if (!IsBlockingState(type)) { return; } TryExecute(); if (!IsBlockingState(type)) { return; } TryExclude(); if (!IsBlockingState(type)) { return; } TryMakeExecuteable(); TryExecute(); }