1
/* Copyright (C) 2000-2003 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
inherit "/factories/RoomFactory";
24
#include <attributes.h>
27
static void init_factory()
30
init_class_attribute(CALENDAR_TIMETABLE_START, CMD_TYPE_INT,
32
EVENT_ATTRIBUTES_CHANGE, 0, CONTROL_ATTR_USER, 8*60);
33
init_class_attribute(CALENDAR_TIMETABLE_END, CMD_TYPE_INT,
35
EVENT_ATTRIBUTES_CHANGE, 0, CONTROL_ATTR_USER, 18*60);
36
init_class_attribute(CALENDAR_TIMETABLE_ROTATION, CMD_TYPE_INT,
37
"timetable rotation", 0,
38
EVENT_ATTRIBUTES_CHANGE, 0, CONTROL_ATTR_USER, 60);
39
init_class_attribute(CALENDAR_DATE_TYPE, CMD_TYPE_MAPPING,
40
"calendar date type", 0,
41
EVENT_ATTRIBUTES_CHANGE, 0, CONTROL_ATTR_USER, ([ ]));
42
init_class_attribute(CALENDAR_TRASH, CMD_TYPE_OBJECT,
44
EVENT_ATTRIBUTES_CHANGE, 0, CONTROL_ATTR_USER, 0);
45
init_class_attribute(CALENDAR_STORAGE, CMD_TYPE_OBJECT,
46
"calendar storage", 0,
47
EVENT_ATTRIBUTES_CHANGE, 0, CONTROL_ATTR_USER, 0);
48
init_class_attribute(CALENDAR_OWNER, CMD_TYPE_OBJECT,
50
EVENT_ATTRIBUTES_CHANGE, 0, CONTROL_ATTR_USER, 0);
53
object execute(mapping vars)
56
try_event(EVENT_EXECUTE, CALLER, obj);
57
if ( vars->transient ) {
58
if ( mappingp(vars->attributes) )
59
vars->attributes[OBJ_TEMP] = 1;
61
vars->attributes = ([ OBJ_TEMP : 1 ]);
64
obj = ::object_create(vars["name"], CLASS_NAME_CALENDAR, 0,
66
vars["attributesAcquired"],
67
vars["attributesLocked"]);
69
obj->sanction_object(_STEAMUSER, SANCTION_INSERT);
70
object factory = _Server->get_factory(CLASS_TRASHBIN);
71
object trashbin = factory->execute((["name":"trashbin", ]));
72
obj->set_attribute(CALENDAR_TRASH, trashbin);
73
trashbin->move(obj->this());
75
run_event(EVENT_EXECUTE, CALLER, obj);
79
string get_identifier() { return "Calendar.factory"; }
80
string get_class_name() { return CLASS_NAME_CALENDAR;}
81
int get_class_id() { return CLASS_CALENDAR; }