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:
parent
892c1f6a14
commit
c8e4be954e
1 changed files with 5 additions and 11 deletions
|
|
@ -56,24 +56,18 @@ namespace Raylib_cs
|
||||||
* to a native boolean or integer, or a CBool.
|
* to a native boolean or integer, or a CBool.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Between CBools
|
// Addition
|
||||||
public static CBool operator +(CBool left, CBool right)
|
public static CBool operator +(CBool left, CBool right)
|
||||||
{
|
{
|
||||||
return new CBool { value = (sbyte)(left.value + right.value) };
|
return new CBool { value = (sbyte)(left.value + right.value) };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Subtraction
|
||||||
|
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)
|
|
||||||
{
|
|
||||||
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) };
|
|
||||||
}
|
|
||||||
|
|
||||||
// ToString override
|
// ToString override
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue