def stateRefill(): (refill,_) = self.board.refillBoard() output.event('logic_stateRefill', { 'board_state' : self.board.state, 'refill' : refill, 'shorten' : self.shorten })
def stateBegin(): output.event('logic_stateBegin', { 'iteration' : self.iteration, 'board_state' : self.board.state }) return STATE_MOVE
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 })
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
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