Skip to content

Replace Thing.portable with an IMovementRestriction #113

@exarkun

Description

@exarkun

Ability to restrict the movement of a Thing is implemented within the Thing class itself, in the moveTo method, where the portable attribute is checked.

However, there's a system for powerups to interfere with the movement of things which is already general enough to implement the equivalent of Thing.portable == False. Thus, Thing.portable could be removed and the functionality replaced with a powerup like (just sketching):

@implementer(IMovementRestriction)
class Immoveable(Enhancement):
    powerupInterfaces = [IMovementRestriction]
    def movementImminent(self, movee, destination):
        raise CannotMove(movee, destination)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions