Skip to content

Implementing

David Baker edited this page Apr 19, 2015 · 2 revisions

Implementation Checklist

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.
  • Define Processors
    • Create a class which inherits from Jacinth.Processors.Processor or one of the redefined types.
      • While possible to define custom SubEntity types, it is recommended to use the SingleProcessor<...> and AggregateProcessor<...> types first, as these are designed to reduce the verbosity of defining a Processor.
    • Apply the [JacinthPricessor] Attribute, which allows Jacinth to find the appropriate Processor and defines which ProcessorLoop should control execution of the given Processor.
      • Note that applying [JacinthProcessor] without any arguments links the Processor to the loop named "Update", which is defined in the ProcessorLoop.UpdateLoopName constant.
  • Call execution methods
    • Create a Jacinth.JacinthWorld object and store it
      • Unless running a multipoint simulation, it is recommended that your program store the JacinthWorld reference in a static variable for later use
    • Initialize the world
      • By default, a JacinthWorld initializes 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 the JacinthWorld object to prepare it for use
      • Because Jacinth does not support loading extra Processors or Loops after Initialization, it is imperative that all necessary Processors be loaded into the AppDomain before initialization
        • This should only be a concern if you implement an external loading framework, such as for mods or DLC
    • Handle loops
      • Get a reference to the Jacinth.Processors.ProcessorLoop objects via .GetOrCreateLoop on JacinthWorld
      • If necessary, set .SynchronousExecution on the ProcessorLoops before the JacinthWorld is initialized
        • Note that depending on platform, rendering operations must often be performed on the main loop of the application, necessitating SynchronousExecution = false on the Render loop
      • Call .Update() on each ProcessorLoop as needed
        • Jacinth does not call these methods automatically, so creating the control loops is left to the end implementation

Clone this wiki locally