This class is used to keep a list of Letter (from this the name Alphabet) It provide access to Letter function such as appending textures to a Letter and getting textures from a Letter. More...
#include <alphabet.h>
Public Member Functions | |
Alphabet () | |
Creates an empty Alphabet and initializes the seed of random number generation used to extract a set of random Letter textures. | |
~Alphabet () | |
Safely destroy an Alphabet (and all the Letter in its list). | |
Skin * | getRandomLetterSkin (QChar letter) |
Returns a random generated Skin of the letter given as parameter. More... | |
GLuint | getRandomLetterTexture (QChar letter) |
Returns a random texture of the letter given as parameter. More... | |
QList< GLuint > | getRandomLetterTextures (QChar letter, GLint numberOfTextures) |
Returns a list of random textures of the letter given as parameter. More... | |
QList< GLuint > | getAllLetterTextures (QChar letter) |
Returns a list of all the textures of the letter given as parameter. More... | |
GLvoid | appendLetterTexture (QChar letter, GLuint textureID) |
Appends the textureID given as parameter to the Letter's textures of the letter given as parameter. More... | |
Private Attributes | |
QMap< QChar, Letter * > | lettersList |
This class is used to keep a list of Letter (from this the name Alphabet) It provide access to Letter function such as appending textures to a Letter and getting textures from a Letter.
GLvoid Alphabet::appendLetterTexture | ( | QChar | letter, |
GLuint | textureID | ||
) |
Appends the textureID given as parameter to the Letter's textures of the letter given as parameter.
letter | is the letter to which you want to append the textureID. |
textureID | is the texture ID to append. |
QList< GLuint > Alphabet::getAllLetterTextures | ( | QChar | letter | ) |
Returns a list of all the textures of the letter given as parameter.
If the letter is not present in the Alphabet or contains no textures, the function will return an empty list.
letter | is the QChar letter of the Alphabet you want to extract textures. |
Skin * Alphabet::getRandomLetterSkin | ( | QChar | letter | ) |
Returns a random generated Skin of the letter given as parameter.
If the letter has got at least 6 textures, the skin faces are not repeated, else they are choosen in a completely random way.
If the letter is not present in the Alphabet or contains no textures, the function will return a Skin of zeros.
letter | is the QChar letter of the Alphabet you want to generate the skin. |
GLuint Alphabet::getRandomLetterTexture | ( | QChar | letter | ) |
Returns a random texture of the letter given as parameter.
If the letter is not present in the Alphabet or contains no textures, the function will return 0.
letter | is the letter you want a texture. |
QList< GLuint > Alphabet::getRandomLetterTextures | ( | QChar | letter, |
GLint | numberOfTextures | ||
) |
Returns a list of random textures of the letter given as parameter.
If the letter has got at least numberOfTextures textures, the skin faces are not repeated, else they are choosen in a completely random way.
If the letter is not present in the Alphabet or contains no textures, the function will return a list of zeros.
letter | is the QChar letter of the Alphabet you want to extract textures. |
numberOfTextures | is the number of textures you want to extract from the Letter. |
|
private |
It is the QMap of Letter* that compose the Alphabet.