public override bool Equals(object obj) { if (this == obj) { return(true); } if (obj == null) { return(false); } if (this.GetType() != obj.GetType()) { return(false); } PowerDescriptor other = (PowerDescriptor)obj; if (AvailablePowerSources == null) { if (other.AvailablePowerSources != null) { return(false); } } else if (!AvailablePowerSources.Equals(other.AvailablePowerSources)) { return(false); } if (CurrentPowerMode != other.CurrentPowerMode) { return(false); } if (CurrentPowerSource != other.CurrentPowerSource) { return(false); } if (PowerLevel != other.PowerLevel) { return(false); } return(true); }