RegexKSP.NodeState.compare C# (CSharp) Method

compare() public method

public compare ( ManeuverNode m ) : bool
m ManeuverNode
return bool
        public bool compare(ManeuverNode m)
        {
            if(deltaV.x != m.DeltaV.x || deltaV.y != m.DeltaV.y || deltaV.z != m.DeltaV.z || UT != m.UT) {
                return false;
            }
            return true;
        }

Usage Example

コード例 #1
0
 public void updateNode()
 {
     // Node manager policy:
     // if the manager has been changed from the last update manager snapshot, take the manager
     // UNLESS
     // if the node has been changed from the last update node snapshot, take the node
     if (curNodeState.compare(node))
     {
         // the node hasn't changed, do our own thing
         if (changed)
         {
             if (node.attachedGizmo != null)
             {
                 node.attachedGizmo.DeltaV = curState.getVector();
                 node.attachedGizmo.UT     = curState.UT;
             }
             node.OnGizmoUpdated(curState.getVector(), curState.UT);
             updateCurrentNodeState();
             changed = false;                     // new
         }
     }
     else
     {
         // the node has changed, take the node's new information for ourselves.
         updateCurrentNodeState();
         curState.update(node);
     }
 }