File indexing completed on 2024-05-19 04:04:47

0001 /*
0002     SPDX-FileCopyrightText: 2008 Sascha Peilicke <sasch.pe@gmx.de>
0003 
0004     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005 */
0006 
0007 #ifndef KIGO_MOVE_H
0008 #define KIGO_MOVE_H
0009 
0010 #include "player.h"
0011 #include "stone.h"
0012 
0013 namespace Kigo {
0014 
0015 /**
0016  * The Move class is a light-weight representation of a Go
0017  * move (to be) made by a Go player.
0018  *
0019  * @author Sascha Peilicke <sasch.pe@gmx.de>
0020  * @since 0.5
0021  */
0022 class Move
0023 {
0024 public:
0025     Move(const Player *player, const Stone &stone);
0026     Move(const Move &other);
0027     Move &operator=(const Move &other);
0028 
0029     const Player *player() const { return m_player; }
0030     const Stone &stone() const { return m_stone; }
0031 
0032     bool isValid() const { return m_stone.isValid(); }
0033     bool isPass() const { return !m_stone.isValid(); }
0034 
0035 private:
0036     const Player *m_player;
0037     Stone m_stone;
0038 };
0039 
0040 QDebug operator<<(QDebug debug, const Move &move);
0041 
0042 } // End of namespace Kigo
0043 
0044 #endif