Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Thing.portable with an IMovementRestriction #113

Open
exarkun opened this issue Nov 26, 2020 · 0 comments
Open

Replace Thing.portable with an IMovementRestriction #113

exarkun opened this issue Nov 26, 2020 · 0 comments

Comments

@exarkun
Copy link
Member

exarkun commented Nov 26, 2020

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant