Watch
2
0
Fork
You've already forked raylib-cs
0

Update CBool.cs

Left-handed and Right-handed operators were redundant due to previous casts. Also added the subtraction operation which I had forgotten.
This commit is contained in:
Fall 2022-05-26 22:10:29 -03:00 committed by GitHub
commit c8e4be954e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -56,22 +56,16 @@ namespace Raylib_cs
* to a native boolean or integer, or a CBool.
*/
// Between CBools
// Addition
public static CBool operator +(CBool left, CBool right)
{
return new CBool { value = (sbyte)(left.value + right.value) };
}
// Left-hand CBool
public static CBool operator +(CBool left, bool right)
// Subtraction
public static CBool operator -(CBool left, CBool right)
{
return new CBool { value = (sbyte)(left.value + (right ? 1 : 0)) };
}
// Right-hand CBool
public static CBool operator +(bool left, CBool right)
{
return new CBool { value = (sbyte)((left ? 1 : 0) + right.value) };
return new CBool { value = (sbyte)(left.value - right.value) };
}
// ToString override