2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@sns.it>
3 (c) 2006 Maurizio Monge <maurizio.monge@kdemail.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
11 #include "engineinfo.h"
12 #include "xboardengine.h"
16 using namespace boost
;
18 void EngineInfo::playAsWhite() {
19 m_ui
.addPlayingEngine(0, engine());
22 void EngineInfo::playAsBlack() {
23 m_ui
.addPlayingEngine(1, engine());
26 void EngineInfo::analyze() {
27 if (m_token
.valid()) {
28 m_ui
.removeAnalysingEngine(m_token
);
29 m_token
= EntityToken();
32 m_token
= m_ui
.addAnalysingEngine(engine());
35 EngineInfo::EngineInfo(const EngineDetails
& details
, UI
& ui
)
40 shared_ptr
<Engine
> EngineInfo::engine() {
41 shared_ptr
<Engine
> res
;
42 if (m_details
.type
== EngineDetails::XBoard
)
43 res
= shared_ptr
<Engine
>(new XBoardEngine(m_details
.path
, QStringList()));
45 ERROR("Unimplemented engine type " << m_details
.type
);
46 return shared_ptr
<Engine
>();
50 res
->setWorkingPath(m_details
.workPath
);