[an error occurred while processing this directive]
[<a href="index.shtml">Package Index</a></code> | <a href="index_std.shtml">Mudlib Index</a></code> | <a href="index_eff.shtml">Effect Index</a></code>]<br><h2>File /std/container.c</h2>
The basic container inheritable, please note this is *not* a container
like a bucket.  This now allows things inside the container to
inform us that they should be used as part of the inventory of this
object.  This means the contents of containers will look like they
are not inside containers to the outside world.<p><b>See also:</b><br><a href="obj.container.c.shtml">/obj/container.c</a>, <a href="obj.baggage.c.shtml">/obj/baggage.c</a>, <a href="obj.vessel.c.shtml">/obj/vessel.c</a> and /obj/clothing.c
<p>Written by Pinkfish<h2>Inherits</h2>
This class inherits the following classes <a href="std.basic.cute_look.c.shtml">/std/basic/cute_look.c</a>, /std/basic/export_inventory.c, <a href="global.auto_load.c.shtml">/global/auto_load.c</a> and <a href="std.object.c.shtml">/std/object.c</a><h2>Includes</h2>
This class includes the following files <a href="include.player.h.shtml">/include/player.h</a>, <a href="include.playtesters.h.shtml">/include/playtesters.h</a>, <a href="include.player_handler.h.shtml">/include/player_handler.h</a> and <a href="include.move_failures.h.shtml">/include/move_failures.h</a><h2>Method index</h2>
<dl><ul>
<li><a href="#add_tracked_items">add_tracked_items</a>(int)<br/>
This method handles the addition of tracked items.
<li><a href="#add_weight">add_weight</a>(int)<br/>
This method is called in the move functions, it adds extra
weight onto the object when something is moved inside it.
<li><a href="#can_find_match_recurse_into">can_find_match_recurse_into</a>(object)<br/>
This method allows the container to have stuff inside it checked.
<li><a href="#can_find_match_reference_inside_object">can_find_match_reference_inside_object</a>(object, object)<br/>
This method checks to see if the find match code can actually
reference this object inside us.
<li><a href="#disable_item_tracking">disable_item_tracking</a>()<br/>
This method disables item tracking
<li><a href="#do_restore_inventory_error">do_restore_inventory_error</a>(object, int)<br/>
This method handles the case where the return of the move flag is not
MOVE_OK.
<li><a href="#enable_item_tracking">enable_item_tracking</a>()<br/>
This method enables item tracking
<li><a href="#event_container_move">event_container_move</a>(object, mixed, mixed)<br/>
This method handles the movement of the containers of this object.
<li><a href="#event_move_object">event_move_object</a>(mixed, mixed)<br/>
This method is called from move to notify any tracked items contained of
the move using event_container_moved.
<li><a href="#find_inv_match">find_inv_match</a>(string, object)<br/>
This method finds the matching objects inside this object
that are visible to the looker.
<li><a href="#handle_restore_inventory">handle_restore_inventory</a>(object)<br/>
This method handles moving objects into the inventory from an auto
load.
<li><a href="#query_complete_weight">query_complete_weight</a>()<br/>
This method returns the complete weight of the object.
<li><a href="#query_fullness">query_fullness</a>(int)<br/>
This method returns the fullness of the container based on a number
from 0 to the passed in number.
<li><a href="#query_loc_weight">query_loc_weight</a>()<br/>
This method returns the current local weight in this
container.
<li><a href="#query_max_items">query_max_items</a>()<br/>
This method returns the maximum number of items that can
be carried in this container.
<li><a href="#query_max_weight">query_max_weight</a>()<br/>
This method returns the maximum amount of weight that can
be carried in this container.
<li><a href="#query_ownership">query_ownership</a>()<br/>
This returns who owns the container, if it set to 0 then no one
owns it.
<li><a href="#query_player">query_player</a>()<br/>
This method returns the player who is loading the container
during the autoload sequence.
<li><a href="#query_prevent_insert">query_prevent_insert</a>()<br/>
If this is true, this container cannot be put into other containers.
<li><a href="#query_tracked_items">query_tracked_items</a>()<br/>
This method returns the number of tracked item contained.
<li><a href="#remove_tracked_items">remove_tracked_items</a>(int)<br/>
This method handles the removal of tracked items.
<li><a href="#reset_prevent_insert">reset_prevent_insert</a>()<br/>
This allows this container to be put into other containers (default).
<li><a href="#set_max_items">set_max_items</a>(int)<br/>
This method sets the maximum number of items that can
be carried in this container.
<li><a href="#set_max_weight">set_max_weight</a>(int)<br/>
This method sets the maximum amount of weight that can
be carried in this container.
<li><a href="#set_ownership">set_ownership</a>(string)<br/>
This sets who owns the container, if it set to 0 then no one
owns it.
<li><a href="#set_player">set_player</a>(object)<br/>
This method is used in the auto loading sequence to set the
player who is loading the container.
<li><a href="#set_prevent_insert">set_prevent_insert</a>()<br/>
items21 stops this container from being put into other containers.
<li><a href="#set_tracked_item_status_reason">set_tracked_item_status_reason</a>(string)<br/>
This method is called to adjust the status reason.
<li><a href="#test_add">test_add</a>(object, int)<br/>
This method allows things to be added into us.
<li><a href="#test_item_limit">test_item_limit</a>(int)<br/>
This method verifies to make sure that the max item container limit
is not broken.
<li><a href="#test_remove">test_remove</a>(object, int, mixed)<br/>
This method checks to see if the object can be taken out of
us.
<li><a href="#update_loc_weight">update_loc_weight</a>()<br/>
This method determins the current local weight from all the
objects inside the container
</ul><h2>Public Functions</h2>
These are functions that everyone can access.<p>
.<ul><a name="add_tracked_items">
add_tracked_items</a><pre>
nomask void add_tracked_items(int n_items)
</pre></br>
This method handles the addition of tracked items.
Tracked items want to be notified if the container moves.
<br/><ul>
<li><b>Parameters:</b>
<br/>n_items - the number of tracked items added
<li><b>See also:</b>
<br/>remove_tracked_items.c and event_container_move
.c</dl>

<ul><a name="add_weight">
add_weight</a><pre>
int add_weight(int n)
</pre></br>
This method is called in the move functions, it adds extra
weight onto the object when something is moved inside it.
<br/><ul>
<li><b>Parameters:</b>
<br/>n - the amount to add
<li><b>Returns:</b>
<br/>1 if successfuly added
<li><b>See also:</b>
<br/><a href="std.basic.misc.c.shtml#query_weight">/std/basic/misc->query_weight()
</a></dl>

<ul><a name="can_find_match_recurse_into">
can_find_match_recurse_into</a><pre>
int can_find_match_recurse_into(object looker)
</pre></br>
This method allows the container to have stuff inside it checked.
<br/><ul>
<li><b>Parameters:</b>
<br/>looker - the person doing the checking
<li><b>Returns:</b>
<br/>1 on success, 0 on failur

</dl>

<ul><a name="can_find_match_reference_inside_object">
can_find_match_reference_inside_object</a><pre>
int can_find_match_reference_inside_object(object thing,
                                           object looker)
</pre></br>
This method checks to see if the find match code can actually
reference this object inside us.
<br/><ul>
<li><b>Parameters:</b>
<br/>thing - the thing to reference
<br/>looker - the person looking at it
<li><b>Returns:</b>
<br/>1 if they can, 0 if they cannot

</dl>

<ul><a name="disable_item_tracking">
disable_item_tracking</a><pre>
nomask void disable_item_tracking()
</pre></br>
This method disables item tracking
<br/><ul>
<li><b>See also:</b>
<br/>event_enter_tracked_item.c and enable_item_tracking
.c</dl>

<ul><a name="do_restore_inventory_error">
do_restore_inventory_error</a><pre>
int do_restore_inventory_error(object ob,
                               int move_flag)
</pre></br>
This method handles the case where the return of the move flag is not
MOVE_OK.  This can do whatever we want to make it work in a more useful
fashion.


<ul><a name="enable_item_tracking">
enable_item_tracking</a><pre>
nomask void enable_item_tracking()
</pre></br>
This method enables item tracking
<br/><ul>
<li><b>See also:</b>
<br/>event_enter_tracked_item.c and disable_item_tracking
.c</dl>

<ul><a name="event_container_move">
event_container_move</a><pre>
nomask void event_container_move(object mover,
                                 mixed from,
                                 mixed to)
</pre></br>
This method handles the movement of the containers of this object.
Tracked items want to be notified if the container moves or anything
containing it does.  The movement of the outmost moving container is 
propagated down to all tracked items.
<br/><ul>
<li><b>Parameters:</b>
<br/>mover -    The outermost container object that moved
<br/>from -     The start environment of the outermost container 
<br/>to -       The destination of the outermost container 
<li><b>See also:</b>
<br/>event_enter_tracked_item
.c</dl>

<ul><a name="event_move_object">
event_move_object</a><pre>
void event_move_object(mixed from,
                       mixed to)
</pre></br>
This method is called from move to notify any tracked items contained of
the move using event_container_moved.
<br/><ul>
<li><b>Parameters:</b>
<br/>from -   start
<br/>to -     destination

</dl>

<ul><a name="find_inv_match">
find_inv_match</a><pre>
object * find_inv_match(string words,
                        object looker)
</pre></br>
This method finds the matching objects inside this object
that are visible to the looker.  This will also use the
registered containers and add them into the array returned
(if visible and contained in the object).
<br/><ul>
<li><b>Parameters:</b>
<br/>words - the words matched on
<br/>looker - who is looking
<li><b>See also:</b>
<br/><a href="secure.simul_efun.c.shtml#find_match">/secure/simul_efun->find_match()</a> and <a href="#add_inventory_container">add_inventory_container()
</a></dl>

<ul><a name="query_complete_weight">
query_complete_weight</a><pre>
int query_complete_weight()
</pre></br>
This method returns the complete weight of the object.  This is the
weight of the container itself, plus the weight of the things
inside it
<br/><ul>
<li><b>Returns:</b>
<br/>the complete_weight()
<li><b>See also:</b>
<br/><a href="std.basic.misc.c.shtml#query_weight">/std/basic/misc->query_weight()</a> and <a href="#query_loc_weight">query_loc_weight()
</a></dl>

<ul><a name="query_fullness">
query_fullness</a><pre>
int query_fullness(int number)
</pre></br>
This method returns the fullness of the container based on a number
from 0 to the passed in number.
<br/><ul>
<li><b>Parameters:</b>
<br/>number - the maximum number
<li><b>Returns:</b>
<br/>the fullness number

</dl>

<ul><a name="query_loc_weight">
query_loc_weight</a><pre>
int query_loc_weight()
</pre></br>
This method returns the current local weight in this
container.
<br/><ul>
<li><b>Returns:</b>
<br/>the local weight

</dl>

<ul><a name="query_max_items">
query_max_items</a><pre>
int query_max_items()
</pre></br>
This method returns the maximum number of items that can
be carried in this container.
<br/><ul>
<li><b>Returns:</b>
<br/>the maximum number of items
<li><b>See also:</b>
<br/><a href="#set_max_items">set_max_items()
</a></dl>

<ul><a name="query_max_weight">
query_max_weight</a><pre>
int query_max_weight()
</pre></br>
This method returns the maximum amount of weight that can
be carried in this container.
<br/><ul>
<li><b>Returns:</b>
<br/>the maximum weight
<li><b>See also:</b>
<br/><a href="#set_max_weight">set_max_weight()
</a></dl>

<ul><a name="query_ownership">
query_ownership</a><pre>
string query_ownership()
</pre></br>
This returns who owns the container, if it set to 0 then no one
owns it.  This is used in the theft determination for the object.
<br/><ul>
<li><b>Returns:</b>
<br/>who owns the container
<li><b>See also:</b>
<br/><a href="#set_ownership">set_ownership()
</a></dl>

<ul><a name="query_player">
query_player</a><pre>
object query_player()
</pre></br>
This method returns the player who is loading the container
during the autoload sequence.
<br/><ul>
<li><b>Returns:</b>
<br/>the player who loaded the object

</dl>

<ul><a name="query_prevent_insert">
query_prevent_insert</a><pre>
int query_prevent_insert()
</pre></br>
If this is true, this container cannot be put into other containers.
<br/><ul>
<li><b>See also:</b>
<br/><a href="#reset_prevent_insert">reset_prevent_insert()</a> and <a href="#set_prevent_insert">set_prevent_insert()
</a></dl>

<ul><a name="query_tracked_items">
query_tracked_items</a><pre>
nomask int query_tracked_items()
</pre></br>
This method returns the number of tracked item contained.
Tracked items want to be notified if the container moves.
<br/><ul>
<li><b>See also:</b>
<br/>add_tracked_items.c and event_container_move
.c</dl>

<ul><a name="remove_tracked_items">
remove_tracked_items</a><pre>
nomask void remove_tracked_items(int n_items)
</pre></br>
This method handles the removal of tracked items.
Tracked items want to be notified if the container moves.
<br/><ul>
<li><b>Parameters:</b>
<br/>n_items - the number of tracked items  removed
<li><b>See also:</b>
<br/>add_tracked_items.c and event_container_move
.c</dl>

<ul><a name="reset_prevent_insert">
reset_prevent_insert</a><pre>
int reset_prevent_insert()
</pre></br>
This allows this container to be put into other containers (default).
<br/><ul>
<li><b>See also:</b>
<br/><a href="#set_prevent_insert">set_prevent_insert()</a> and <a href="#query_prevent_insert">query_prevent_insert()
</a></dl>

<ul><a name="set_max_items">
set_max_items</a><pre>
void set_max_items(int number)
</pre></br>
This method sets the maximum number of items that can
be carried in this container.
<br/><ul>
<li><b>Parameters:</b>
<br/>number - the new maximum number of items
<li><b>See also:</b>
<br/><a href="#query_max_items">query_max_items()
</a></dl>

<ul><a name="set_max_weight">
set_max_weight</a><pre>
void set_max_weight(int number)
</pre></br>
This method sets the maximum amount of weight that can
be carried in this container.
<br/><ul>
<li><b>Parameters:</b>
<br/>number - the new maximum weight
<li><b>See also:</b>
<br/><a href="#query_max_weight">query_max_weight()
</a></dl>

<ul><a name="set_ownership">
set_ownership</a><pre>
void set_ownership(string word)
</pre></br>
This sets who owns the container, if it set to 0 then no one
owns it.  This is used in the theft determination for the object.
<br/><ul>
<li><b>Parameters:</b>
<br/>word - who owns the container
<li><b>See also:</b>
<br/><a href="#query_ownership">query_ownership()
</a></dl>

<ul><a name="set_player">
set_player</a><pre>
void set_player(object thing)
</pre></br>
This method is used in the auto loading sequence to set the
player who is loading the container.
<br/><ul>
<li><b>Parameters:</b>
<br/>thing - the player loading the container
<li><b>See also:</b>
<br/><a href="#query_player">query_player()
</a></dl>

<ul><a name="set_prevent_insert">
set_prevent_insert</a><pre>
int set_prevent_insert()
</pre></br>
items21 stops this container from being put into other containers.
<br/><ul>
<li><b>See also:</b>
<br/><a href="#reset_prevent_insert">reset_prevent_insert()</a> and <a href="#query_prevent_insert">query_prevent_insert()
</a></dl>

<ul><a name="set_tracked_item_status_reason">
set_tracked_item_status_reason</a><pre>
nomask void set_tracked_item_status_reason(string reason)
</pre></br>
This method is called to adjust the status reason.
occurences.  
<br/><ul>
<li><b>See also:</b>
<br/>event_buried .c, event_player_quit .c and event_enter_tracked_item
.c</dl>

<ul><a name="test_add">
test_add</a><pre>
int test_add(object ob,
             int flag)
</pre></br>
This method allows things to be added into us.  If we have an 
environment check that for the ability to add into us.
<br/><ul>
<li><b>Parameters:</b>
<br/>ob - the object being added
<br/>flag - the add flags
<li><b>See also:</b>
<br/>/std/basic/move.c
</dl>

<ul><a name="test_item_limit">
test_item_limit</a><pre>
int test_item_limit(int num)
</pre></br>
This method verifies to make sure that the max item container limit
is not broken.
<br/><ul>
<li><b>Returns:</b>
<br/>1 if the container is not full

</dl>

<ul><a name="test_remove">
test_remove</a><pre>
int test_remove(object thing,
                int flag,
                mixed dest)
</pre></br>
This method checks to see if the object can be taken out of
us.
<br/><ul>
<li><b>Parameters:</b>
<br/>thing - the object coming out
<br/>flag - the move flag
<br/>dest - the destination object
<li><b>Returns:</b>
<br/>1 if it can be taken out, 0 if not.

<li><b>See also:</b>
<br/><a href="std.basic.move.c.shtml">/std/basic/move.c</a></dl>

<ul><a name="update_loc_weight">
update_loc_weight</a><pre>
void update_loc_weight()
</pre></br>
This method determins the current local weight from all the
objects inside the container
<br/><ul>
<li><b>See also:</b>
<br/><a href="#query_loc_weight">query_loc_weight()
</a></dl>


<h2>Protected Functions</h2>
These are functions that only objects inheriting the class can access.<p>
<ul><a name="handle_restore_inventory">
handle_restore_inventory</a><pre>
int handle_restore_inventory(object ob)
</pre></br>
This method handles moving objects into the inventory from an auto
load.  This should be over ridden by things inheriting us to
make sure that the objects can be moved into the inventory.  It
should handle the bypassing of open/close/locked etc flags.
<br/><ul>
<li><b>Parameters:</b>
<br/>ob - the object to move into ourselves

</dl>


[an error occurred while processing this directive]

