Qubet  1.0
The ultimate QGL addicting videogame!
 All Classes Functions Variables Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Letter Class Reference

This class rapresents a single Letter (or number or special character), with a list of textures that graphically rapresents the letter. More...

#include <letter.h>

Collaboration diagram for Letter:
Collaboration graph

Public Member Functions

 Letter (QChar _letter)
 Create a Letter that rapresents the character _letter. More...
 
 ~Letter ()
 Safely destroy a Letter.
 
GLuint getRandomTexture ()
 Returns a random selected texture from the list of texture IDs of the Letter. More...
 
QList< GLuint > getRandomTextures (int numberOfTextures)
 Returns a QList of numberOfTextures random selected texture from the list of texture IDs of the Letter. If the Letter contains at least numberOfTextures textures, the textures doesn't repeat. More...
 
QList< GLuint > getAllTextures ()
 Returns a QList of all the textures of the Letter. More...
 
GLvoid appendTexture (GLuint textureID)
 Appends a textures to the Letter's textures List. More...
 

Private Member Functions

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 from an interval. More...
 

Private Attributes

QChar letter
 
QList< GLuint > textures
 

Detailed Description

This class rapresents a single Letter (or number or special character), with a list of textures that graphically rapresents the letter.

In order to do this it stores the character in a QChar and a list GLuint that are the texture IDs.

Version
1.0
Author
#34

Constructor & Destructor Documentation

Letter::Letter ( QChar  _letter)
explicit

Create a Letter that rapresents the character _letter.

Parameters
_letteris the character rapresented.

Member Function Documentation

GLvoid Letter::appendTexture ( GLuint  textureID)

Appends a textures to the Letter's textures List.

Parameters
textureIDis the texture ID to append to the Letter.
QList< GLuint > Letter::getAllTextures ( )

Returns a QList of all the textures of the Letter.

Returns
a QList of all the textures of the Letter.
GLuint Letter::getRandomTexture ( )

Returns a random selected texture from the list of texture IDs of the Letter.

Returns
a random selected texture from the list of texture IDs of the Letter.

Here is the call graph for this function:

QList< GLuint > Letter::getRandomTextures ( int  numberOfTextures)

Returns a QList of numberOfTextures random selected texture from the list of texture IDs of the Letter. If the Letter contains at least numberOfTextures textures, the textures doesn't repeat.

Parameters
numberOfTexturesis the number of textures you want to extract.

Here is the call graph for this function:

Here is the caller graph for this function:

QList< int > Letter::getRandomUniqueSequence ( int  from,
int  to,
int  cases 
)
private

It is a private utility method that returns a QList of random unique (if possible) integer numbers from an interval.

It is a smart function and completes its task in a deterministic cases-linear time.

Parameters
fromis the lower bound of the interval.
tois the upper bound of the interval.
casesis the number of integer to select.
Returns
a QList of random unique (if possible) integer numbers from an interval.

Here is the caller graph for this function:

Member Data Documentation

QChar Letter::letter
private

It is the character rapresented.

QList<GLuint> Letter::textures
private

It is the QList of the texture IDs associated to the Letter.


The documentation for this class was generated from the following files: