Qubet  1.0
The ultimate QGL addicting videogame!
 All Classes Functions Variables Pages
letter.h
1 // Qubet - Copyright (C) 2011
2 // Enrico Bacis
3 // Daniele Ciriello
4 
5 // Qubet 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 3 of the License, or
8 // (at your option) any later version.
9 
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 
15 // You should have received a copy of the GNU General Public License
16 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18 
19 #ifndef LETTER_H
20 #define LETTER_H
21 
22 #include <QtOpenGL>
23 
34 class Letter
35 {
36 
37 public:
38 
44  explicit Letter(QChar _letter);
45 
49  ~Letter();
50 
56  GLuint getRandomTexture();
57 
64  QList<GLuint> getRandomTextures(int numberOfTextures);
65 
71  QList<GLuint> getAllTextures();
72 
78  GLvoid appendTexture(GLuint textureID);
79 
80 private:
81 
82  QChar letter;
83  QList<GLuint> textures;
97  QList<int> getRandomUniqueSequence(int from, int to, int cases);
98 };
99 
100 #endif // LETTER_H
QList< GLuint > textures
Definition: letter.h:83
QList< GLuint > getRandomTextures(int numberOfTextures)
Returns a QList of numberOfTextures random selected texture from the list of texture IDs of the Lette...
Definition: letter.cpp:36
QChar letter
Definition: letter.h:82
Letter(QChar _letter)
Create a Letter that rapresents the character _letter.
Definition: letter.cpp:21
~Letter()
Safely destroy a Letter.
Definition: letter.cpp:26
GLvoid appendTexture(GLuint textureID)
Appends a textures to the Letter's textures List.
Definition: letter.cpp:52
This class rapresents a single Letter (or number or special character), with a list of textures that ...
Definition: letter.h:34
GLuint getRandomTexture()
Returns a random selected texture from the list of texture IDs of the Letter.
Definition: letter.cpp:29
QList< GLuint > getAllTextures()
Returns a QList of all the textures of the Letter.
Definition: letter.cpp:47
QList< int > getRandomUniqueSequence(int from, int to, int cases)
It is a private utility method that returns a QList of random unique (if possible) integer numbers fr...
Definition: letter.cpp:58