public double GetUnitSalesPrice(double cp) { int gpm = Gpm.getGpm(cp); double result = _strategy.calculate(cp, gpm); return(result); }
/// <summary> /// Returns true if Profitability instances are equal /// </summary> /// <param name="other">Instance of Profitability to be compared</param> /// <returns>Boolean</returns> public bool Equals(Profitability other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Roe == other.Roe || Roe != null && Roe.Equals(other.Roe) ) && ( Npm == other.Npm || Npm != null && Npm.Equals(other.Npm) ) && ( Gpm == other.Gpm || Gpm != null && Gpm.Equals(other.Gpm) ) && ( Np == other.Np || Np != null && Np.Equals(other.Np) ) && ( Eps == other.Eps || Eps != null && Eps.Equals(other.Eps) ) && ( Mbr == other.Mbr || Mbr != null && Mbr.Equals(other.Mbr) ) && ( Ts == other.Ts || Ts != null && Ts.Equals(other.Ts) ) && ( Cs == other.Cs || Cs != null && Cs.Equals(other.Cs) )); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hashCode = 41; // Suitable nullity checks etc, of course :) if (Roe != null) { hashCode = hashCode * 59 + Roe.GetHashCode(); } if (Npm != null) { hashCode = hashCode * 59 + Npm.GetHashCode(); } if (Gpm != null) { hashCode = hashCode * 59 + Gpm.GetHashCode(); } if (Np != null) { hashCode = hashCode * 59 + Np.GetHashCode(); } if (Eps != null) { hashCode = hashCode * 59 + Eps.GetHashCode(); } if (Mbr != null) { hashCode = hashCode * 59 + Mbr.GetHashCode(); } if (Ts != null) { hashCode = hashCode * 59 + Ts.GetHashCode(); } if (Cs != null) { hashCode = hashCode * 59 + Cs.GetHashCode(); } return(hashCode); } }