/** * The equals method doesn't always work--mostly on on classes that consist only of primitives. Be careful. */ public bool equals(UaPdu rhs) { bool ivarsEqual = true; if(rhs.GetType() != this.GetType()) return false; if( ! (_emittingEntityID.Equals( rhs._emittingEntityID) )) ivarsEqual = false; if( ! (_eventID.Equals( rhs._eventID) )) ivarsEqual = false; if( ! (_stateChangeIndicator == rhs._stateChangeIndicator)) ivarsEqual = false; if( ! (_pad == rhs._pad)) ivarsEqual = false; if( ! (_passiveParameterIndex == rhs._passiveParameterIndex)) ivarsEqual = false; if( ! (_propulsionPlantConfiguration == rhs._propulsionPlantConfiguration)) ivarsEqual = false; if( ! (_numberOfShafts == rhs._numberOfShafts)) ivarsEqual = false; if( ! (_numberOfAPAs == rhs._numberOfAPAs)) ivarsEqual = false; if( ! (_numberOfUAEmitterSystems == rhs._numberOfUAEmitterSystems)) ivarsEqual = false; for(int idx = 0; idx < _shaftRPMs.Count; idx++) { ShaftRPMs x = (ShaftRPMs)_shaftRPMs[idx]; if( ! ( _shaftRPMs[idx].Equals(rhs._shaftRPMs[idx]))) ivarsEqual = false; } for(int idx = 0; idx < _apaData.Count; idx++) { ApaData x = (ApaData)_apaData[idx]; if( ! ( _apaData[idx].Equals(rhs._apaData[idx]))) ivarsEqual = false; } for(int idx = 0; idx < _emitterSystems.Count; idx++) { AcousticEmitterSystemData x = (AcousticEmitterSystemData)_emitterSystems[idx]; if( ! ( _emitterSystems[idx].Equals(rhs._emitterSystems[idx]))) ivarsEqual = false; } return ivarsEqual; }
/** * Compares for reference equality and value equality. */ public bool equals(UaPdu rhs) { bool ivarsEqual = true; if (rhs.GetType() != this.GetType()) { return(false); } ivarsEqual = base.Equals(rhs); if (!(_emittingEntityID.Equals(rhs._emittingEntityID))) { ivarsEqual = false; } if (!(_eventID.Equals(rhs._eventID))) { ivarsEqual = false; } if (!(_stateChangeIndicator == rhs._stateChangeIndicator)) { ivarsEqual = false; } if (!(_pad == rhs._pad)) { ivarsEqual = false; } if (!(_passiveParameterIndex == rhs._passiveParameterIndex)) { ivarsEqual = false; } if (!(_propulsionPlantConfiguration == rhs._propulsionPlantConfiguration)) { ivarsEqual = false; } if (!(_numberOfShafts == rhs._numberOfShafts)) { ivarsEqual = false; } if (!(_numberOfAPAs == rhs._numberOfAPAs)) { ivarsEqual = false; } if (!(_numberOfUAEmitterSystems == rhs._numberOfUAEmitterSystems)) { ivarsEqual = false; } if (!(_shaftRPMs.Count == rhs._shaftRPMs.Count)) { ivarsEqual = false; } if (ivarsEqual) { for (int idx = 0; idx < _shaftRPMs.Count; idx++) { if (!(_shaftRPMs[idx].Equals(rhs._shaftRPMs[idx]))) { ivarsEqual = false; } } } if (!(_apaData.Count == rhs._apaData.Count)) { ivarsEqual = false; } if (ivarsEqual) { for (int idx = 0; idx < _apaData.Count; idx++) { if (!(_apaData[idx].Equals(rhs._apaData[idx]))) { ivarsEqual = false; } } } if (!(_emitterSystems.Count == rhs._emitterSystems.Count)) { ivarsEqual = false; } if (ivarsEqual) { for (int idx = 0; idx < _emitterSystems.Count; idx++) { if (!(_emitterSystems[idx].Equals(rhs._emitterSystems[idx]))) { ivarsEqual = false; } } } return(ivarsEqual); }