Migrate. Made Exits work differently, by use of commands directly instead of an exithandler assigning commands on-the-fly. This solution is a lot cleaner and also solves an issue where @reload would kill typeclasses in situations where an exit was painting to an object whose typeclass was reloaded (same issue occured if the exit typeclass itself was reloaded). As part of these fixes I cleaned up the merging of cmdsets to now merge in strict priority order, as one would expect them to do. Many small bug-fixes and cleanups all over. Resolves issue 164. Resolves issue 163.

This commit is contained in:
Griatch 2011-05-01 18:04:15 +00:00
parent 4bcd5239b5
commit b8a13a2389
17 changed files with 323 additions and 298 deletions

View file

@ -449,12 +449,12 @@ class ObjectDB(TypedObject):
has_player = property(has_player_get)
#@property
def contents_get(self):
def contents_get(self, exclude=None):
"""
Returns the contents of this object, i.e. all
objects that has this object set as its location.
"""
return ObjectDB.objects.get_contents(self)
return ObjectDB.objects.get_contents(self, excludeobj=exclude)
contents = property(contents_get)
#@property
@ -748,6 +748,17 @@ class ObjectDB(TypedObject):
obj.msg(string)
obj.move_to(home)
def copy(self, new_key=None):
"""
Makes an identical copy of this object and returns
it. The copy will be named <key>_copy by default. If you
want to customize the copy by changing some settings, use
the manager method copy_object directly.
"""
if not new_key:
new_key = "%s_copy" % self.key
return ObjectDB.objects.copy_object(self, new_key=new_key)
def delete(self):
"""
Deletes this object.