Skip to content

Latest commit

 

History

History
23 lines (13 loc) · 918 Bytes

File metadata and controls

23 lines (13 loc) · 918 Bytes

Meta Component that parses the parent Component from a JSON object and attaches it to a given Entity.

Prototype

void (const putils::json & json, Entity & e);

Parameters

  • json: JSON object for e, NOT specifically for the parent Component
  • e: Entity which the new Component should be attached to

Usage

It is up to the user to implement this meta Component for the Component types they wish to be able to parse.

A helper registerComponentJSONLoader function is provided that takes as a template parameter a Component type and implements the LoadFromJSON meta Component for it.

Note that the implementation provided in registerComponentJSONLoader is only a sample, and users may freely replace it with any other implementation they desire.