Move CultMath into the CultLib monorepo
This commit is contained in:
commit
ea88cfcd05
98 changed files with 3574 additions and 4 deletions
18
packages/cultmath/src/CultMath/bool2.cs
Normal file
18
packages/cultmath/src/CultMath/bool2.cs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
using System;
|
||||
|
||||
namespace CultMath;
|
||||
|
||||
public record struct bool2(bool x, bool y)
|
||||
{
|
||||
public static readonly bool2 @false = new(false, false);
|
||||
public static readonly bool2 @true = new(true, true);
|
||||
|
||||
public bool this[int index] => index switch
|
||||
{
|
||||
0 => x,
|
||||
1 => y,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(index)),
|
||||
};
|
||||
|
||||
public static implicit operator bool2(bool value) => new(value, value);
|
||||
}
|
||||
Loading…
Reference in a new issue