You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Changing the code gen to put operators in separate parts should not be too hard but in practice it will probably be some pain as the code gen is pretty broken as it is now.
The idea in the beginning was to have the generator UI allowing people to create unit systems of their own choice and generate code for it. Last time I tried the UI thing it was not awesome either.
I'm not sure what your use case is but maybe it is easiest to take the current Time.generated.cs and remove all references to undesired types? Should mostly be the operators IIRC.
I can take and remove. Same time I can write MyTime. Not sure where balance is.
Same not only for time, but for Unitless
/// <summary>
/// Multiplies <paramref name="left"/> with <paramref name="right"/>
/// </summary>
/// <param name="left">The left value</param>
/// <param name="right">The right value</param>
/// <returns>The <see cref="Angle"/> that is the result from the multiplication.</returns>
public static Angle operator *(Unitless left, AnglePerUnitless right)
{
return Angle.FromRadians(left.scalar * right.radiansPerUnitless);
}
I want to copy some Time from https://github.com/GuOrg/Gu.Units/blob/master/Gu.Units/Time.generated.cs . But right now it mixed with all other units. Could generator put time only items into separate cs file? No links to all other not fundamental to time quantities.
The text was updated successfully, but these errors were encountered: