-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(process): rework #108
base: main
Are you sure you want to change the base?
fix(process): rework #108
Conversation
Forgot to modify the src file where the imports are done.
src/index.ts
Outdated
return Process.processes.get(name)!; | ||
export function process( | ||
name: string, | ||
executionGroup?: RBXScriptSignal, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can execution group be the same as in the ECS? It seems weird to have the same name in two places but supporting different functionality
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking on this as well, I was going to discuss this with Luna, if processes can be the same as Systems as in the ECS.
Docs being made for this on morning. |
This worths giving it a show, current way of interacting with a process. /**
* Schedulers
*/
class PreHighScheduler extends Scheduler {
constructor() {
super();
this.executionGroup = RunService.PreSimulation;
}
/** Methods of your own */
}
export const CameraScheduler = new PreHighScheduler()
CameraScheduler.schedule(process: Process); // Schedules a new process to the current scheduler.
CameraScheduler.unschedule(process: Process); // Unschedules the process within the next resumption cycle
CameraScheduler.suspend(process: Process, nOfTicks: number); // Suspends specified process.
CameraScheduler.unsuspend(process: Process); // Unsuspends process within the next resumption cycle
CameraScheduler.has(process: Process); // Checks whether the process is owned by this Scheduler.
CameraScheduler.isSuspended(process: Process); // Returns true if the process it's suspended.
CameraScheduler.stop(); // Stops all current on-going tasks.
CameraScheduler.resume(); // Resumes Scheduler.
/**
* Processes
*/
class BuildingCameraProcess extends Process {
constructor() {
super()
this.scheduler = CameraScheduler;
}
public override update(): void {
...moveCamera;
}
}
// Whenever the process is needed, it shall be created.
OnInput(() => {
const CameraProcess = new BuildingCameraProcess();
CameraProcess.suspend(nOfTicks: number); // Suspends current process n amount of ticks.
CameraProcess.resume(); // Resumes current process (deferred to the end of the current resumption cycle).
CameraProcess.status(); // Returns current status of the Process (active | dead | suspended | unknown).
CameraProcess.delete(); // Unschedules itself from its scheduler.
}) |
Description
Proposed Changes
Tasks
Documentation
Notes
No more details, a review on this is required.
Linked
No linked issues.