/// <summary> /// Compares two <see cref="ModKeys"/>. Use this instead of == or .Equals!! /// </summary> public static bool Compare(this ModKeys mk, ModKeys to) { var mk_side = mk.ExportSide(); var to_side = to.ExportSide(); if (mk_side != ModKeys.RLKey && to_side != ModKeys.RLKey && mk_side != to_side) { return(false); } return(((int)mk & ~3) == ((int)to & ~3)); //compare with elimination of sides. }
/// <summary> /// Compares two <see cref="ModKeys"/>. Use this instead of == or .Equals!! /// </summary> public static bool Compare(this ModKeys mk, ModKeys to) { var mk_side = mk.ExportSide(); var to_side = to.ExportSide(); if (mk_side != ModKeys.RLKey && to_side != ModKeys.RLKey && mk_side != to_side) return false; return ((int) mk & ~3) == ((int) to & ~3); //compare with elimination of sides. }