Setup
If you are using Monogame or Unity you can just go and get the platform specific helpers which will out the box provide you most of the infrastructure and setup required to get going, so go look there.
If you are not using Unity or Monogame and want to pioneer into a new territory then its just a case of setting up the bits that are needed for the core parts of the system to run.
Pre build infrastructure or not?
Out the box EcsRx comes with a load of infrastructure classes which simplify setup, if you are happy to use that as a basis for setup then your job becomes a bit simpler.
There is also a whole section in these docs around the infrastructure and how to use the application and other classes within there in common scenarios.
YES I WANT ALL THE INFRASTRUCTURE PLX PLX
A wise choice so to start with its advised that you take:
EcsRx
EcsRx.Infrastructure
EcsRx.Plugins.ReactiveSystems
EcsRx.Plugins.Views
This will provide the basic classes for you to extend, however one fundamental problem is that the infrastructure expects you to be using a DI framework. It doesn't really care which DI framework as it provides an interface for you to implement and then consume that in your own EcsRxApplication
implementation.
So here are the main bits you need:
Implement
IDependencyContainer
for your DI framework of choice. Here is a Ninject one from examplesImplement your own
EcsRxApplication
class, giving it anIDependencyContainer
implementation to use. Here is one from examplesExtend your custom
EcsRxApplication
implementation for each logical app you need to make, as shown in the EcsRx console examples
There are pre-made DI implementations for Ninject and Zenject so if you can use one of those on your platform GREAT! if not then just pick a DI framework of choice and implement your own handler for it (using the ninject one as an example to base it off).
So if you dont know what DI (Dependency Injection) is I recommend you go read this and this which will give you a quick overview on what IoC (Inversion of Control) and DI is and how you use it.
It is worth noting here that this is EXACTLY how the examples work in this project so its worth cracking them open to see how its all done, but the same principals can be applied to your own applications.
NOOOPE! I dont care for your design patterns sir, just let me get going
Ok captain, if you just want to get things going with minimum effort then I would just get the core lib and manually instantiate everything that is needed.
This is like the most bare bones setup I would advise:
Then all you need to do is go:
HUZZAH! you are now up and running and you can make your own conventions or design patterns around this.
Last updated