Open
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, |
Member
There was a problem hiding this comment.
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
Contributor
Author
There was a problem hiding this comment.
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.
Contributor
Author
|
Docs being made for this on morning. |
Contributor
Author
|
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.
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Proposed Changes
Tasks
Documentation
Notes
No more details, a review on this is required.
Linked
No linked issues.