src/AnvilPacker/Level/Physics/Direction.cs
/// <summary> Returns the vanilla's direction index from the specified direction, or -1 if <paramref name="dir"/> == None. </summary>
/// <remarks> Undefined behavior if <paramref name="dir"/> is a bitmask containing more than one value. </remarks>
Returns the vanilla's direction index from the specified direction, or -1 if  == None.
Returns the vanilla ' s direction index from the specified direction or - 1 if == None .
public static int Index(this Direction dir)
        {
            if (dir == Direction.None) {
                return -1;
            }
            int index = BitOperations.TrailingZeroCount((int)dir);
            return VanillaIndices[index];
        }
public static int Index ( this Direction dir ) { if ( dir == Direction . None ) { return - 1 ; } int index = BitOperations . TrailingZeroCount ( ( int ) dir ) ; return VanillaIndices [ index ] ; }
Returns the vanilla's direction index from the specified direction, or -1 if  == None.
Returns the vanilla ' s direction index from the specified direction or - 1 if == None .
Direction
this
remarks
Undefined behavior if  is a bitmask containing more than one value.
Undefined behavior if is a bitmask containing more than one value .