/***************************************************************************
 *   Copyright (C) 2005 by Tavarez Arnaud Bakoula                          *
 *   tbakoula@yahoo.fr                                                     *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef PION_H
#define PION_H

#include "utilities.h"
/**
@author Tavarez Arnaud Bakoula
*/
class Pion
{
public:
    Pion( uint p=0, Color c=None ) : m_pos(p), m_color(c) {}
    /*!
     *  The copy constructor.
     */
    Pion( const Pion& p ) : m_pos( p.m_pos ), m_color( p.m_color ) {}
    /*!
     *  The destructor.
     */
    virtual ~Pion() {}

    void setPos( uint p )    {  m_pos   = p;  }
    void setColor( Color c ) {  m_color = c;  }
    void setColor( uint c )
    {
      m_color = static_cast<Color>( c );
    }
    uint  getPos() const      {  return m_pos;  }
    Color getColor() const  {  return m_color;  }

    bool operator==( Pion& pion ) const
    {
      return ( this->m_pos == pion.m_pos && this->m_color == pion.m_color );
    }
    bool operator!=( Pion& pion ) const
    {
      return !(*this == pion);
    }

protected:
    uint m_pos;       /*!< The position of the piece in the combination. */
    Color m_color;    /*!< The color of the piece. */
};

#endif // PION_H
