public IInfoReport Subtract(IInfoReport targetFromThisObject) { // Probably will be unused for this report type. if (targetFromThisObject is PEQNodeInfoReport) { int newID; double newTimestamp; ILocation newLocation; bool sameNode = false; if (targetFromThisObject.ID == _id) { sameNode = true; newID = _id; newLocation = _location; } else { sameNode = false; newID = int.MaxValue; newLocation = null; } if (targetFromThisObject.Time > _timestamp) newTimestamp = targetFromThisObject.Time; else newTimestamp = _timestamp; PEQInfoReport target = (PEQInfoReport)targetFromThisObject; PEQInfoReport output = new PEQInfoReport(newID, newTimestamp, _key, _label); output._location = newLocation; return output; } else return null; }
/* / \ * // | \\ * / | \ * | */ public IInfoReport Add(IInfoReport withTarget) { if (withTarget is PEQNodeInfoReport) { int newID; double newTimestamp; ILocation newLocation; bool sameNode; if (withTarget.ID == _id) { sameNode = true; newID = _id; newLocation = _location; } else { sameNode = false; newID = int.MaxValue; newLocation = null; } if (withTarget.Time > _timestamp) newTimestamp = withTarget.Time; else newTimestamp = _timestamp; PEQInfoReport target = (PEQInfoReport)withTarget; PEQInfoReport output = new PEQInfoReport(newID, newTimestamp, _key, _label); output._location = newLocation; return output; } else return null; }