2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@gmail.com>
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"
13 #include "gnushogiengine.h"
17 using namespace boost
;
19 void EngineInfo::playAsWhite() {
23 void EngineInfo::playAsBlack() {
27 void EngineInfo::playAs(int player
) {
28 if (m_token
[player
].valid()) {
29 m_ui
.removeEntity(m_token
[player
]);
30 m_token
[player
] = EntityToken();
33 m_token
[player
] = m_ui
.addPlayingEngine(player
, engine());
37 // void EngineInfo::analyze() {
38 // if (m_token.valid()) {
39 // m_ui.removeAnalysingEngine(m_token);
40 // m_token = EntityToken();
43 // m_token = m_ui.addAnalysingEngine(engine());
46 EngineInfo::EngineInfo(const EngineDetails
& details
, UI
& ui
)
51 shared_ptr
<Engine
> EngineInfo::engine() {
52 shared_ptr
<Engine
> res
;
53 if (m_details
.type
== EngineDetails::XBoard
)
54 res
= shared_ptr
<Engine
>(new XBoardEngine(m_details
.path
, QStringList()));
55 else if (m_details
.type
== EngineDetails::GNUShogi
)
56 res
= shared_ptr
<Engine
>(new GNUShogiEngine(m_details
.path
, QStringList()));
58 ERROR("Unimplemented engine type " << EngineDetails::typeName(m_details
.type
));
59 return shared_ptr
<Engine
>();
63 res
->setWorkingPath(m_details
.workPath
);