Пример #1
0
        def stateRefill():
            (refill,_) = self.board.refillBoard()

            output.event('logic_stateRefill', {
              'board_state' : self.board.state,
              'refill' : refill,
              'shorten' : self.shorten
            })
Пример #2
0
        def stateBegin():

            output.event('logic_stateBegin', {
              'iteration' : self.iteration,
              'board_state' : self.board.state
            })

            return STATE_MOVE
Пример #3
0
        def stateGravity():

            fallCount = 0
            while not self.board.simulateGravity():
                fallCount += 1

            output.event('logic_stateGravity', {
              'board_state' : self.board.state,
              'fall_count' : fallCount,
              'shorten' : self.shorten
            })
Пример #4
0
        def stateExplode():

            (patterns, exploded) = self.board.explodePatterns()

            output.event('logic_stateExplode', {
              'patterns' : patterns,
              'exploded' : exploded,
              'board_state' : self.board.state,
              'shorten' : self.shorten
            })

            return exploded
Пример #5
0
        def stateMove():
            move = self.player.getMove(self.board)

            if (move == None):
                return True
            else:

                result = self.board.makeMove(move)

                output.event('logic_stateMove', {
                  'move' : str(move),
                  'marked_board' : self.board.state.reprConsoleMarkMoves(list(move)),
                  'move_result' : result
                })
                return False