entitydef
What is this?
This is a small node utility built using findit to recursively walk a
directory and find any JSON
files in any of the child directories and pass the parsed JSON into the constructor
for the item.
Data should be specified in the following format:
Any items in the core definition will be mapped to the prototype definition which will reduce the memory footprint of your application when you have thousands of entities running around. Any data that is considered instance specific should be included in the state member.
Example Usage (from the tests)
Type Definition
{ opts = opts || {}; thisphraseIndex = 0;} NPCprototype = { if thisphraseIndex >= thisphraseslength thisphraseIndex = 0; return thisphrasesthisphraseIndex++; }; moduleexports = NPC;
Using the Loader
;
License(s)
ISC
Copyright (c) 2016, Damon Oehlman damon.oehlman@gmail.com
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.