Rough PGN save support.
[tagua/yd.git] / src / icsgamedata.cpp
blob2f5fb096b5fc8e2fefa5e051775af52b2b6a9ffc
1 /*
2 Copyright (c) 2006-2007 Paolo Capriotti <p.capriotti@gmail.com>
3 (c) 2006-2007 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.
9 */
11 #include "icsgamedata.h"
12 #include "tagua.h"
13 #include "gameinfo.h"
14 #include "variants.h"
16 ICSGameData::ICSGameData()
17 : index(0) {
18 setType("");
21 ICSGameData::ICSGameData(int index, const QString& type)
22 : index(index) {
23 setType(type);
26 void ICSGameData::setType(const QString& type) {
27 variant = Variants::instance().get(GameInfo::variantCode(type));
28 if (!variant) {
29 ERROR("BUG: No variant corresponding to " << type);
31 else if (!(icsapi = variant->icsAPI())) {
32 // There's no ICSAPI in this variant.
33 // This means we cannot use it for ICS stuff, so we
34 // fall back to the dummy variant.
35 // TODO