Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Incoming Intelligence Report

Excerpt

I will place Add a suffix on object keys to indicate whether they need to be absorbed or neutralisedto Task IDs.

 

Why suffix?

Purpose

Assuming that you're using object keys to form part of your event key, you'll almost certainly want to know who an object belongs to – you, an ally or an enemy?

A suffix mod automatically adds a faction (or some other) suffix to event keys. Suffixes are persistent, so when event keys are being reduced the suffix remains on the end of the event key.

Transfer

For more information, see: The Concept.

Build your own

consciousness

A suffix mod defines the NEXUS.suffix() method – when passed an object it should return a "suffix" applicable to the passed in object.

Your mod should be structured like this:

Code Block
themeRDark
languagejavascript
linenumberstrue
NEXUS.suffix = (function() {
 
  // /////////////////////////////////////////////////////////////////
  // PRIVATE VARS

  var chimp = "hairy"; // just an example :p
 
  // /////////////////////////////////////////////////////////////////
  // PUBLIC CLASSIFY FUNCTION

  var suffix = function(obj) {
    // work out the suffix applicable for "obj"
    // up to you how to do that, take a look at existing mods for examples (:
 
    return objSuffix; // objSuffix must be a string, ideally with "." at the start
  }
 
  // /////////////////////////////////////////////////////////////////
  // PRIVATE FUNCTIONS
 
  var isFoo = function(foo) { // just an example :p
    return (foo != "bar");
  }
 
  // return your suffix function
  return suffix;
 
})(); 

If you want to be super-helpful to other people looking at your code:

  1. Make it easy to understand!
  2. Document the possible suffixes

File name convention

Suffix mods use the following naming convention: "NEXUS.suffix_modName.js", where "modName" is the name of your mod.

Div
classbox notice

My consciousness You can only contain install one classify subroutine at a timesuffix subroutine per NEXUS instance.

Div
classbox
Memory Banks

Subroutines

Absorb:

Child pages (Children Display)
alltrue
depthall
excerpttrue

Div
classbox

Subroutines

I have many other types of subroutine

Memory Banks

Observe:

Child pages (Children Display)
pageSubroutinesMemory Banks
excerpttrue