mirror of
https://github.com/Stone-Red-Code/RemSox.git
synced 2026-09-04 09:06:23 +02:00
Reorganize project structure
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
using RemSox.Kernel.Logging;
|
||||
using RemSox.Kernel.Processing.IPC;
|
||||
using RemSox.Kernel.UI.GUI.Windows;
|
||||
|
||||
using System.Drawing;
|
||||
|
||||
namespace RemSox.Kernel.Processing;
|
||||
|
||||
public abstract class Process(string name)
|
||||
{
|
||||
public int Id { get; init; } // Will be set by ProcessManager when the process is spawned
|
||||
|
||||
public ILogger Logger { protected get; init; } = null!; // Will be set by ProcessManager when the process is spawned
|
||||
|
||||
public string Name { get; set; } = name;
|
||||
|
||||
public bool StopRequested { get; private set; } = false;
|
||||
|
||||
public bool IsRunning => !StopRequested;
|
||||
|
||||
internal virtual void Start(string[] args) { }
|
||||
|
||||
internal abstract void Tick();
|
||||
|
||||
internal virtual void Stop() { }
|
||||
|
||||
internal virtual void HandleInterProcessMessage(Message message)
|
||||
{
|
||||
}
|
||||
|
||||
protected Window CreateWindow(string title, Size size)
|
||||
{
|
||||
return WindowManager.CreateWindow(this, title, size);
|
||||
}
|
||||
|
||||
protected Window CreateWindow(string title, Size size, Point position)
|
||||
{
|
||||
return WindowManager.CreateWindow(this, title, size, position);
|
||||
}
|
||||
|
||||
protected void SendMessageToProcess(int targetProcessId, Message message)
|
||||
{
|
||||
InterProcessCommunicator.Send(targetProcessId, message, this);
|
||||
}
|
||||
|
||||
protected void SendMessageToAllProcesses(Message message)
|
||||
{
|
||||
InterProcessCommunicator.SendToAll(message, this);
|
||||
}
|
||||
|
||||
internal void RequestStop()
|
||||
{
|
||||
StopRequested = true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user