public PropagationResult Update(ref PropagatedProperty <T> ioState, bool inbForce = false) { PropagationResult result = UpdateSelf(ref ioState, inbForce); if ((result & PropagationResult.UpdateSelf) == 0) { result |= UpdateChildren(ref ioState, inbForce); } return(result); }
public PropagationResult UpdateSelf(ref PropagatedProperty <T> ioState, bool inbForce = false) { T nextSelfValue = Combine(ioState.Self, ioState.m_LastFromParent); if (ioState.SelfMod.HasValue) { nextSelfValue = Combine(nextSelfValue, ioState.SelfMod.Value); } if (inbForce || !m_EqualityComparer.Equals(ioState.m_SelfState, nextSelfValue)) { ioState.m_SelfState = nextSelfValue; return(PropagationResult.UpdateSelf | UpdateChildren(ref ioState, inbForce)); } return(PropagationResult.None); }
public PropagationResult UpdateChildren(ref PropagatedProperty <T> ioState, bool inbForce = false) { T nextChildrenValue = Combine(ioState.m_SelfState, ioState.Children); if (ioState.ChildrenMod.HasValue) { nextChildrenValue = Combine(nextChildrenValue, ioState.ChildrenMod.Value); } if (inbForce || !m_EqualityComparer.Equals(ioState.m_ChildState, nextChildrenValue)) { ioState.m_ChildState = nextChildrenValue; return(PropagationResult.UpdateChildren); } return(PropagationResult.None); }
public void Reset(ref PropagatedProperty <T> ioState, T inFromParent) { ioState.ChildrenMod = null; ioState.SelfMod = null; Reset(ref ioState); ioState.m_LastFromParent = inFromParent; ioState.m_SelfState = Combine(ioState.Self, inFromParent); if (ioState.SelfMod.HasValue) { ioState.m_SelfState = Combine(ioState.m_SelfState, inFromParent); } ioState.m_ChildState = Combine(ioState.m_SelfState, ioState.Children); if (ioState.ChildrenMod.HasValue) { ioState.m_ChildState = Combine(ioState.m_ChildState, ioState.ChildrenMod.Value); } }
protected override void Reset(ref PropagatedProperty <bool> ioState) { ioState.Self = DefaultSelf; ioState.Children = DefaultChildren; }
public PropagationResult Propagate(ref PropagatedProperty <T> ioState, T inFromParent, bool inbForce = false) { ioState.m_LastFromParent = inFromParent; return(UpdateSelf(ref ioState, inbForce)); }
public PropagationResult Propagate(ref PropagatedProperty <T> ioState, in PropagatedProperty <T> inParent, bool inbForce = false)
protected abstract void Reset(ref PropagatedProperty <T> ioState);