extradesc

prop
SYNOPSIS
    mapping P_EXTRA_DESC  "ExtraDesc"

    mapping Set(P_EXTRA_DESC, mapping value)
    mapping Query(P_EXTRA_DESC)
      or
    mapping SetExtraDesc(mapping value)
    mapping QueryExtraDesc()

      Managed through:
    void            SetExtra(mixed key, mapping|closure data)
    mapping|closure QueryExtra(mixed key)
    void            RemoveExtra(mixed key)

    void            SetExtraEntry(mixed key, mixed prop, mapping|closure data)
    mapping|closure QueryExtraEntry(mixed key, mixed prop)
    void            RemoveExtraEntry(mixed key, mixed prop)

DESCRIPTION
    This property makes it possible to extend the description of an object
    (long, short, ...) temporarily without modifying the actual properties.
    This makes concurrent extensions easier.

    The value is a mapping, indexed by strings (though any value type would
    do), with a mapping as data entry for each index. The indices
    - the 'keys' - identify the description extension and are selected by
    the extenders, the mappings hold the data for each extension.
    These extension entries may be separately set/queried/removed through
    the lfuns SetExtra(), QueryExtra() and RemoveExtra().

    These data mappings are indexed by strings, namely the names of the
    properties to extend. For each property, the extension data is stored
    in the mapping. These entries may be separately set/queried/removed
    through the lfuns SetExtraEntry(), QueryExtraEntry(), RemoveExtraEntry().

    When one of the extended properties is queried, the extension data
    is collected from P_EXTRA_DESC and added to the original property data.
    For P_SHORT extensions, an extra space at the beginning should be
    considered.

    For each data entry (both the full extension mapping and the singleton
    property extension data), closures may be used. These are evaluated
    on necessity and have to return the actual data to be used.

EXAMPLE
    -- Extend the description of object <weapon> by an eerie glow:
      // One way to do it:
      weapon->SetExtra("eerie_glow"
                      , ([ P_SHORT: " (eerily glowing)"
                         , P_LONG: "It radiates an eerie glow.\n" ])
                      );
      // The other way to do it:
      weapon->SetExtraEntry("eerie glow", P_SHORT, " (eerily glowing)");
      weapon->SetExtraEntry("eerie glow", P_LONG, "It radiates an eerie glow.\n");

    -- Remove the description of the eerie glow:
      weapon->RemoveExtra("eerie glow");

    Note that <weapon> can be any object, even a player.

AVAILABILITY
    Include: <properties.h>

    Availability: /std/thing(/description) and descendants.

BUGS
    This property works just for P_(INT_)SHORT, P_(INT_)LONG, P_(INT_)SMELL,
    P_(INT_)NOISE and P_READ_MSG, due to mudlib history.

SEE ALSO
    thing(S), short(P), long(P), noise(P), smell(P), readmsg(P)
    intlong(P), intshort(P), intnoise(P), intsmell(P)