#include <Tetris.h>
Inheritance diagram for TetrisPiece:
Public Member Functions | |
TetrisPiece (TPad *pad=(TPad *) TVirtualPad::Pad()) | |
TetrisPiece (UInt_t type, TPad *pad=(TPad *) TVirtualPad::Pad()) | |
virtual | ~TetrisPiece () |
void | SetX (int index, int value) |
void | SetY (int index, int value) |
void | SetXY (int index, int x, int y) |
UInt_t | GetType () |
virtual void | SetType (UInt_t type) |
virtual void | SetRandomType () |
Int_t | GetX (int index) |
Int_t | GetY (int index) |
void | GetXY (int index, int &x, int &y) |
Int_t | GetX () |
Int_t | GetY () |
TetrisBox * | GetTetrisBox (Int_t i) |
void | SetX (Int_t x) |
void | SetY (Int_t y) |
void | SetXY (Int_t x, Int_t y) |
virtual void | Hide () |
virtual void | Show () |
virtual Bool_t | RotateLeft () |
virtual Bool_t | RotateRight () |
Protected Member Functions | |
void | SetXx (int index, int value) |
void | SetYy (int index, int value) |
void | SetXxYy (int index, int x, int y) |
Int_t | GetXx (int index) |
Int_t | GetYy (int index) |
void | GetXxYy (int index, int &x, int &y) |
Protected Attributes | |
TetrisBox * | fBoxes [4] |
UInt_t | fType |
Int_t | fY |
Int_t | fX |
Private Member Functions | |
void | Initialize (UInt_t type, TPad *pad) |
UInt_t | GetRandomType () |
void | HideSomeBoxes (UInt_t type) |
Definition at line 73 of file Tetris.h.
TetrisPiece::~TetrisPiece | ( | ) | [virtual] |
Definition at line 178 of file Tetris.cxx.
References fBoxes, fX, fY, i, and SetType().
Referenced by TetrisPiece().
UInt_t TetrisPiece::GetRandomType | ( | ) | [inline, private] |
Definition at line 83 of file Tetris.h.
References gRandom, and TRandom::Rndm().
Referenced by SetRandomType(), and TetrisPiece().
void TetrisPiece::HideSomeBoxes | ( | UInt_t | type | ) | [private] |
void TetrisPiece::SetXx | ( | int | index, | |
int | value | |||
) | [inline, protected] |
Definition at line 87 of file Tetris.h.
References fBoxes, fX, and TetrisBox::SetX().
Referenced by RotateLeft(), and RotateRight().
void TetrisPiece::SetYy | ( | int | index, | |
int | value | |||
) | [inline, protected] |
Definition at line 88 of file Tetris.h.
References fBoxes, fY, and TetrisBox::SetY().
Referenced by RotateLeft(), and RotateRight().
void TetrisPiece::SetXxYy | ( | int | index, | |
int | x, | |||
int | y | |||
) | [inline, protected] |
Definition at line 89 of file Tetris.h.
References fBoxes, fX, fY, TetrisBox::SetX(), and TetrisBox::SetY().
Int_t TetrisPiece::GetXx | ( | int | index | ) | [inline, protected] |
Definition at line 91 of file Tetris.h.
References fBoxes, fX, and TetrisBox::GetX().
Referenced by RotateLeft(), RotateRight(), SetX(), and SetXY().
Int_t TetrisPiece::GetYy | ( | int | index | ) | [inline, protected] |
Definition at line 92 of file Tetris.h.
References fBoxes, fY, and TetrisBox::GetY().
Referenced by RotateLeft(), RotateRight(), SetXY(), and SetY().
void TetrisPiece::GetXxYy | ( | int | index, | |
int & | x, | |||
int & | y | |||
) | [inline, protected] |
Definition at line 93 of file Tetris.h.
References fBoxes, fX, fY, TetrisBox::GetX(), and TetrisBox::GetY().
void TetrisPiece::SetX | ( | int | index, | |
int | value | |||
) | [inline] |
void TetrisPiece::SetY | ( | int | index, | |
int | value | |||
) | [inline] |
void TetrisPiece::SetXY | ( | int | index, | |
int | x, | |||
int | y | |||
) | [inline] |
Definition at line 102 of file Tetris.h.
References fBoxes, TetrisBox::SetX(), and TetrisBox::SetY().
Referenced by CurrentPiece::CanMoveTo(), CurrentPiece::CurrentPiece(), CurrentPiece::MoveTo(), and NextPiecePad::NextPiecePad().
UInt_t TetrisPiece::GetType | ( | ) | [inline] |
Definition at line 104 of file Tetris.h.
References fType.
Referenced by Tetris::CreateNewPiece(), RotateLeft(), and RotateRight().
void TetrisPiece::SetType | ( | UInt_t | type | ) | [virtual] |
Definition at line 186 of file Tetris.cxx.
References fBoxes, fType, fX, fY, gPieceColors, gPieceTypes, HideSomeBoxes(), i, TAttFill::SetFillColor(), TetrisBox::SetX(), and TetrisBox::SetY().
Referenced by Initialize(), SetRandomType(), and Show().
virtual void TetrisPiece::SetRandomType | ( | ) | [inline, virtual] |
Definition at line 107 of file Tetris.h.
References GetRandomType(), and SetType().
Referenced by NextPiecePad::NewPiece().
Int_t TetrisPiece::GetX | ( | int | index | ) | [inline] |
Int_t TetrisPiece::GetY | ( | int | index | ) | [inline] |
void TetrisPiece::GetXY | ( | int | index, | |
int & | x, | |||
int & | y | |||
) | [inline] |
Definition at line 111 of file Tetris.h.
References fBoxes, TetrisBox::GetX(), and TetrisBox::GetY().
Referenced by CurrentPiece::CanPosition(), and TetrisBoard::GluePiece().
Int_t TetrisPiece::GetX | ( | void | ) | [inline] |
Definition at line 113 of file Tetris.h.
References fX.
Referenced by CurrentPiece::DropDown(), CurrentPiece::MoveLeft(), CurrentPiece::MoveRight(), and CurrentPiece::OneLineDown().
Int_t TetrisPiece::GetY | ( | ) | [inline] |
Definition at line 114 of file Tetris.h.
References fY.
Referenced by CurrentPiece::DropDown(), CurrentPiece::MoveLeft(), CurrentPiece::MoveRight(), and CurrentPiece::OneLineDown().
void TetrisPiece::SetX | ( | Int_t | x | ) |
void TetrisPiece::SetY | ( | Int_t | y | ) |
void TetrisPiece::Hide | ( | ) | [virtual] |
Definition at line 249 of file Tetris.cxx.
Referenced by NextPiecePad::Hide(), and NextPiecePad::NextPiecePad().
void TetrisPiece::Show | ( | ) | [virtual] |
Definition at line 258 of file Tetris.cxx.
References fBoxes, fType, HideSomeBoxes(), i, and SetType().
Referenced by NextPiecePad::NewPiece(), and NextPiecePad::Show().
Bool_t TetrisPiece::RotateLeft | ( | ) | [virtual] |
Definition at line 232 of file Tetris.cxx.
References GetType(), GetXx(), GetYy(), i, kFALSE, kTRUE, SetXx(), and SetYy().
Referenced by CurrentPiece::RotateLeft(), and CurrentPiece::RotateRight().
Bool_t TetrisPiece::RotateRight | ( | ) | [virtual] |
Definition at line 215 of file Tetris.cxx.
References GetType(), GetXx(), GetYy(), i, kFALSE, kTRUE, SetXx(), and SetYy().
Referenced by CurrentPiece::RotateLeft(), and CurrentPiece::RotateRight().
TetrisBox* TetrisPiece::fBoxes[4] [protected] |
Definition at line 76 of file Tetris.h.
Referenced by CurrentPiece::Erase(), GetTetrisBox(), GetX(), GetXx(), GetXxYy(), GetXY(), GetY(), GetYy(), Hide(), HideSomeBoxes(), Initialize(), CurrentPiece::Paint(), SetType(), SetX(), SetXx(), SetXxYy(), SetXY(), SetY(), SetYy(), Show(), and ~TetrisPiece().
UInt_t TetrisPiece::fType [protected] |
Int_t TetrisPiece::fY [protected] |
Int_t TetrisPiece::fX [protected] |