• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegames API Reference
  • KDE Home
  • Contact Us
 

kigo

  • sources
  • kde-4.14
  • kdegames
  • kigo
  • src
  • game
stone.h
Go to the documentation of this file.
1 /*
2  Copyright 2008 Sascha Peilicke <sasch.pe@gmx.de>
3 
4  This program is free software; you can redistribute it and/or
5  modify it under the terms of the GNU General Public License as
6  published by the Free Software Foundation; either version 2 of
7  the License or (at your option) version 3 or any later version
8  accepted by the membership of KDE e.V. (or its successor approved
9  by the membership of KDE e.V.), which shall act as a proxy
10  defined in Section 14 of version 3 of the license.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 #ifndef KIGO_STONE_H
22 #define KIGO_STONE_H
23 
24 #include <QString>
25 
26 namespace Kigo {
27 
31 class Stone
32 {
33 public:
34  static Stone Pass;
35  static Stone Invalid;
36 
43  explicit Stone(char x = 0, int y = 0, float value = 0);
44 
50  explicit Stone(const QString &stone, float value = 0);
51 
52  Stone(const Stone &other);
53  Stone &operator=(const Stone &other);
54 
55  bool isValid() const;
56  QString toString() const;
57  QByteArray toLatin1() const;
58 
59  char x() const { return m_x; }
60  int y() const { return m_y; }
61  float value() const { return m_value; }
62 
63 private:
64  char m_x;
65  int m_y;
66  float m_value;
67 };
68 
69 QDebug operator<<(QDebug debug, const Stone &stone);
70 
71 } // End of namespace Kigo
72 
73 #endif
QByteArray
Kigo::Stone::operator=
Stone & operator=(const Stone &other)
Definition: stone.cpp:49
Kigo::Stone::Invalid
static Stone Invalid
A standard invalid move object.
Definition: stone.h:35
Kigo::Stone::isValid
bool isValid() const
Definition: stone.cpp:57
Kigo::Stone::Pass
static Stone Pass
A standard pass move object.
Definition: stone.h:34
Kigo::Stone
This class represents a stone on a field of the game board.
Definition: stone.h:31
QString
Kigo::Stone::value
float value() const
Definition: stone.h:61
Kigo::Stone::toLatin1
QByteArray toLatin1() const
Definition: stone.cpp:63
Kigo::Stone::x
char x() const
Definition: stone.h:59
QDebug
Kigo::Stone::y
int y() const
Definition: stone.h:60
Kigo::operator<<
QDebug operator<<(QDebug debug, const Move &move)
Definition: move.cpp:44
Kigo::Stone::toString
QString toString() const
Definition: stone.cpp:68
Kigo::Stone::Stone
Stone(char x=0, int y=0, float value=0)
Standard constructor.
Definition: stone.cpp:30
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:29 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kigo

Skip menu "kigo"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdegames API Reference

Skip menu "kdegames API Reference"
  • granatier
  • kapman
  • kblackbox
  • kgoldrunner
  • kigo
  • kmahjongg
  • KShisen
  • ksquares
  • libkdegames
  •   highscore
  •   libkdegamesprivate
  •     kgame
  • libkmahjongg
  • palapeli
  •   libpala

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal