#include "boot.clh"
object CONTAINER
    parents THING;
    name = "Generic Container";
    verb "put place insert" : "in into" = put_in;
    verb "get remove take" : "from in" = remove_from;
    verb "l*ook" : "in into inside" = look_in;
    method init
	if (this == CONTAINER)
	    this.add_owner(WIZARD);
	endif
	pass();
    endmethod /* init */
    method accept
	return pass(args[1]) to LOCATED_OBJ;
    endmethod
    method put_in
	var	what;
	if (!this.match(args[4]))
	    return 1;
	endif
	what = player.match_contents(args[2]);
	if (!what)
	    player.tell("You don't have that.");
	elseif (what.moveto(this))	/* SSPOT */
	    player.tell("You put " + what.name + " into " + this.name + ".");
	else
	    player.tell("You can't put " + what.name + " into " + this.name
			+ ".");
	endif
    endmethod /* put_in */
    method remove_from /* verb */
	var	what;
	if (!this.match(args[4]))
	    return 1;
	endif
	what = this.match_contents(args[2]);		/* SSPOT */
	if (!what)
	    player.tell("That object is not inside " + this.name + ".");
	elseif (what.moveto(player))
	    player.tell("You remove " + what.name + " from " + this.name + ".");
	else
	    player.tell("You can't remove that.");
	endif
    endmethod /* remove_from verb */
    method look /* verb */
	var	thing;
	pass() to DESCRIBED_OBJ;
	if (this.contents)
	    player.tell("Containing:");
	    for thing in (this.contents)
		player.tell("  " + thing.name);
	    endfor
	endif
    endmethod /* look */
    method look_in
	var	thing;
	if (!this.match(args[4]))
	    return 1;
	endif
	if (contents)
	    player.tell("Inside " + name + " you see:");
	    for thing in (contents)
		player.tell("  " + thing.name);
	    endfor
	else
	    player.tell("You see nothing inside " + name + ".");
	endif
    endmethod /* look_in */
endobject	/* CONTAINER */