mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-12 18:27:24 +01:00
Some more reworking
This commit is contained in:
parent
6a4b5fc3b2
commit
dad146d043
41 changed files with 1714 additions and 1320 deletions
34
Glamourer.GameData/Customization/CustomizeValue.cs
Normal file
34
Glamourer.GameData/Customization/CustomizeValue.cs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
namespace Glamourer.Customization;
|
||||
|
||||
public record struct CustomizeValue(byte Value)
|
||||
{
|
||||
public static readonly CustomizeValue Zero = new(0);
|
||||
public static readonly CustomizeValue Max = new(0xFF);
|
||||
|
||||
public static CustomizeValue Bool(bool b)
|
||||
=> b ? Max : Zero;
|
||||
|
||||
public static explicit operator CustomizeValue(byte value)
|
||||
=> new(value);
|
||||
|
||||
public static CustomizeValue operator ++(CustomizeValue v)
|
||||
=> new(++v.Value);
|
||||
|
||||
public static CustomizeValue operator --(CustomizeValue v)
|
||||
=> new(--v.Value);
|
||||
|
||||
public static bool operator <(CustomizeValue v, int count)
|
||||
=> v.Value < count;
|
||||
|
||||
public static bool operator >(CustomizeValue v, int count)
|
||||
=> v.Value > count;
|
||||
|
||||
public static CustomizeValue operator +(CustomizeValue v, int rhs)
|
||||
=> new((byte)(v.Value + rhs));
|
||||
|
||||
public static CustomizeValue operator -(CustomizeValue v, int rhs)
|
||||
=> new((byte)(v.Value - rhs));
|
||||
|
||||
public override string ToString()
|
||||
=> Value.ToString();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue