BundleManager(state)

Handles loading/parsing/initializing all bundles. AKA where the magic happens

new BundleManager(state)

Parameters:
Name Type Description
state GameState

Methods

createCommand(commandPath, commandName, bundle) → {Command}

Parameters:
Name Type Description
commandPath string
commandName string
bundle string
Returns:
Command

async loadArea(bundle, areaName, areaPath)

Parameters:
Name Type Description
bundle string
areaName string
areaPath string

async loadAreas(bundle)

Parameters:
Name Type Description
bundle string

loadAttributes(bundle, attributesFile)

Load attribute definitions

Parameters:
Name Type Description
bundle string
attributesFile string

loadBehaviors(bundle, behaviorsDir)

Parameters:
Name Type Description
bundle string
behaviorsDir string

async loadBundle(bundle, bundlePath)

Parameters:
Name Type Description
bundle string

Bundle name

bundlePath string

Path to bundle directory

async loadBundles()

Load in all bundles

loadChannels(bundle, channelsFile)

Parameters:
Name Type Description
bundle string
channelsFile string

loadCommands(bundle, commandsDir)

Parameters:
Name Type Description
bundle string
commandsDir string

loadEffects(bundle, effectsDir)

Parameters:
Name Type Description
bundle string
effectsDir string

async loadEntities(bundle, areaName, type, factory) → {Array.<entityReference>}

Load an entity (item/npc/room) from file

Parameters:
Name Type Description
bundle string
areaName string
type string
factory EntityFactory
Returns:
Array.<entityReference>

loadEntityScript(factory, entityRef, scriptPath)

Parameters:
Name Type Description
factory EntityFactory

Instance of EntityFactory that the item/npc will be loaded into

entityRef EntityReference
scriptPath string

async loadHelp(bundle, helpDir)

Parameters:
Name Type Description
bundle string
helpDir string

loadInputEvents(bundle, inputEventsDir)

Parameters:
Name Type Description
bundle string
inputEventsDir string

loadPlayerEvents(bundle, eventsFile)

Load/initialize player. See the Player Event guide

Parameters:
Name Type Description
bundle string
eventsFile string

event js file to load

async loadQuests(areaName, questsFile) → {Promise.<Array.<entityReference>>}

Parameters:
Name Type Description
areaName string
questsFile string
Returns:
Promise.<Array.<entityReference>>

loadServerEvents(bundle, serverEventsDir)

Parameters:
Name Type Description
bundle string
serverEventsDir string

loadSkills(bundle, skillsDir)

Parameters:
Name Type Description
bundle string
skillsDir string