Bag

Bag

new Bag(data)

Description:
  • A bag.

Source:
Parameters:
Name Type Description
data Object

The properties to set for this item.

Extends

Members

tags

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

Source:
Inherited From:
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:
Inherited From:
Returns:

JSON

Type
String

has(tag) → {boolean}

Description:
  • Does this model have the given tag?

Source:
Inherited From:
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:
Inherited From:
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:
Inherited From:
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:
Inherited From:
Parameters:
Name Type Description
prefix String

the prefix to match

Returns:

the first tag found that matches this prefix

Type
String