-
Notifications
You must be signed in to change notification settings - Fork 1
Implementing
David Baker edited this page Apr 19, 2015
·
2 revisions
When Implementing Jacinth, there are a number of things needed before a solution is complete and workable. This guide serves as a simple checklist for these items
- Define Components
- Create a class that inherits from
Jacinth.Components.Component.
- Create a class that inherits from
- Define Processors
- Create a class which inherits from
Jacinth.Processors.Processoror one of the redefined types.- While possible to define custom
SubEntitytypes, it is recommended to use theSingleProcessor<...>andAggregateProcessor<...>types first, as these are designed to reduce the verbosity of defining aProcessor.
- While possible to define custom
- Apply the
[JacinthPricessor]Attribute, which allows Jacinth to find the appropriateProcessorand defines whichProcessorLoopshould control execution of the givenProcessor.- Note that applying
[JacinthProcessor]without any arguments links theProcessorto the loop named"Update", which is defined in theProcessorLoop.UpdateLoopNameconstant.
- Note that applying
- Create a class which inherits from
- Call execution methods
- Create a
Jacinth.JacinthWorldobject and store it- Unless running a multipoint simulation, it is recommended that your program store the
JacinthWorldreference in astaticvariable for later use
- Unless running a multipoint simulation, it is recommended that your program store the
- Initialize the world
- By default, a
JacinthWorldinitializes when constructed. If Initialization must be pushed back, such as for loading from a saved state, constructing base Entities, or ensuring external code is loaded, one must call.Initialize()on theJacinthWorldobject to prepare it for use - Because Jacinth does not support loading extra Processors or Loops after Initialization, it is imperative that all necessary
Processorsbe loaded into theAppDomainbefore initialization- This should only be a concern if you implement an external loading framework, such as for mods or DLC
- By default, a
- Handle loops
- Get a reference to the
Jacinth.Processors.ProcessorLoopobjects via.GetOrCreateLooponJacinthWorld - If necessary, set
.SynchronousExecutionon theProcessorLoopsbefore theJacinthWorldis initialized- Note that depending on platform, rendering operations must often be performed on the main loop of the application, necessitating
SynchronousExecution = falseon the Render loop
- Note that depending on platform, rendering operations must often be performed on the main loop of the application, necessitating
- Call
.Update()on eachProcessorLoopas needed- Jacinth does not call these methods automatically, so creating the control loops is left to the end implementation
- Get a reference to the
- Create a