From 1bee1952f99958f344fa9321f202db85bd47c5ca Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Sat, 18 Apr 2020 23:05:57 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Alphabetize=20method=20definitio?= =?UTF-8?q?ns?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- X10D/src/BooleanExtensions.cs | 103 +++++++++++++++++----------------- 1 file changed, 52 insertions(+), 51 deletions(-) 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; + } } }