1 /* Copyright (C) 2000-2004 Thomas Bopp, Thorsten Hampel, Ludger Merkens
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 * $Id: TrashBin.pike,v 1.1 2008/03/31 13:39:57 exodusd Exp $
19 inherit "/classes/Container";
22 #include <exception.h>
23 #include <attributes.h>
24 class TrashBin : public Container{
35 THROW("Cannot delete the trashbin!", E_ACCESS);
45 foreach(get_inventory(), object obj) {
53 bool check_insert(object obj)
55 // everything goes in here !
61 bool move(object dest)
63 if ( objectp(oEnvironment) ) {
64 // if the trashbin is inside the users inventory
65 // move it to the workroom instead (old version in inventory)
66 if ( oEnvironment->get_object_class() & CLASS_USER )
67 return ::move(oEnvironment->query_attribute(USER_WORKROOM));
69 THROW("Cannot move trashbin out of users workroom !", E_ACCESS);
75 int get_object_class() { return ::get_object_class() | CLASS_TRASHBIN; }
76 string get_identifier() { return "trashbin"; }