class SystemDAG
SystemDAG
()
|
Signature
constructor() Returns SystemDAG |
addSystem
(
system
, priorityGroup
)
|
Adds a system to the dependency graph.
This method:
Signature
fun addSystem(system: SystemBase, priorityGroup: PriorityGroup = PriorityGroup.NORMAL) Parameters Throws IllegalArgumentException
If the system is already registered
|
findSystem
(
clazz
)
|
Finds a system in the dependency graph. Throws an exception if the system is not found.
Signature
fun <T : SystemBase> findSystem(clazz: KClass<T>): T Parameters clazz: KClass
The class reference of the system to find
Throws Exception
If the system is not registered with the SystemManager
|
getEarlySystems
()
|
Gets the list of early systems that runs before all other systems.
Signature
fun getEarlySystems(): List<SystemBase> Returns List
The list of early systems
|
getLateSystems
()
|
Gets the list of late systems that runs after all other systems.
Signature
fun getLateSystems(): List<SystemBase> Returns List
The list of late systems
|
getUnorderedLateExecuteSystems
()
|
Gets the list of all systems that implement LateExecuteSystem that have been added to the DAG. The order of the systems is NOT guaranteed.
Signature
fun getUnorderedLateExecuteSystems(): List<SystemBaseWithLateExecute> Returns List
The list of all LateExecuteSystems in the DAG (unordered)
|
removeSystem
(
clazz
)
|
Removes a system from the dependency graph.
Signature
fun <T : SystemBase> removeSystem(clazz: KClass<T>): Boolean Parameters clazz: KClass
The class reference of the system to remove
Returns Boolean
True if the system was found and removed, false otherwise
|
removeSystem
()
|
Removes a system from the dependency graph using reified type parameter.
Signature
inline fun <T : SystemBase> removeSystem(): Boolean Returns Boolean
True if the system was found and removed, false otherwise
|
setEarlySystems
(
earlySystems
)
|
Sets the list of early systems that runs before all other systems.
Signature
fun setEarlySystems(earlySystems: List<SystemBase>) Parameters earlySystems: List
The list of early systems
Throws RuntimeException
If early systems have already been set
|
setLateSystems
(
lateSystems
)
|
Sets the list of late systems that runs after all other systems.
Signature
fun setLateSystems(lateSystems: List<SystemBase>) Parameters lateSystems: List
The list of late systems
Throws RuntimeException
If late systems have already been set
|
topologicalSortWithCycleDetection
()
|
Performs a topological sort of the systems based on their dependencies.
This method:
Signature
fun topologicalSortWithCycleDetection(): MutableList<SystemBase> Returns MutableList
A sorted list of systems in the order they should be executed
Throws RuntimeException
If required dependencies are missing or if a cycle is detected
|
tryFindSystem
(
clazz
)
|
Attempts to find a system in the dependency graph.
Signature
fun <T : SystemBase> tryFindSystem(clazz: KClass<T>): T? Parameters clazz: KClass
The class reference of the system to find
|