Skip to content

Commit

Permalink
Renaming Rng.Byte -> Rng.SByte to match C# naming
Browse files Browse the repository at this point in the history
  • Loading branch information
NoelFB committed Jun 26, 2024
1 parent 404974e commit c9614d5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Framework/Utility/Rng.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,13 @@ public ulong U64()
public short Short(short max) => (short)(max != 0 ? Math.Abs(Short()) % max : 0);
public short Short(short min, short max) => (short)(min + Short((short)(max - min)));

public sbyte Byte() => (sbyte)U64();
public sbyte Byte(sbyte max) => (sbyte)(max != 0 ? Math.Abs(Byte()) % max : 0);
public sbyte Byte(sbyte min, sbyte max) => (sbyte)(min + Byte((sbyte)(max - min)));
[Obsolete("Use SByte or U8")] public sbyte Byte() => (sbyte)U64();
[Obsolete("Use SByte or U8")] public sbyte Byte(sbyte max) => (sbyte)(max != 0 ? Math.Abs(SByte()) % max : 0);
[Obsolete("Use SByte or U8")] public sbyte Byte(sbyte min, sbyte max) => (sbyte)(min + SByte((sbyte)(max - min)));

public sbyte SByte() => (sbyte)U64();
public sbyte SByte(sbyte max) => (sbyte)(max != 0 ? Math.Abs(SByte()) % max : 0);
public sbyte SByte(sbyte min, sbyte max) => (sbyte)(min + SByte((sbyte)(max - min)));

public float Float()
{
Expand Down

0 comments on commit c9614d5

Please sign in to comment.