imaginary icon indicating copy to clipboard operation
imaginary copied to clipboard

Replace Thing.portable with an IMovementRestriction

Open exarkun opened this issue 5 years ago • 0 comments

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)

exarkun avatar Nov 26 '20 22:11 exarkun