Skip to content

Commit

Permalink
Generate code, clean up extras
Browse files Browse the repository at this point in the history
  • Loading branch information
Muximize committed Jan 4, 2024
1 parent ce1a6ff commit cfefd26
Show file tree
Hide file tree
Showing 116 changed files with 2,353 additions and 1,876 deletions.
32 changes: 0 additions & 32 deletions UnitsNet/CustomCode/Quantities/Acceleration.extra.cs

This file was deleted.

25 changes: 0 additions & 25 deletions UnitsNet/CustomCode/Quantities/AmountOfSubstance.extra.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,30 +39,5 @@ public static AmountOfSubstance FromMass(Mass mass, MolarMass molarMass)
{
return mass / molarMass;
}

/// <summary>Get <see cref="Mass" /> from <see cref="AmountOfSubstance" /> for a given <see cref="MolarMass" />.</summary>
public static Mass operator *(AmountOfSubstance amountOfSubstance, MolarMass molarMass)
{
return Mass.FromGrams(amountOfSubstance.Moles * molarMass.GramsPerMole);
}

/// <summary>Get <see cref="Mass" /> from <see cref="AmountOfSubstance" /> for a given <see cref="MolarMass" />.</summary>
public static Mass operator *(MolarMass molarMass, AmountOfSubstance amountOfSubstance)
{
return Mass.FromGrams(amountOfSubstance.Moles * molarMass.GramsPerMole);
}

/// <summary>Get <see cref="Molarity" /> from <see cref="AmountOfSubstance" /> divided by <see cref="Volume" />.</summary>
public static Molarity operator /(AmountOfSubstance amountOfComponent, Volume mixtureVolume)
{
return Molarity.FromMolesPerCubicMeter(amountOfComponent.Moles / mixtureVolume.CubicMeters);
}

/// <summary>Get <see cref="Volume" /> from <see cref="AmountOfSubstance" /> divided by <see cref="Molarity" />.</summary>
public static Volume operator /(AmountOfSubstance amountOfSubstance, Molarity molarity)
{
return Volume.FromCubicMeters(amountOfSubstance.Moles / molarity.MolesPerCubicMeter);
}

}
}
22 changes: 0 additions & 22 deletions UnitsNet/CustomCode/Quantities/Angle.extra.cs

This file was deleted.

42 changes: 0 additions & 42 deletions UnitsNet/CustomCode/Quantities/Area.extra.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,47 +23,5 @@ public static Area FromCircleRadius(Length radius)
}

#endregion

/// <summary>
/// Calculates the inverse of this quantity.
/// </summary>
/// <returns>The corresponding inverse quantity, <see cref="ReciprocalArea"/>.</returns>
public ReciprocalArea Inverse()
{
if (SquareMeters == 0.0)
return new ReciprocalArea(0.0, UnitsNet.Units.ReciprocalAreaUnit.InverseSquareMeter);

return new ReciprocalArea(1 / SquareMeters, UnitsNet.Units.ReciprocalAreaUnit.InverseSquareMeter);
}

/// <summary>Get <see cref="Length"/> from <see cref="Area"/> divided by <see cref="Length"/>.</summary>
public static Length operator /(Area area, Length length)
{
return Length.FromMeters(area.SquareMeters / length.Meters);
}

/// <summary>Get <see cref="MassFlow"/> from <see cref="Area"/> times <see cref="MassFlux"/>.</summary>
public static MassFlow operator *(Area area, MassFlux massFlux)
{
return MassFlow.FromGramsPerSecond(area.SquareMeters * massFlux.GramsPerSecondPerSquareMeter);
}

/// <summary>Get <see cref="VolumeFlow"/> from <see cref="Area"/> times <see cref="Speed"/>.</summary>
public static VolumeFlow operator *(Area area, Speed speed)
{
return VolumeFlow.FromCubicMetersPerSecond(area.SquareMeters * speed.MetersPerSecond);
}

/// <summary>Get <see cref="LinearDensity"/> from <see cref="Area"/> times <see cref="Density"/>.</summary>
public static LinearDensity operator *(Area area, Density density)
{
return LinearDensity.FromKilogramsPerMeter(area.SquareMeters * density.KilogramsPerCubicMeter);
}

/// <summary>Get <see cref="Ratio"/> from <see cref="Area"/> times <see cref="ReciprocalArea"/>.</summary>
public static Ratio operator *(Area area, ReciprocalArea reciprocalArea)
{
return Ratio.FromDecimalFractions(area.SquareMeters * reciprocalArea.InverseSquareMeters);
}
}
}
14 changes: 0 additions & 14 deletions UnitsNet/CustomCode/Quantities/AreaDensity.extra.cs

This file was deleted.

14 changes: 0 additions & 14 deletions UnitsNet/CustomCode/Quantities/AreaMomentOfInertia.extra.cs

This file was deleted.

This file was deleted.

This file was deleted.

46 changes: 0 additions & 46 deletions UnitsNet/CustomCode/Quantities/Density.extra.cs

This file was deleted.

24 changes: 0 additions & 24 deletions UnitsNet/CustomCode/Quantities/Duration.extra.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,29 +92,5 @@ public static explicit operator Duration(TimeSpan duration)
{
return timeSpan.TotalSeconds >= duration.Seconds;
}

/// <summary>Get <see cref="Volume"/> from <see cref="Duration"/> multiplied by <see cref="VolumeFlow"/>.</summary>
public static Volume operator *(Duration duration, VolumeFlow volumeFlow)
{
return Volume.FromCubicMeters(volumeFlow.CubicMetersPerSecond * duration.Seconds);
}

/// <summary>Get <see cref="ElectricCharge"/> from <see cref="Duration"/> multiplied by <see cref="ElectricCurrent"/>.</summary>
public static ElectricCharge operator *(Duration time, ElectricCurrent current)
{
return ElectricCharge.FromAmpereHours(current.Amperes * time.Hours);
}

/// <summary>Get <see cref="Speed"/> from <see cref="Duration"/> multiplied by <see cref="Acceleration"/>.</summary>
public static Speed operator *(Duration duration, Acceleration acceleration)
{
return new Speed(acceleration.MetersPerSecondSquared * duration.Seconds, SpeedUnit.MeterPerSecond);
}

/// <summary>Get <see cref="Force"/> from <see cref="Duration"/> multiplied by <see cref="ForceChangeRate"/>.</summary>
public static Force operator *(Duration duration, ForceChangeRate forceChangeRate)
{
return new Force(forceChangeRate.NewtonsPerSecond * duration.Seconds, ForceUnit.Newton);
}
}
}
14 changes: 0 additions & 14 deletions UnitsNet/CustomCode/Quantities/DynamicViscosity.extra.cs

This file was deleted.

26 changes: 0 additions & 26 deletions UnitsNet/CustomCode/Quantities/ElectricCharge.extra.cs

This file was deleted.

22 changes: 0 additions & 22 deletions UnitsNet/CustomCode/Quantities/ElectricConductivity.extra.cs

This file was deleted.

42 changes: 0 additions & 42 deletions UnitsNet/CustomCode/Quantities/ElectricCurrent.extra.cs

This file was deleted.

Loading

0 comments on commit cfefd26

Please sign in to comment.