ggp_rs::check_time! [−] [src]

macro_rules! check_time {
    ($self_:ident, $game:ident) => (
        if $game.move_start_time().to(time::PreciseTime::now()) >
            time::Duration::milliseconds(
                (1000 * $game.play_clock() - $self_.cutoff()) as i64) {
            return $self_.out_of_time($game);
        });
}

Checks whether we are out of time, and if so, returns the move selected by Player::out_of_time.