diff --git a/X10D/src/BooleanExtensions.cs b/X10D/src/BooleanExtensions.cs index dcd5844..abea738 100644 --- a/X10D/src/BooleanExtensions.cs +++ b/X10D/src/BooleanExtensions.cs @@ -5,35 +5,6 @@ /// public static class BooleanExtensions { - /// - /// Gets an integer value that represents this boolean. - /// - /// The boolean. - /// Returns 1 if is , 0 otherwise. - public static int ToInt32(this bool value) - { - return value ? 1 : 0; - } - - /// - /// Gets a byte value that represents this boolean. - /// - /// The boolean. - /// Returns 00000001 if is , otherwise 0000000. - public static byte ToByte(this bool value) - { - return value ? (byte)1 : (byte)0; - } - - /// - /// Toggles this booleans current state. - /// - /// The boolean. - /// Returns the opposite state of this boolean. - public static bool Not(this ref bool value) - { - return value = !value; - } /// /// Gets the value of this boolean and another boolean. @@ -46,28 +17,6 @@ return value && comparison; } - /// - /// Gets the value of this boolean or another boolean. - /// - /// The boolean. - /// The boolean comparator. - /// Returns if or is . - public static bool Or(this bool value, bool comparison) - { - return value || comparison; - } - - /// - /// Gets the value of this boolean exclusively or another boolean. - /// - /// The boolean. - /// The boolean comparator. - /// Returns if and are or if and are . - public static bool XOr(this bool value, bool comparison) - { - return value ^ comparison; - } - /// /// Gets the value of this boolean and another boolean. /// @@ -90,6 +39,47 @@ return !(value || comparison); } + /// + /// Toggles this booleans current state. + /// + /// The boolean. + /// Returns the opposite state of this boolean. + public static bool Not(this ref bool value) + { + return value = !value; + } + + /// + /// Gets the value of this boolean or another boolean. + /// + /// The boolean. + /// The boolean comparator. + /// Returns if or is . + public static bool Or(this bool value, bool comparison) + { + return value || comparison; + } + + /// + /// Gets an integer value that represents this boolean. + /// + /// The boolean. + /// Returns 1 if is , 0 otherwise. + public static int ToInt32(this bool value) + { + return value ? 1 : 0; + } + + /// + /// Gets a byte value that represents this boolean. + /// + /// The boolean. + /// Returns 00000001 if is , otherwise 0000000. + public static byte ToByte(this bool value) + { + return value ? (byte)1 : (byte)0; + } + /// /// Gets the value of this boolean and another boolean. /// @@ -100,5 +90,16 @@ { return !(value ^ comparison); } + + /// + /// Gets the value of this boolean exclusively or another boolean. + /// + /// The boolean. + /// The boolean comparator. + /// Returns if and are or if and are . + public static bool XOr(this bool value, bool comparison) + { + return value ^ comparison; + } } }