1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-09 23:25:43 +00:00

📕 Reword XML-doc in BooleanExtensions.cs

This commit is contained in:
Oliver Booth 2020-04-18 23:13:30 +01:00
parent be5f450dbf
commit 4461272f59
No known key found for this signature in database
GPG Key ID: 0D7F2EF1C8D2B9C0

View File

@ -5,60 +5,60 @@
/// </summary> /// </summary>
public static class BooleanExtensions public static class BooleanExtensions
{ {
/// <summary> /// <summary>
/// Gets the value of this boolean and another boolean. /// Performs logical AND on this <see cref="bool"/> and another <see cref="bool"/>.
/// </summary> /// </summary>
/// <param name="value">The boolean.</param> /// <param name="value">The boolean.</param>
/// <param name="comparison">The boolean comparator.</param> /// <param name="comparison">The boolean comparator.</param>
/// <returns>Returns <see langword="true"/> when <paramref name="value"/> and <paramref name="comparison"/> are /// <returns>Returns <see langword="true"/> if <paramref name="value"/> AND <paramref name="comparison"/>
/// <see langword="true"/> Otherwise, the output is <see langword="false"/>.</returns> /// evaluate to <see langword="true"/>, or <see langword="false"/> otherwise.</returns>
public static bool And(this bool value, bool comparison) public static bool And(this bool value, bool comparison)
{ {
return value && comparison; return value && comparison;
} }
/// <summary> /// <summary>
/// Gets the value of this boolean and another boolean. /// Performs logical NAND on this <see cref="bool"/> and another <see cref="bool"/>.
/// </summary> /// </summary>
/// <param name="value">The boolean.</param> /// <param name="value">The boolean.</param>
/// <param name="comparison">The boolean comparator.</param> /// <param name="comparison">The boolean comparator.</param>
/// <returns>Returns <see langword="false"/> if <paramref name="value"/> and <paramref name="comparison"/> are /// <returns>Returns <see langword="true"/> if <paramref name="value"/> NAND <paramref name="comparison"/>
/// <see langword="true"/>. Otherwise, <see langword="true"/>.</returns> /// evaluate to <see langword="true"/>, or <see langword="false"/> otherwise.</returns>
public static bool NAnd(this bool value, bool comparison) public static bool NAnd(this bool value, bool comparison)
{ {
return !(value && comparison); return !(value && comparison);
} }
/// <summary> /// <summary>
/// Gets the value of this boolean and another boolean. /// Performs logical NOR on this <see cref="bool"/> and another <see cref="bool"/>.
/// </summary> /// </summary>
/// <param name="value">The boolean.</param> /// <param name="value">The boolean.</param>
/// <param name="comparison">The boolean comparator.</param> /// <param name="comparison">The boolean comparator.</param>
/// <returns>Returns <see langword="true"/> if <paramref name="value"/> and <paramref name="comparison"/> are /// <returns>Returns <see langword="true"/> if <paramref name="value"/> NOR <paramref name="comparison"/>
/// <see langword="false"/>. Otherwise, <see langword="false"/>.</returns> /// evaluate to <see langword="true"/>, or <see langword="false"/> otherwise.</returns>
public static bool NOr(this bool value, bool comparison) public static bool NOr(this bool value, bool comparison)
{ {
return !(value || comparison); return !(value || comparison);
} }
/// <summary> /// <summary>
/// Toggles this booleans current state. /// Performs logical NOT on this <see cref="bool"/>.
/// </summary> /// </summary>
/// <param name="value">The boolean.</param> /// <param name="value">The boolean.</param>
/// <returns>Returns the opposite state of this boolean.</returns> /// <returns>Returns <see langword="true"/> if <paramref name="value"/> is <see langword="false"/>,
public static bool Not(this ref bool value) /// or <see langword="false"/> otherwise.</returns>
public static bool Not(this bool value)
{ {
return value = !value; return !value;
} }
/// <summary> /// <summary>
/// Gets the value of this boolean or another boolean. /// Performs logical OR on this <see cref="bool"/> and another <see cref="bool"/>.
/// </summary> /// </summary>
/// <param name="value">The boolean.</param> /// <param name="value">The boolean.</param>
/// <param name="comparison">The boolean comparator.</param> /// <param name="comparison">The boolean comparator.</param>
/// <returns>Returns <see langword="true"/> if <paramref name="value"/> or <paramref name="comparison"/> is /// <returns>Returns <see langword="true"/> if <paramref name="value"/> OR <paramref name="comparison"/>
/// <see langword="true"/>.</returns> /// evaluate to <see langword="true"/>, or <see langword="false"/> otherwise.</returns>
public static bool Or(this bool value, bool comparison) public static bool Or(this bool value, bool comparison)
{ {
return value || comparison; return value || comparison;
@ -85,25 +85,24 @@
} }
/// <summary> /// <summary>
/// Gets the value of this boolean and another boolean. /// Performs logical XNOR on this <see cref="bool"/> and another <see cref="bool"/>.
/// </summary> /// </summary>
/// <param name="value">The boolean.</param> /// <param name="value">The boolean.</param>
/// <param name="comparison">The boolean comparator.</param> /// <param name="comparison">The boolean comparator.</param>
/// <returns>Returns <see langword="true"/> if <paramref name="value"/> and <paramref name="comparison"/> are /// <returns>Returns <see langword="true"/> if <paramref name="value"/> XNOR <paramref name="comparison"/>
/// the same, Otherwise <see langword="false"/>.</returns> /// evaluate to <see langword="true"/>, or <see langword="false"/> otherwise.</returns>
public static bool XNOr(this bool value, bool comparison) public static bool XNOr(this bool value, bool comparison)
{ {
return !(value ^ comparison); return !(value ^ comparison);
} }
/// <summary> /// <summary>
/// Gets the value of this boolean exclusively or another boolean. /// Performs logical XOR on this <see cref="bool"/> and another <see cref="bool"/>.
/// </summary> /// </summary>
/// <param name="value">The boolean.</param> /// <param name="value">The boolean.</param>
/// <param name="comparison">The boolean comparator.</param> /// <param name="comparison">The boolean comparator.</param>
/// <returns>Returns <see langword="false"/> if <paramref name="value"/> and <paramref name="comparison"/> are /// <returns>Returns <see langword="true"/> if <paramref name="value"/> XOR <paramref name="comparison"/>
/// <see langword="false"/> or if <paramref name="value"/> and <paramref name="comparison"/> are /// evaluate to <see langword="true"/>, or <see langword="false"/> otherwise.</returns>
/// <see langword="true"/>.</returns>
public static bool XOr(this bool value, bool comparison) public static bool XOr(this bool value, bool comparison)
{ {
return value ^ comparison; return value ^ comparison;