Code cleanup

This commit is contained in:
Stone_Red
2026-06-12 15:18:02 +02:00
parent 9f2aae3ba8
commit c70fd501bc
11 changed files with 735 additions and 707 deletions
+33 -35
View File
@@ -1,48 +1,46 @@
using System;
using RemSox.Processing;
using RemSox.Utils;
using YesNt.Interpreter.Runtime;
using YesNt.Interpreter.Utilities;
namespace RemSox.Processes
namespace RemSox.Processes;
public class YesNtInterpreterProcess() : Process("YesNtInterpreter")
{
public class YesNtInterpreterProcess() : Process("YesNtInterpreter")
private YesNtInterpreter interpreter = null!;
internal override void Start(string[] args)
{
YesNtInterpreter interpreter = null!;
// TODO: eventually we want to load these from a file instead of hardcoding them here
args = [
"win_create \"Test\" 320 240",
"global winId = %win_last_id",
"win_flush ${winId}",
"print ${winId}",
"label test:",
"goto test"
];
interpreter = new();
internal override void Start(string[] args)
YesNtWindowStatements.Register(interpreter, this);
interpreter.Prepare([.. args]);
}
internal override void Tick()
{
if (interpreter.IsRunning)
{
// TODO: eventually we want to load these from a file instead of hardcoding them here
args = [
"win_create \"Test\" 320 240",
"global winId = %win_last_id",
"win_flush ${winId}",
"print ${winId}",
"label test:",
"goto test"
];
interpreter = new();
YesNtWindowStatements.Register(interpreter, this);
interpreter.Prepare([.. args]);
_ = interpreter.Step();
}
internal override void Tick()
else
{
if (interpreter.IsRunning)
{
interpreter.Step();
}
else
{
RequestStop();
}
}
internal override void Stop()
{
interpreter.Stop();
RequestStop();
}
}
internal override void Stop()
{
interpreter.Stop();
}
}