refresh dc9ccb8c0bf4bc198802d4d39ad2bc523eb5e06f
[tagua/yd.git] / src / core / color.h
blob3c7df64e2688aef61f5590432b077adfa4a64e64
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 #ifndef CORE__COLOR_H
12 #define CORE__COLOR_H
14 #include "component.h"
16 /**
17 * @brief A player in a game.
19 * Each color represents a different player, and possibly the ownership
20 * of pieces on the board.
22 class TAGUA_EXPORT IColor {
23 public:
24 virtual ~IColor();
26 /**
27 * @return The color name.
29 virtual QString name() const = 0;
31 /**
32 * @return The color index.
34 virtual int index() const = 0;
37 class TAGUA_EXPORT White : public Component, public IColor {
38 Q_OBJECT
39 White();
40 public:
41 virtual QString name() const;
42 virtual int index() const;
44 static White* self();
47 class TAGUA_EXPORT Black : public Component, public IColor {
48 Q_OBJECT
49 Black();
50 public:
51 virtual QString name() const;
52 virtual int index() const;
54 static Black* self();
57 #endif // CORE__COLOR_H