BO4E.Extensions/ENUM/MengeneinheitExtension.cs
/// <summary>
///     Tests if two Mengeneinheit are convertible into each other / do have the same kind.
/// </summary>
/// <param name="me1"></param>
/// <param name="me2"></param>
/// <returns>true iff convertible</returns>
Tests if two Mengeneinheit are convertible into each other / do have the same kind.
Tests if two Mengeneinheit are convertible into each other / do have the same kind .
public static bool AreConvertible(Mengeneinheit me1, Mengeneinheit me2)
        {
#pragma warning disable 618
            if (me1 == Mengeneinheit.ZERO || me2 == Mengeneinheit.ZERO) return false;
#pragma warning restore 618
            return DimensionSets.Any(einheitengroup => einheitengroup.Contains(me1) && einheitengroup.Contains(me2));
        }
public static bool AreConvertible ( Mengeneinheit me1 , Mengeneinheit me2 ) { pragma warning disable 618 if ( me1 == Mengeneinheit . ZERO || me2 == Mengeneinheit . ZERO ) return false ; pragma warning restore 618 return DimensionSets . Any ( einheitengroup => einheitengroup . Contains ( me1 ) && einheitengroup . Contains ( me2 ) ) ; }
Tests if two Mengeneinheit are convertible into each other / do have the same kind.
Tests if two Mengeneinheit are convertible into each other / do have the same kind .
true iff convertible
true iff convertible
me1
Mengeneinheit
None
me2
Mengeneinheit
None