1 using System.Collections.Generic;
13 protected readonly List<IInitializeSystem> _initializeSystems;
14 protected readonly List<IExecuteSystem> _executeSystems;
15 protected readonly List<ICleanupSystem> _cleanupSystems;
16 protected readonly List<ITearDownSystem> _tearDownSystems;
20 _initializeSystems =
new List<IInitializeSystem>();
21 _executeSystems =
new List<IExecuteSystem>();
22 _cleanupSystems =
new List<ICleanupSystem>();
23 _tearDownSystems =
new List<ITearDownSystem>();
29 if(initializeSystem != null) {
30 _initializeSystems.Add(initializeSystem);
34 if(executeSystem != null) {
35 _executeSystems.Add(executeSystem);
39 if(cleanupSystem != null) {
40 _cleanupSystems.Add(cleanupSystem);
44 if(tearDownSystem != null) {
45 _tearDownSystems.Add(tearDownSystem);
54 for (
int i = 0; i < _initializeSystems.Count; i++) {
55 _initializeSystems[i].Initialize();
62 for (
int i = 0; i < _executeSystems.Count; i++) {
63 _executeSystems[i].Execute();
70 for (
int i = 0; i < _cleanupSystems.Count; i++) {
71 _cleanupSystems[i].Cleanup();
78 for (
int i = 0; i < _tearDownSystems.Count; i++) {
79 _tearDownSystems[i].TearDown();
85 for (
int i = 0; i < _executeSystems.Count; i++) {
86 var system = _executeSystems[i];
88 if(reactiveSystem != null) {
89 reactiveSystem.Activate();
92 var nestedSystems = system as
Systems;
93 if(nestedSystems != null) {
94 nestedSystems.ActivateReactiveSystems();
104 for (
int i = 0; i < _executeSystems.Count; i++) {
105 var system = _executeSystems[i];
107 if(reactiveSystem != null) {
108 reactiveSystem.Deactivate();
111 var nestedSystems = system as
Systems;
112 if(nestedSystems != null) {
113 nestedSystems.DeactivateReactiveSystems();
120 for (
int i = 0; i < _executeSystems.Count; i++) {
121 var system = _executeSystems[i];
123 if(reactiveSystem != null) {
124 reactiveSystem.Clear();
127 var nestedSystems = system as
Systems;
128 if(nestedSystems != null) {
129 nestedSystems.ClearReactiveSystems();
void ActivateReactiveSystems()
Activates all ReactiveSystems in the systems list.
void DeactivateReactiveSystems()
virtual Systems Add(ISystem system)
Adds the system instance to the systems list.
virtual void Initialize()
void ClearReactiveSystems()
Clears all ReactiveSystems in the systems list.
Systems()
Creates a new Systems instance.