コード例 #1
0
    def next_scene(self, i):
        if i % 2 == 0:
            sceneFactory = Yellow()
        else:
            sceneFactory = Cyan()

        return sceneFactory.scene()
コード例 #2
0
    def next_scene(self, i):
        if i % 3 == 0:
            sceneFactory = Yellow()
        elif i % 3 == 1:
            sceneFactory = Cyan()
        else:
            sceneFactory = Purple()

        return sceneFactory.scene()
コード例 #3
0
    def next_scene(self, i):
        red = Red().scene()
        green = Green().scene()
        cyan = Cyan().scene()
        blue = Blue().scene()
        purple = Purple().scene()
        yellow = Yellow().scene()
        blackout = Blackout().scene()
        white = White().scene()
        strobe = WhiteStrobeLow().scene()
        flash = withFlash(Blackout().scene())

        chainStrobe = [
            blackout, white, blackout, white, blackout, blackout, blackout,
            white, blackout, white, blackout, blackout, flash, blackout,
            blackout, blackout, flash, white, blackout, white, blackout,
            blackout, blackout, white, blackout, white, blackout, blackout,
            flash, blackout, blackout, blackout, flash, white, blackout, white,
            blackout, blackout, blackout, white, blackout, white, blackout,
            blackout, flash, white, white, white, white, white, white, white,
            blackout, blackout, blackout, red, blackout, red, blackout,
            blackout, blackout
        ]
        chainStrobe += chainStrobe

        chain = [blackout]

        if i < len(chainStrobe):
            return chainStrobe[i % (len(chainStrobe))]
        else:
            return chain[(i - len(chainStrobe)) % (len(chain))]
コード例 #4
0
    def next_scene(self, i):
        wait = [{"type": "wait", "duration": 0.05}]

        return Yellow().scene() + wait + Red().scene()
コード例 #5
0
 def next_scene(self, i):
     return withFlash(Yellow().scene())
コード例 #6
0
        def withFlash(effect):
            wait = [{"type": "wait", "duration": 0.05}]

            return Yellow().scene() + wait + effect