Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

TetrixPiece Class Reference

#include </home/clem/local/src/opie/noncore/games/tetrix/tpiece.h>

List of all members.

Public Member Functions

 TetrixPiece ()
 TetrixPiece (int type)
void setRandomType ()
void rotateLeft ()
void rotateRight ()
int getType ()
int getXCoord (int index)
int getYCoord (int index)
void getCoord (int index, int &x, int &y)
int getMinX ()
int getMaxX ()
int getMinY ()
int getMaxY ()

Static Public Member Functions

static void setRandomSeed (double seed)
static int randomValue (int maxPlusOne)

Private Member Functions

void setXCoord (int index, int value)
void setYCoord (int index, int value)
void setCoords (int index, int x, int y)
void initialize (int type)

Private Attributes

int pieceType
int coordinates [4][2]

Static Private Attributes

static double randomSeed = 0.33333


Constructor & Destructor Documentation

TetrixPiece::TetrixPiece  )  [inline]
 

Definition at line 28 of file tpiece.h.

References setRandomType().

TetrixPiece::TetrixPiece int  type  )  [inline]
 

Definition at line 29 of file tpiece.h.

References initialize().


Member Function Documentation

void TetrixPiece::getCoord int  index,
int &  x,
int &  y
[inline]
 

Definition at line 39 of file tpiece.h.

References coordinates.

Referenced by GenericTetrix::canMoveTo(), GenericTetrix::canPosition(), GenericTetrix::erasePiece(), GenericTetrix::gluePiece(), GenericTetrix::optimizedMove(), GenericTetrix::showNextPiece(), and GenericTetrix::showPiece().

int TetrixPiece::getMaxX  ) 
 

Definition at line 60 of file tpiece.cpp.

References coordinates.

Referenced by GenericTetrix::showNextPiece().

int TetrixPiece::getMaxY  ) 
 

Definition at line 79 of file tpiece.cpp.

References coordinates.

Referenced by GenericTetrix::showNextPiece().

int TetrixPiece::getMinX  ) 
 

Definition at line 51 of file tpiece.cpp.

References coordinates, and i.

Referenced by GenericTetrix::showNextPiece().

int TetrixPiece::getMinY  ) 
 

Definition at line 70 of file tpiece.cpp.

References coordinates.

Referenced by GenericTetrix::gluePiece(), GenericTetrix::newPiece(), and GenericTetrix::showNextPiece().

int TetrixPiece::getType  )  [inline]
 

Definition at line 36 of file tpiece.h.

References pieceType.

Referenced by GenericTetrix::gluePiece(), GenericTetrix::optimizedMove(), GenericTetrix::showNextPiece(), and GenericTetrix::showPiece().

int TetrixPiece::getXCoord int  index  )  [inline]
 

Definition at line 37 of file tpiece.h.

References coordinates.

Referenced by rotateLeft(), and rotateRight().

int TetrixPiece::getYCoord int  index  )  [inline]
 

Definition at line 38 of file tpiece.h.

References coordinates.

Referenced by rotateLeft(), and rotateRight().

void TetrixPiece::initialize int  type  )  [private]
 

Definition at line 88 of file tpiece.cpp.

References coordinates, i, and pieceType.

Referenced by setRandomType(), and TetrixPiece().

int TetrixPiece::randomValue int  maxPlusOne  )  [static]
 

Definition at line 192 of file tpiece.cpp.

References randomSeed.

Referenced by GenericTetrix::fillRandom(), and setRandomType().

void TetrixPiece::rotateLeft  ) 
 

Definition at line 27 of file tpiece.cpp.

References getXCoord(), getYCoord(), i, pieceType, setXCoord(), and setYCoord().

Referenced by GenericTetrix::rotateLeft().

void TetrixPiece::rotateRight  ) 
 

Definition at line 39 of file tpiece.cpp.

References getXCoord(), getYCoord(), i, pieceType, setXCoord(), and setYCoord().

Referenced by GenericTetrix::rotateRight().

void TetrixPiece::setCoords int  index,
int  x,
int  y
[inline, private]
 

Definition at line 52 of file tpiece.h.

References coordinates.

void TetrixPiece::setRandomSeed double  seed  )  [static]
 

Definition at line 174 of file tpiece.cpp.

References i, randomSeed, and QCString::sprintf().

Referenced by QTetrix::QTetrix().

void TetrixPiece::setRandomType  )  [inline]
 

Definition at line 31 of file tpiece.h.

References initialize(), and randomValue().

Referenced by GenericTetrix::newPiece(), and TetrixPiece().

void TetrixPiece::setXCoord int  index,
int  value
[inline, private]
 

Definition at line 50 of file tpiece.h.

References coordinates.

Referenced by rotateLeft(), and rotateRight().

void TetrixPiece::setYCoord int  index,
int  value
[inline, private]
 

Definition at line 51 of file tpiece.h.

References coordinates.

Referenced by rotateLeft(), and rotateRight().


Member Data Documentation

int TetrixPiece::coordinates[4][2] [private]
 

Definition at line 57 of file tpiece.h.

Referenced by getCoord(), getMaxX(), getMaxY(), getMinX(), getMinY(), getXCoord(), getYCoord(), initialize(), setCoords(), setXCoord(), and setYCoord().

int TetrixPiece::pieceType [private]
 

Definition at line 56 of file tpiece.h.

Referenced by getType(), initialize(), rotateLeft(), and rotateRight().

double TetrixPiece::randomSeed = 0.33333 [static, private]
 

Definition at line 172 of file tpiece.cpp.

Referenced by randomValue(), and setRandomSeed().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:53:37 2005 for OPIE by  doxygen 1.4.2