Class: Boxers

.Apparel.Menswear~ Boxers

An item of Men's Apparel that occupies ClothingSlot.UNDERPANTS.


new Boxers(id)

You should never instantiate a PersistentObject directly! Instead, you must define it with PersistentObject.define(), and then instantiate it with the obj() function when you want to use it. You must also never store PersistentObjects in Sugarcube variables! Just store their ids, instantiate them with obj() as needed, and then let them be garbage-collected.

Parameters:
Name Type Description
id string

The id of the Persistence defaults entry to be associated with this instance.

Source:

Extends

Members


genericName

FIXME

Overrides:
Source:

<readonly> defaultSlots :Array.<LibEcho.Apparel.ClothingSlot>

Type:
Overrides:
Source:

name

The .name property of apparel is overridden to return the persistent genericName if the persistent name is falsy.

Inherited From:
Overrides:
Source:

slots :Array.<LibEcho.Apparel.ClothingSlot>

The ClothingSlots that this article of Apparel occupies.

Type:
Inherited From:
Overrides:
Source:

<readonly> id :string

The Persistence id of the object.

Most of the time you'll only be interacting with the Persistence id when you define your object at initialization time in PersistentObject.define(), and when you fetch it with obj(). This field is generally only used internally by derived classes. You probably won't need to use this field unless you are actually extending the library itself.

Type:
  • string
Inherited From:
Overrides:
Source:

<readonly> parent :LibEcho.Persistence.PersistentObject

The fully instantiated parent of this object, or undefined if it is a toplevel object (has no parent).

This field is generally only used internally by derived classes. You probably won't need to use this field unless you are actually extending the library itself.

Type:
Inherited From:
Overrides:
Source:

<readonly> aName :string

The display name of the object, with the correct article prepended. For example: "Joe", "an ancient relic", "a pair of gloves". Will be undefined if the object has no name.

If the first character of the .name field is capitalized, the name will be treated as proper, and no article will be prepended. Ie. "Joe". Otherwise, if the first character of the .name field is a vowel, the "an" article will be prepended. Ie. "an ancient relic". Otherwise, the "a" article will be prepended. Ie. "a pair of gloves".

These rules do not always work. For example, "an honorable man" or "a European swallow". In these cases, the .nameIsProper and .nameIrregularArticle fields may be used to manually specify the behavior of this field.

Type:
  • string
Inherited From:
Overrides:
Source:
Example
alert( "You are carrying " + obj("some_item").aName + "." );

<readonly> AName :string

Identical to .aName, but with the first character capitalized.

Type:
  • string
Inherited From:
Overrides:
Source:

<readonly> aGenericName :string

Same as .aName, but operates on the genericName instead.

Type:
  • string
Inherited From:
Overrides:
Source:

<readonly> AGenericName :string

Same as .AName, but operates on the genericName instead.

Type:
  • string
Inherited From:
Overrides:
Source:

<readonly> theName :string

The display name of the object, with the "the" prepended unless the object is proper. For example: "Joe", "the ancient relic", "the pair of gloves". Will be undefined if the object has no name.

These rules do not always work. For example, "the European swallow". In this case, the .nameIsProper field may be used to manually specify the behavior of this field.

Type:
  • string
Inherited From:
Overrides:
Source:
Example
alert( "You place " + obj("some_item").theName + " in the large box." );

<readonly> TheName :string

Identical to .theName, but with the first character capitalized.

Type:
  • string
Inherited From:
Overrides:
Source:

<readonly> theGenericName :string

Same as .theName, but operates on the genericName instead.

Type:
  • string
Inherited From:
Overrides:
Source:

<readonly> TheGenericName :string

Same as .TheName, but operates on the genericName instead.

Type:
  • string
Inherited From:
Overrides:
Source:

nameIsProper :boolean

Set this field to True to suppress the printing of an article in the .aName and .theName fields. Useful for proper names, book titles, etc.

You'll generally want to set this field with Persistence.define(), and then never touch it again. The only time you may need to change this field at runtime is if you change something's name to something that doesn't work with the usual rules.

Type:
  • boolean
Inherited From:
Overrides:
Source:
Example
var book = obj("atlas_shrugged");
// book.name is "\"Atlas Shrugged\" (a novel by Ayn Rand)"
// With the " being the first character, it won't be recognized as proper.
// So .aName will return: a "Atlas Shrugged" (a novel by Ayn Rand).
book.nameIsProper = true;
// Now .aName will properly return just: "Atlas Shrugged" (a novel by Ayn Rand).

nameIrregularArticle :string

Set this field to override the default article choice in .aName. Setting it back to null will return things back to normal.

You'll generally want to set this field with Persistence.define(), and then never touch it again. The only time you may need to change this field at runtime is if you change something's name to something that doesn't work with the usual rules.

Type:
  • string
Inherited From:
Overrides:
Source:
Example
obj("honorable_man").nameIrregularArticle = "an";
obj("european_swallow").nameIrregularArticle = "a";

genericNameIsProper :boolean

Same as .nameIsProper, but operates on the genericName instead.

Type:
  • boolean
Inherited From:
Overrides:
Source:

genericNameIrregularArticle :string

Same as .nameIrregularArticle, but operates on the genericName instead.

Type:
  • string
Inherited From:
Overrides:
Source:

thumbnail :string

A thumbnail image name for the object (used in inventory displays). If a thumbnail image is not defined, it returns the value of .image instead.

FIXME Make this work with external images instead of just image passages.

Type:
  • string
Inherited From:
Overrides:
Source:
Example
FIXME Add an example.

image :string

A detail image name for the object (used in object details displays).

FIXME Make this work with external images instead of just image passages.

Type:
  • string
Inherited From:
Overrides:
Source:
Example
FIXME Add an example.

inventoryCategory :string

The inventory category of this object. Used for inventory sorting. Case-sensitive. If falsy, then category is assumed to be "Other".

Type:
  • string
Inherited From:
Overrides:
Source:
Example
FIXME Add an example.

Methods


toString()

Overridden.

Inherited From:
Overrides:
Source:
Returns:

the value of this.aName.

Type
string