Skip to content

Commit

Permalink
alphabetize
Browse files Browse the repository at this point in the history
  • Loading branch information
ike709 committed Feb 8, 2025
1 parent b7548e0 commit 696bf9a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion DMCompiler/DMStandard/_Standard.dm
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ proc/rgb(R, G, B, A, space) as text|null
proc/rgb2num(color, space = COLORSPACE_RGB) as /list
proc/roll(ndice = 1, sides) as num
proc/round(A, B) as num
proc/sign(A) as num
proc/sha1(input) as text|null
proc/shutdown(Addr,Natural = 0)
proc/sign(A) as num
proc/sleep(Delay)
proc/sorttext(T1, T2) as num
proc/sorttextEx(T1, T2) as num
Expand Down
2 changes: 1 addition & 1 deletion OpenDreamRuntime/Procs/Native/DreamProcNative.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ public static void SetupNativeProcs(DreamObjectTree objectTree) {
objectTree.SetGlobalNativeProc(DreamProcNativeRoot.NativeProc_rgb2num);
objectTree.SetGlobalNativeProc(DreamProcNativeRoot.NativeProc_roll);
objectTree.SetGlobalNativeProc(DreamProcNativeRoot.NativeProc_round);
objectTree.SetGlobalNativeProc(DreamProcNativeRoot.NativeProc_sign);
objectTree.SetGlobalNativeProc(DreamProcNativeRoot.NativeProc_sha1);
objectTree.SetGlobalNativeProc(DreamProcNativeRoot.NativeProc_shutdown);
objectTree.SetGlobalNativeProc(DreamProcNativeRoot.NativeProc_sign);
objectTree.SetGlobalNativeProc(DreamProcNativeRoot.NativeProc_sleep);
objectTree.SetGlobalNativeProc(DreamProcNativeRoot.NativeProc_sorttext);
objectTree.SetGlobalNativeProc(DreamProcNativeRoot.NativeProc_sorttextEx);
Expand Down
32 changes: 16 additions & 16 deletions OpenDreamRuntime/Procs/Native/DreamProcNativeRoot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2380,22 +2380,6 @@ public static DreamValue NativeProc_roll(NativeProc.Bundle bundle, DreamObject?
return new DreamValue(total);
}

[DreamProc("sign")]
[DreamProcParameter("A", Type = DreamValueTypeFlag.Float)]
public static DreamValue NativeProc_sign(NativeProc.Bundle bundle, DreamObject? src, DreamObject? usr) {
if (bundle.Arguments.Length != 1) throw new Exception($"expected 1 argument (found {bundle.Arguments.Length})");
DreamValue arg = bundle.GetArgument(0, "A");

// Any non-num returns 0
if (!arg.TryGetValueAsFloat(out var value)) return new DreamValue(0);

return value switch {
0 => new DreamValue(0),
< 0 => new DreamValue(-1),
_ => new DreamValue(1)
};
}

[DreamProc("sha1")]
[DreamProcParameter("T", Type = DreamValueTypeFlag.String | DreamValueTypeFlag.DreamResource)]
public static DreamValue NativeProc_sha1(NativeProc.Bundle bundle, DreamObject? src, DreamObject? usr) {
Expand Down Expand Up @@ -2441,6 +2425,22 @@ public static DreamValue NativeProc_shutdown(NativeProc.Bundle bundle, DreamObje
return DreamValue.Null;
}

[DreamProc("sign")]
[DreamProcParameter("A", Type = DreamValueTypeFlag.Float)]
public static DreamValue NativeProc_sign(NativeProc.Bundle bundle, DreamObject? src, DreamObject? usr) {
if (bundle.Arguments.Length != 1) throw new Exception($"expected 1 argument (found {bundle.Arguments.Length})");
DreamValue arg = bundle.GetArgument(0, "A");

// Any non-num returns 0
if (!arg.TryGetValueAsFloat(out var value)) return new DreamValue(0);

return value switch {
0 => new DreamValue(0),
< 0 => new DreamValue(-1),
_ => new DreamValue(1)
};
}

[DreamProc("sleep")]
[DreamProcParameter("Delay", Type = DreamValueTypeFlag.Float)]
public static async Task<DreamValue> NativeProc_sleep(AsyncNativeProc.State state) {
Expand Down

0 comments on commit 696bf9a

Please sign in to comment.