blob: 12a2e8a8772631df9f4bc7f1afd64576be0b73d2 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
Zesstra715ec202025-07-09 22:18:31 +02002 object * deep_inventory(void)
Zesstrad59c3892019-11-28 20:53:39 +01003 object * deep_inventory(object ob)
4 object * deep_inventory(object ob, int depth)
MG Mud User88f12472016-06-24 23:31:02 +02005
Zesstra715ec202025-07-09 22:18:31 +02006DESCRIPTION
7 Returns an array of the objects contained in the inventory of
8 ob (or this_object() if no arg given) and in the inventories
9 of these objects, climbing down recursively.
MG Mud User88f12472016-06-24 23:31:02 +020010
Zesstra715ec202025-07-09 22:18:31 +020011 If <depth> is given and not 0, the result is limited as follows:
MG Mud User88f12472016-06-24 23:31:02 +020012
Zesstra715ec202025-07-09 22:18:31 +020013 <depth> > 0: Only the objects in the first <depth> levels of
14 inventory are returned.
15 <depth> < 0: Only the objects in level -<depth> of inventory are
16 returned.
17
18 In this, level '1' is the inventory of <ob> itself.
19
20EXAMPLES
21 Given the following inventory structure
22
MG Mud User88f12472016-06-24 23:31:02 +020023 ob
24 +- ob1
25 +- ob2
Zesstra715ec202025-07-09 22:18:31 +020026 | `- ob21
MG Mud User88f12472016-06-24 23:31:02 +020027 | ob3
Zesstra715ec202025-07-09 22:18:31 +020028 | `- ob31
MG Mud User88f12472016-06-24 23:31:02 +020029 +- ob4
30
Zesstra715ec202025-07-09 22:18:31 +020031 deep_inventory(ob) => ({ob1, ob2, ob3, ob4, ob21, ob31})
32 deep_inventory(ob, 1) => ({ob1, ob2, ob3, ob4})
33 deep_inventory(ob, 2) => ({ob1, ob2, ob3, ob4, ob21, ob31})
MG Mud User88f12472016-06-24 23:31:02 +020034 deep_inventory(ob, -2) => ({ob21, ob31})
35
Zesstra715ec202025-07-09 22:18:31 +020036HISTORY
37 LDMud 3.3.554 added the <depth> parameter.
38
39SEE ALSO
MG Mud User88f12472016-06-24 23:31:02 +020040 first_inventory(E), next_inventory(E), all_inventory(E)