Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Player(object):
- def __init__(self):
- self.gamemethods_ = "start"
- self.mymethodes_ = "ready"
- def handle(self, str1, str2):
- self.gamemethods_ = str1
- self.mymethodes_ = str2
- def __getattribute__(self, name):
- if(name == object.__getattribute__(self, "mymethodes_")):
- return object.__getattribute__(self, "handle")
- else:
- attribute = object.__getattribute__(self, name)
- return attribute
- def play(game):
- player = Player()
- while(True):
- getattr(game, player.gamemethods_)(player)
Advertisement
Add Comment
Please, Sign In to add comment