LocationTemplate

LocationTemplate

Template for creating location instances. Defines the blueprint for creating location instances, including their properties, sub-divisions, material contents, and behavior patterns.

Constructor

new LocationTemplate(paramsopt)

Description:
  • Creates a new LocationTemplate instance.

Source:
Parameters:
Name Type Attributes Default Description
params Object <optional>
{}

Configuration parameters

Properties
Name Type Attributes Default Description
type String <optional>

Unambiguous and unique, human-readable label for the location type. Either type or room must be provided and they are mutually exclusive.

room String <optional>

If present, supplies the type of the location, and also indicates that is a room, which will not be not included in the list of locations from which you can start to build a top-down representation of a location. Either type or room must be provided and they are mutually exclusive.

name String <optional>
params.type

The display name of a location. Can contain alternatives in the string form "{A|B}"

tags Array.<String> <optional>

Array of tags to categorize this location template

abstract Boolean <optional>
false

Whether this is an abstract template that cannot be instantiated directly

contents Object <optional>

Contents configuration to create content of this location in the format defined by the selectElements function.

inventory Object <optional>

An array of configurations for the inventory of this location, each in the format defined by the bagSpecParser function.

ch Array | Object <optional>

The child nodes of this location template, either as an array of types, or as an object in the format defined by the selectElements function.

descr String <optional>

Description of the location

policy String <optional>

A free-text description of the sales policies of a store

owner String <optional>

The profession to use when generating an owner of a store

Extends

Classes

LocationTemplate

Members

tags

Description:
  • An array of string tags that characterize this item.

Source:
Overrides:
Properties:
Name Type Description
tags Set

An array of string tags that characterize this item.

Methods

asJSON() → {String}

Description:
  • Converts the model to JSON, converting sets to arrays.

Source:
Overrides:
Returns:

JSON

Type
String

has(tag) → {Boolean}

Description:
  • Does this model have the given tag?

Source:
Overrides:
Parameters:
Name Type Description
tag String
Returns:

true if it does, false otherwise

Type
Boolean

is(tag) → {Boolean}

Description:
  • Does this model have the given tag?

Source:
Overrides:
Parameters:
Name Type Description
tag String
Returns:

true if it does, false otherwise

Type
Boolean

not(tag) → {Boolean}

Description:
  • Does this model not have the given tag?

Source:
Overrides:
Parameters:
Name Type Description
tag String
Returns:

true if it does not have the tag, false otherwise

Type
Boolean

typeOf(prefix) → {String}

Description:
  • Given a prefix like ammo or media, will return the specific tag for this item, such as ammo:22 or media:35mm.

Source:
Overrides:
Parameters:
Name Type Description
prefix String

the prefix to match

Returns:

the first tag found that matches this prefix

Type
String