← Natura·Docs/Modules/Source

verbs/index.js

16 lines · in natura-src-1.0.0.zip as natura/verbs/index.js · a module · its entry in the module reference

// verbs/index.js -- the thin ROUTER for the life ontology verbs. It holds NO logic; it just composes the small
// single-concern verb files (daynight / forage / flee / phenology / school) into one flat `Verbs` surface a life
// system can reach for. Add a verb = drop a file beside these and add one line here. In the browser, load the verb
// files first (they each attach to window.NaturaVerbs), then this; in node, it requires them. UMD -> window.Verbs.
(function (root, factory) {
  if (typeof module !== 'undefined' && module.exports) {
    module.exports = factory(require('./daynight'), require('./forage'), require('./flee'), require('./phenology'), require('./school'), require('./court'));
  } else {
    const V = root.NaturaVerbs || {};
    root.Verbs = factory(V.daynight, V.forage, V.flee, V.phenology, V.school, V.court);
  }
})(typeof self !== 'undefined' ? self : this, function (daynight, forage, flee, phenology, school, court) {
  'use strict';
  // court exposes {attractiveness, displayCost, choose, breed}; the others each add their own -> one flat Verbs surface
  return Object.assign({}, daynight, forage, flee, phenology, school, court);
});