Updates self.valid_moves according to the latest game state.
        Assumes that the board and all hands are non-empty.
348908
def _update_valid_moves(self):
        '''
        
        '''
        left_end = self.board.left_end()
        right_end = self.board.right_end()

        moves = []
        for d in self.hands[self.turn]:
            if left_end in d:
                moves.append((d, True))
            # do not double count moves if both of the board's ends have
            # the same value, and a domino can be placed on both of them
            if right_end in d and left_end != right_end:
                moves.append((d, False))

        self.valid_moves = tuple(moves)
651560
def update_grid(self):
        """"""
        info_map = self.ms_game.get_info_map()
        for i in xrange(self.ms_game.board_height):
            for j in xrange(self.ms_game.board_width):
                self.grid_wgs[(i, j)].info_label(info_map[i, j])

        self.ctrl_wg.move_counter.display(self.ms_game.num_moves)
        if self.ms_game.game_status == 2:
            self.ctrl_wg.reset_button.setIcon(QtGui.QIcon(CONTINUE_PATH))
        elif self.ms_game.game_status == 1:
            self.ctrl_wg.reset_button.setIcon(QtGui.QIcon(WIN_PATH))
            self.timer.stop()
        elif self.ms_game.game_status == 0:
            self.ctrl_wg.reset_button.setIcon(QtGui.QIcon(LOSE_PATH))
            self.timer.stop()
591854
def update_move_counts(self, start_game, end_game, interval=1000):
        
        for g in range(start_game, end_game, interval):
            with tf.Session() as sess:
                start_row = ROW_PREFIX.format(g)
                end_row = ROW_PREFIX.format(g + interval)
                print('Range:', start_row, end_row)
                start_time = time.time()
                ds = self.tf_table.keys_by_range_dataset(start_row, end_row)
                h = _histogram_move_keys_by_game(sess, ds)
                self._write_move_counts(sess, h)
                end_time = time.time()
                elapsed = end_time - start_time
                print('  games/sec:', len(h)/elapsed)
601174
protected void updateDerivedState () {
        _planes[0].fromPoints(_vertices[0], _vertices[1], _vertices[2]); // near
        _planes[1].fromPoints(_vertices[5], _vertices[4], _vertices[7]); // far
        _planes[2].fromPoints(_vertices[1], _vertices[5], _vertices[6]); // left
        _planes[3].fromPoints(_vertices[4], _vertices[0], _vertices[3]); // right
        _planes[4].fromPoints(_vertices[3], _vertices[2], _vertices[6]); // top
        _planes[5].fromPoints(_vertices[4], _vertices[5], _vertices[1]); // bottom
        _bounds.fromPoints(_vertices);
    }
221086
def check_for_end_game(self):
		
		gameover = False
		for player in self.players:
			if player.playstate in (PlayState.CONCEDED, PlayState.DISCONNECTED):
				player.playstate = PlayState.LOSING
			if player.playstate == PlayState.LOSING:
				gameover = True

		if gameover:
			if self.players[0].playstate == self.players[1].playstate:
				for player in self.players:
					player.playstate = PlayState.TIED
			else:
				for player in self.players:
					if player.playstate == PlayState.LOSING:
						player.playstate = PlayState.LOST
					else:
						player.playstate = PlayState.WON
			self.state = State.COMPLETE
			self.manager.step(self.next_step, Step.FINAL_WRAPUP)
			self.manager.step(self.next_step, Step.FINAL_GAMEOVER)
			self.manager.step(self.next_step)
688653
def update(self, old, new):
        
        i = self.rank[old]     # change value at index i
        del self.rank[old]
        self.heap[i] = new
        self.rank[new] = i
        if old < new:          # maintain heap order
            self.down(i)
        else:
            self.up(i)
712153
def is_stalemate(self) -> bool:
        """"""
        if self.is_check():
            return False

        if self.is_variant_end():
            return False

        return not any(self.generate_legal_moves())
476495
def update(self):
        

        self.states = [bool(int(x)) for x in self.get('port list') or '0000']
335394
def update(self):
        
        with self._lock:
            if self._state == Bundle.ACTIVE:
                self.stop()
                self.start()
1042486
private function resetBetStacks()
    {
        $this->players()->each(function (PlayerContract $player) {
            $this->betStacks->put($player->name(), Chips::zero());
        });
    }
530789
def update(self, d):
        
        for (k, v) in d.items():
            if k not in self or self[k] != v:
                self[k] = v
88901
def update(self, td):
        """"""
        self.sprite.last_position = self.sprite.position
        self.sprite.last_velocity = self.sprite.velocity
        if self.particle_group != None:
            self.update_particle_group(td)
201679
def update(self):
        
        con = self.subpars.pars.control
        self(con.eqd2*con.tind)
320564
def update_done(self, *args, **kwargs):
        """"""
        kwargs['state'] = 'done'
        self.update(*args, **kwargs)
        self.rec = None
514852
def update(self):
        
        con = self.subpars.pars.control
        self(con.eqi1*con.tind)
1024261
def black_move(self):
        
        move = self.player_black.generate_move(self.position)
        move = make_legal(move, self.position)
        self.position.update(move)
481560
def update(self):
        
        con = self.subpars.pars.control
        self(con.eqi2*con.tind)