1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//! Implements `DummyTimeManager`.

use search_executor::*;
use hash_table::Variation;
use time_manager::{TimeManager, RemainingTime};
use uci::SetOption;


/// Implements a time manager that never terminates the search.
///
/// This is useful when the search executor implements its own time
/// management logic.
pub struct DummyTimeManager;


impl<S> TimeManager<S> for DummyTimeManager
    where S: SearchExecutor<ReportData = Vec<Variation>>
{
    fn new(_: &S::SearchNode, _: &RemainingTime) -> DummyTimeManager {
        DummyTimeManager
    }

    fn update(&mut self, _: &SearchReport<Vec<Variation>>) {}

    /// Returns `false`.
    fn must_play(&self) -> bool {
        false
    }
}


impl SetOption for DummyTimeManager {}