| | 1 | | using DCL.ECSComponents; |
| | 2 | | using DCL.ECSRuntime; |
| | 3 | |
|
| | 4 | | namespace DCL.ECS7 |
| | 5 | | { |
| | 6 | | public class ECS7Plugin : IPlugin |
| | 7 | | { |
| | 8 | | private readonly ComponentCrdtWriteSystem crdtWriteSystem; |
| | 9 | | private readonly IECSComponentWriter componentWriter; |
| | 10 | | private readonly ECS7ComponentsComposer componentsComposer; |
| | 11 | | private readonly ECSSystemsController systemsController; |
| | 12 | |
|
| 0 | 13 | | public ECS7Plugin() |
| | 14 | | { |
| 0 | 15 | | crdtWriteSystem = new ComponentCrdtWriteSystem(Environment.i.world.state, |
| | 16 | | Environment.i.world.sceneController, DataStore.i.rpcContext.context); |
| 0 | 17 | | componentWriter = new ECSComponentWriter(crdtWriteSystem.WriteMessage); |
| | 18 | |
|
| 0 | 19 | | componentsComposer = new ECS7ComponentsComposer(DataStore.i.ecs7.componentsFactory, componentWriter); |
| 0 | 20 | | systemsController = new ECSSystemsController(Environment.i.platform.updateEventHandler, componentWriter, crd |
| 0 | 21 | | } |
| | 22 | |
|
| | 23 | | public void Dispose() |
| | 24 | | { |
| 0 | 25 | | componentsComposer.Dispose(); |
| 0 | 26 | | crdtWriteSystem.Dispose(); |
| 0 | 27 | | componentWriter.Dispose(); |
| 0 | 28 | | systemsController.Dispose(); |
| 0 | 29 | | } |
| | 30 | | } |
| | 31 | | } |