示例#1
0
void initialize()
{
    move_sp = move_stack;
    chessclock[0]=chessclock[1]=10*60*1000;
    clockinc = 0;

    branch_info.average = 0.0;
    branch_info.count = 0;

    if (book_mode)
    {
	change_gamemode(OPENING, 0);
	loadbook(bookfile);
    }
    else
    {
    	change_gamemode(MIDGAME, 1);
    }
    
    setupboard();

    ponder_mode = 0;
    
    init_learning();
    
    ply = 0;
    searchdepth = midgamedepth;

    computer[WHITE]=0;
    computer[BLACK]=searchdepth;
    
    loadrc();
}
示例#2
0
/**
 * Public Function of the library class
 *
 * @brief init_book - This function is function used to initialize the book struct
 * @param book - The book which needs to be initalized
 */
void library::init_book(current_book * book){

    if(book == NULL){ return; }

    for(int i = 0; i < this->books.count(); i++){
        if(book->title->compare(this->books[i].title, Qt::CaseInsensitive) == 0){
            loadbook(i, book);
            return;
        }
    }

    QString open(*book->file_location);
    open.append(*book->title);

    QFile file(*book->file_location + *book->title);
    if(!file.open(QIODevice::ReadOnly)){
        QMessageBox::information(0, "Error", "No Book Found");
        return;
    }

    book->pagenum = 0;
    index_book(book);
    books.append(*book);
    file.close();
}
示例#3
0
/* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
void cmd_book(char *s){loadbook(bookfile);}