def create_object(name, description, location, id=None, baseclass=None): anobject = baseclass.object() anobject.name = name anobject.description = description anobject.location = location if id is None: anobject.id = kfun.create_id() else: anobject.id = id print "object id %i created" % anobject.id kfun.register_object(anobject)
def create_room(name, description, id = None, exits=None, baseclass=None): aroom = baseclass.room() aroom.name = name aroom.description = description aroom.exits = exits if id is None: aroom.id = kfun.create_id() else: aroom.id = id print "room id %i created" % aroom.id print aroom.exits kfun.register_object(aroom)