De-constify piece types.
[tagua/yd.git] / src / core / piece.cpp
blob20664e20832fc11ca8718cefa23b62a066c2968a
1 /*
2 Copyright (c) 2007 Paolo Capriotti <p.capriotti@gmail.com>
3 (c) 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 "piece.h"
13 Piece::Piece(const IColor* color, IType* type)
14 : m_type(type)
15 , m_color(color) { }
17 const IColor* Piece::color() const { return m_color; }
19 const IType* Piece::type() const { return m_type; }
20 IType* Piece::type() { return m_type; }
21 void Piece::setType(IType* type) { m_type = type; }
23 bool Piece::operator==(const Piece& piece) const {
24 return m_type == piece.type() &&
25 m_color == piece.color();
28 bool Piece::operator!=(const Piece& piece) const {
29 return !(operator==(piece));