ids

prop
SYNOPSIS
    string * P_IDS  "Ids"

    string * Set(P_IDS, string * value)
    string * Query(P_IDS)
      or
    string SetIds(string * value)
    string QueryIds()

      also:
    string * AddId (string|string * id)
    string * RemoveId (string|string * id)

DESCRIPTION
    The property holds an array of strings with the required ids of the
    object. When specifying an object (like in present()), exactly one
    of the set id strings must appear in the designation.
    The strings set are mapped to lowercase, leading and trailing spaces
    are removed, sequences of embedded spaces are shrunk to just one
    space each.

    The id(s) of an object must specify the general class of the object,
    more intricate differences have to be put into the P_ADS.

    As the /std-things initialise P_IDS with generic id strings (to make
    'all things' possible), changes to P_IDS should happen JUST through
    these two lfuns:

      string * AddId (string|string * id)
        Adds <id> to P_IDS and returns the new value of P_IDS.
        <id> may an array of strings as well.

      string * RemoveId (string|string * id)
        Removes <id> to P_IDS and returns the new value of P_IDS.
        <id> may an array of strings as well.

    Note: any change to an object's current ids sets the value
    of the P_ID_PATTERN property back to 0.

EXAMPLE
    AddId("torch");                 -- Adds id "torch" to the object.
    AddId(({"spotlight", "light"}); -- Adds ids "spotlight" and "light"
    RemoveId("lamp");               -- Removes id "lamp", if set at all.

    Set(P_IDS, ({ "ring" })); -- Sets "ring" as only id. DO NOT DO THIS!

    To distinguish two sword objects, program them as:
      blue sword: AddId("sword"); AddAdjective("blue");
      red  sword: AddId("sword"); AddAdjective("red");
    DO NOT use constructs like AddId(({"sword", "red sword"}))!

AVAILABILITY
    Include: <properties.h>

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

SEE ALSO
    thing(S), ads(P), idpattern(P)