refresh 34876c279151bb8e46666bdd5294d97c2e32d0e5
[tagua/yd.git] / src / variants / chess / namer.cpp
blobf1f575d71f7cc801436ba04dcb1728a3b954c314
1 /*
2 Copyright (c) 2007 Paolo Capriotti <p.capriotti@gmail.com>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8 */
10 #include "namer.h"
11 #include <core/color.h>
12 #include <core/piece.h>
13 #include <core/type.h>
15 #include <KDebug>
17 namespace Chess {
19 QString Namer::name(const Piece& piece) const {
20 if (piece.color() && piece.type()) {
21 //kDebug() << "naming" << piece.color()->name() << piece.type()->name();
22 return piece.color()->name() + "_" + piece.type()->name();
23 } else {
24 kDebug() << "naming incomplete piece" << piece.color() << piece.type();
25 return "";
29 } // namespace Chess