Misc cleanups.
[tagua/yd.git] / src / core / piece.cpp
blob84a48419173e3d4a8e9e134ede6a2e2e8304636d
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, const 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 void Piece::setType(const IType* type) { m_type = type; }
22 bool Piece::operator==(const Piece& piece) const {
23 return m_type == piece.type() &&
24 m_color == piece.color();
27 bool Piece::operator!=(const Piece& piece) const {
28 return !(operator==(piece));