Open alikindsys opened 3 years ago
DependsAttribute
- #47/1
Adds a DependsAttribute to the spec of #47.
Add a way for making systems interdependent - #9
That would require a way to know which systems have attempted registering, like an UnloadedSystems
hashset.
SystemManager would also need a way to load each system recursively, based on the dependencies of each system.
If a system has a [Depends]
, SystemManager will try to register the dependencies first, if said systems aren't registered yet,
or haven't been attempted registry yet, adding said system onto UnloadedSystems
in the case of a dependency missing.
After some consideration, knowing the reason of why a system was unloaded is extremely helpful. An UnloadingReason
data type could be added with Type
and Reason
Fields. Type would be an enum containing MANUAL_REQUEST
, DEPENDENCY_MISSING
, LOADING_ERROR (happens if IsEnabled is set to false on code, better name could be chosen)
, while the reason field would be a string containing, on the case of a dependency which dependency(ies) caused the system to be unloaded. That later could neatly be displayed via the systems.status
command.
The 3.0 Spec is currently implemented. 47/1 - DependsAttribute
extension will be postponed to a minor version after 2.0 release.
Here is the currently proposed
SystemManager
API specificationBaseSystem
will exposeSisbaseBot SisbaseInstance
ClientSystem
will exposeDiscordClient Client
Getting a system in a command