コード例 #1
0
class GuardedSuspensionPattern(object):
    """Demonstrates the guarded suspension pattern."""

    def __init__(self):
        self.player1 = Player("Player1")
        self.player2 = Player("Player2")
        self.player3 = Player("Player3")
        self.coach = Coach()

    def demonstrate(self):
        self.player1.participate()
        self.player2.participate()
        self.player3.participate()

        self.coach.coach_the_game()
        time.sleep(5)
        self.coach.coach_the_game()
        time.sleep(5)
        self.coach.coach_the_game()
        time.sleep(5)
        self.coach.coach_the_game()