#include <Tetris.h>
Inheritance diagram for TetrisBoard:
Public Member Functions | |
TetrisBoard (Float_t xlow, Float_t ylow, Float_t xup, Float_t yup) | |
virtual | ~TetrisBoard () |
Int_t | GetHeight () |
Int_t | GetWidth () |
Bool_t | IsEmpty (Int_t x, Int_t y) |
void | SetDropped (Bool_t flag=kTRUE) |
virtual void | PaintModified () |
void | PieceDropped (TetrisPiece *piece, Int_t height) |
void | ExecuteEvent (Int_t, Int_t, Int_t) |
Private Member Functions | |
void | AllAboveLinesDown (Int_t line) |
void | MoveOneLineDown (Int_t line) |
void | RemoveFullLines () |
void | RemoveLine (int line) |
Bool_t | IsLineFull (int line) |
Bool_t | IsLineEmpty (int line) |
void | GluePiece (TetrisPiece *piece) |
void | Clear (Option_t *option="") |
void | Hide () |
void | Show () |
void | Print (const char *option="") const |
void | Print (const char *, Option_t *) |
Bool_t | IsEmptyLine (int line) |
Bool_t | IsFullLine (Int_t line) |
TetrisBoxPtr & | Board (Int_t x, Int_t y) |
Private Attributes | |
Int_t | fHeight |
Int_t | fWidth |
Bool_t | fIsDropped |
TetrisBoxPtr * | fBoard |
Int_t | fFilledLines |
2d array of pointers to Tetrisboxes, | |
Friends | |
class | Tetris |
Definition at line 134 of file Tetris.h.
Definition at line 509 of file Tetris.cxx.
References Clear(), fBoard, fFilledLines, fHeight, TPad::fMother, fWidth, gBoxPixelSize, TPad::GetX2(), TPad::GetY1(), int, TPad::PixeltoX(), TPad::SetPad(), TPad::XtoAbsPixel(), and TPad::YtoAbsPixel().
void TetrisBoard::AllAboveLinesDown | ( | Int_t | line | ) | [inline, private] |
Definition at line 147 of file Tetris.h.
References fFilledLines, i, and MoveOneLineDown().
Referenced by RemoveFullLines().
void TetrisBoard::MoveOneLineDown | ( | Int_t | line | ) | [private] |
Definition at line 602 of file Tetris.cxx.
References Board(), fWidth, i, IsEmpty(), TPad::Modified(), and TPad::Update().
Referenced by AllAboveLinesDown().
void TetrisBoard::RemoveFullLines | ( | ) | [private] |
Definition at line 619 of file Tetris.cxx.
References AllAboveLinesDown(), fFilledLines, gTetris, i, IsFullLine(), RemoveLine(), and Tetris::UpdateLinesRemoved().
Referenced by PieceDropped().
void TetrisBoard::RemoveLine | ( | int | line | ) | [private] |
Definition at line 590 of file Tetris.cxx.
References Board(), fWidth, and i.
Referenced by RemoveFullLines().
Bool_t TetrisBoard::IsLineFull | ( | int | line | ) | [private] |
Bool_t TetrisBoard::IsLineEmpty | ( | int | line | ) | [private] |
void TetrisBoard::GluePiece | ( | TetrisPiece * | piece | ) | [private] |
Definition at line 633 of file Tetris.cxx.
References Board(), box(), fFilledLines, TetrisPiece::GetTetrisBox(), TetrisPiece::GetXY(), i, x, and y.
Referenced by PieceDropped().
void TetrisBoard::Clear | ( | Option_t * | option = "" |
) | [private, virtual] |
Reimplemented from TPad.
Definition at line 529 of file Tetris.cxx.
References Board(), TList::Delete(), fHeight, fIsDropped, fWidth, TPad::GetListOfPrimitives(), i, j, and kTRUE.
Referenced by Tetris::NewGame(), and TetrisBoard().
void TetrisBoard::Hide | ( | ) | [private] |
Definition at line 542 of file Tetris.cxx.
References box(), TPad::GetListOfPrimitives(), TPad::Modified(), and TPad::Update().
Referenced by Tetris::Pause().
void TetrisBoard::Show | ( | ) | [private] |
Definition at line 554 of file Tetris.cxx.
References box(), TPad::GetListOfPrimitives(), TPad::Modified(), and TPad::Update().
Referenced by Tetris::Continue().
void TetrisBoard::Print | ( | const char * | option = "" |
) | const [private, virtual] |
void TetrisBoard::Print | ( | const char * | , | |
Option_t * | ||||
) | [inline, private, virtual] |
Bool_t TetrisBoard::IsEmptyLine | ( | int | line | ) | [private] |
Definition at line 578 of file Tetris.cxx.
References fWidth, i, IsEmpty(), kTRUE, and return_value.
Definition at line 566 of file Tetris.cxx.
References fWidth, i, IsEmpty(), kTRUE, and return_value.
Referenced by RemoveFullLines().
TetrisBoxPtr& TetrisBoard::Board | ( | Int_t | x, | |
Int_t | y | |||
) | [inline, private] |
Definition at line 165 of file Tetris.h.
References fBoard, and fWidth.
Referenced by Clear(), GluePiece(), IsEmpty(), MoveOneLineDown(), and RemoveLine().
Int_t TetrisBoard::GetHeight | ( | ) | [inline] |
Definition at line 171 of file Tetris.h.
References fHeight.
Referenced by CurrentPiece::CanPosition(), and CurrentPiece::CurrentPiece().
Int_t TetrisBoard::GetWidth | ( | ) | [inline] |
Definition at line 172 of file Tetris.h.
References fWidth.
Referenced by CurrentPiece::CanPosition(), and CurrentPiece::CurrentPiece().
Definition at line 173 of file Tetris.h.
References Board().
Referenced by CurrentPiece::CanPosition(), IsEmptyLine(), IsFullLine(), MoveOneLineDown(), and Print().
Definition at line 174 of file Tetris.h.
References fIsDropped, and flag.
Referenced by CurrentPiece::CurrentPiece().
void TetrisBoard::PaintModified | ( | ) | [virtual] |
Reimplemented from TPad.
Definition at line 679 of file Tetris.cxx.
References Tetris::fCurrentPiece, fIsDropped, gTetris, Tetris::IsGameOn(), Tetris::IsPaused(), CurrentPiece::Paint(), and TPad::PaintModified().
void TetrisBoard::PieceDropped | ( | TetrisPiece * | piece, | |
Int_t | height | |||
) |
Definition at line 649 of file Tetris.cxx.
References Tetris::CreateNewPiece(), fIsDropped, Tetris::GetLevel(), GluePiece(), gTetris, kFALSE, kTRUE, RemoveFullLines(), Tetris::UpdatePiecesDropped(), and Tetris::UpdateScore().
Referenced by CurrentPiece::DropDown(), and CurrentPiece::Notify().
Int_t TetrisBoard::fHeight [private] |
Definition at line 139 of file Tetris.h.
Referenced by Clear(), GetHeight(), Print(), and TetrisBoard().
Int_t TetrisBoard::fWidth [private] |
Definition at line 140 of file Tetris.h.
Referenced by Board(), Clear(), GetWidth(), IsEmptyLine(), IsFullLine(), MoveOneLineDown(), Print(), RemoveLine(), and TetrisBoard().
Bool_t TetrisBoard::fIsDropped [private] |
Definition at line 141 of file Tetris.h.
Referenced by Clear(), PaintModified(), PieceDropped(), and SetDropped().
TetrisBoxPtr* TetrisBoard::fBoard [private] |
Int_t TetrisBoard::fFilledLines [private] |
2d array of pointers to Tetrisboxes,
Definition at line 145 of file Tetris.h.
Referenced by AllAboveLinesDown(), GluePiece(), RemoveFullLines(), and TetrisBoard().