Tetris Class Reference

#include <Tetris.h>

Inheritance diagram for Tetris:

TCanvas TPad TPad TVirtualPad TVirtualPad TVirtualPad TVirtualPad TQObject TAttPad TAttFill TAttLine TObject TQObject TAttPad TAttFill TAttLine TObject TQObject TAttPad TAttFill TAttLine TObject TQObject TAttPad TAttFill TAttLine TObject TQObject TAttPad TAttFill TAttLine TObject TQObject TAttPad TAttFill TAttLine TObject TQObject TAttPad TAttFill TAttLine TObject TQObject TAttPad TAttFill TAttLine TObject List of all members.

Public Member Functions

 Tetris ()
virtual ~Tetris ()
Int_t GetLevel ()
Int_t GetLinesRemoved ()
Int_t GetPiecesDropped ()
Int_t GetScore ()
Bool_t IsGameOn ()
Bool_t IsPaused ()
Bool_t IsWaiting ()
void SetLevel (int level)
void Quit ()
void Pause ()
void Continue ()
void NewGame ()
void StopGame ()

Protected Member Functions

void SetFixedSize ()
void CreateNewPiece ()
void UpdatePiecesDropped ()
void UpdateLinesRemoved ()
void UpdateScore (Int_t add_value)
void UpdateLevel ()
void PrintHelpInfo ()
virtual void MoveLeft ()
virtual void MoveRight ()
virtual void DropDown ()
virtual void RotateRight ()
virtual void RotateLeft ()

Private Attributes

CurrentPiecefCurrentPiece
TetrisBoardfBoard
NextPiecePadfNextPiece
InfoPadfLinesRemoved
InfoPadfLevel
InfoPadfScore
NewGameButtonfNewGame
QuitButtonfQuit
PauseButtonfPause
KeyHandlerfKeyHandler
Int_t fPiecesDropped
UpdateLevelTimerfUpdateLevelTimer

Friends

class KeyHandler
class TetrisBoard
class UpdateLevelTimer

Detailed Description

Definition at line 354 of file Tetris.h.


Constructor & Destructor Documentation

Tetris::Tetris (  ) 

Definition at line 932 of file Tetris.cxx.

References TPad::Draw(), TButton::Draw(), fBoard, fCurrentPiece, TPad::fEditable, fKeyHandler, fLevel, fLinesRemoved, fNewGame, fNextPiece, fPause, fPiecesDropped, fQuit, fScore, fUpdateLevelTimer, gTetris, KeyHandler, kFALSE, PrintHelpInfo(), TAttFill::SetFillColor(), SetFixedSize(), TetrisBoard, TCanvas::Update(), and UpdateLevelTimer.

virtual Tetris::~Tetris (  )  [inline, virtual]

Definition at line 392 of file Tetris.h.

References fKeyHandler.


Member Function Documentation

void Tetris::SetFixedSize (  )  [protected]

Definition at line 1000 of file Tetris.cxx.

References TCanvas::fCanvasImp, TCanvas::fCh, and TCanvas::fCw.

Referenced by Tetris().

void Tetris::CreateNewPiece (  )  [protected]

Definition at line 991 of file Tetris.cxx.

References fBoard, fCurrentPiece, fNextPiece, NextPiecePad::GetPiece(), TetrisPiece::GetType(), NextPiecePad::NewPiece(), and type.

Referenced by NewGame(), and TetrisBoard::PieceDropped().

void Tetris::UpdatePiecesDropped (  )  [inline, protected]

Definition at line 378 of file Tetris.h.

References fPiecesDropped.

Referenced by TetrisBoard::PieceDropped().

void Tetris::UpdateLinesRemoved (  )  [inline, protected]

Definition at line 379 of file Tetris.h.

References InfoPad::AddValue(), and fLinesRemoved.

Referenced by TetrisBoard::RemoveFullLines().

void Tetris::UpdateScore ( Int_t  add_value  )  [inline, protected]

Definition at line 380 of file Tetris.h.

References InfoPad::AddValue(), and fScore.

Referenced by TetrisBoard::PieceDropped().

void Tetris::UpdateLevel (  )  [inline, protected]

Definition at line 381 of file Tetris.h.

References InfoPad::AddValue(), fLevel, and GetLevel().

Referenced by UpdateLevelTimer::Notify().

void Tetris::PrintHelpInfo (  )  [protected]

Definition at line 979 of file Tetris.cxx.

Referenced by Tetris().

void Tetris::MoveLeft (  )  [protected, virtual]

Definition at line 1063 of file Tetris.cxx.

References fCurrentPiece, IsGameOn(), IsPaused(), IsWaiting(), and CurrentPiece::MoveLeft().

Referenced by KeyHandler::HandleKey().

void Tetris::MoveRight (  )  [protected, virtual]

Definition at line 1071 of file Tetris.cxx.

References fCurrentPiece, IsGameOn(), IsPaused(), IsWaiting(), and CurrentPiece::MoveRight().

Referenced by KeyHandler::HandleKey().

void Tetris::DropDown (  )  [protected, virtual]

Definition at line 1079 of file Tetris.cxx.

References CurrentPiece::DropDown(), fCurrentPiece, IsGameOn(), IsPaused(), and IsWaiting().

Referenced by KeyHandler::HandleKey().

void Tetris::RotateRight (  )  [protected, virtual]

Definition at line 1087 of file Tetris.cxx.

References fCurrentPiece, IsGameOn(), IsPaused(), IsWaiting(), and CurrentPiece::RotateRight().

Referenced by KeyHandler::HandleKey().

void Tetris::RotateLeft (  )  [protected, virtual]

Definition at line 1095 of file Tetris.cxx.

References fCurrentPiece, IsGameOn(), IsPaused(), IsWaiting(), and CurrentPiece::RotateLeft().

Referenced by KeyHandler::HandleKey().

Int_t Tetris::GetLevel (  )  [inline]

Definition at line 394 of file Tetris.h.

References fLevel, and InfoPad::GetValue().

Referenced by TetrisBoard::PieceDropped(), CurrentPiece::SetSpeed(), and UpdateLevel().

Int_t Tetris::GetLinesRemoved (  )  [inline]

Definition at line 395 of file Tetris.h.

References fLinesRemoved, and InfoPad::GetValue().

Int_t Tetris::GetPiecesDropped (  )  [inline]

Definition at line 396 of file Tetris.h.

References fPiecesDropped.

Int_t Tetris::GetScore (  )  [inline]

Definition at line 397 of file Tetris.h.

References fScore, and InfoPad::GetValue().

Bool_t Tetris::IsGameOn (  )  [inline]

Definition at line 399 of file Tetris.h.

References fNewGame, and NewGameButton::IsPressed().

Referenced by Continue(), DropDown(), MoveLeft(), MoveRight(), NewGame(), UpdateLevelTimer::Notify(), TetrisBoard::PaintModified(), Pause(), RotateLeft(), and RotateRight().

Bool_t Tetris::IsPaused (  )  [inline]

Definition at line 400 of file Tetris.h.

References fPause, and PauseButton::IsPressed().

Referenced by DropDown(), MoveLeft(), MoveRight(), TetrisBoard::PaintModified(), RotateLeft(), and RotateRight().

Bool_t Tetris::IsWaiting (  )  [inline]

Definition at line 401 of file Tetris.h.

References kFALSE.

Referenced by DropDown(), MoveLeft(), MoveRight(), RotateLeft(), and RotateRight().

void Tetris::SetLevel ( int  level  ) 

Definition at line 1103 of file Tetris.cxx.

References fCurrentPiece, fLevel, CurrentPiece::SetSpeed(), and InfoPad::SetValue().

Referenced by NewGame().

void Tetris::Quit (  ) 

Definition at line 1007 of file Tetris.cxx.

References TCanvas::fCanvasImp, fKeyHandler, and StopGame().

Referenced by QuitButton::ExecuteEvent().

void Tetris::Pause (  ) 

Definition at line 1043 of file Tetris.cxx.

References fBoard, fCurrentPiece, fPause, TetrisBoard::Hide(), IsGameOn(), kTRUE, PauseButton::SetPressed(), and TTimer::Stop().

Referenced by PauseButton::ExecuteEvent().

void Tetris::Continue (  ) 

Definition at line 1053 of file Tetris.cxx.

References fBoard, fCurrentPiece, fPause, IsGameOn(), kFALSE, PauseButton::SetPressed(), TetrisBoard::Show(), and TTimer::Start().

Referenced by PauseButton::ExecuteEvent().

void Tetris::NewGame (  ) 

Definition at line 1016 of file Tetris.cxx.

References TetrisBoard::Clear(), CreateNewPiece(), fBoard, TCanvas::fCanvasImp, fLinesRemoved, fNewGame, fPiecesDropped, fScore, fUpdateLevelTimer, gVirtualX, IsGameOn(), kTRUE, InfoPad::Reset(), SetLevel(), NewGameButton::SetPressed(), TTimer::Start(), and StopGame().

Referenced by NewGameButton::ExecuteEvent().

void Tetris::StopGame (  ) 

Definition at line 1033 of file Tetris.cxx.

References fCurrentPiece, fNewGame, fPause, fUpdateLevelTimer, kFALSE, NewGameButton::SetPressed(), PauseButton::SetPressed(), and TTimer::Stop().

Referenced by CurrentPiece::CurrentPiece(), NewGame(), and Quit().


Friends And Related Function Documentation

friend class KeyHandler [friend]

Definition at line 356 of file Tetris.h.

Referenced by Tetris().

friend class TetrisBoard [friend]

Definition at line 357 of file Tetris.h.

Referenced by Tetris().

friend class UpdateLevelTimer [friend]

Definition at line 358 of file Tetris.h.

Referenced by Tetris().


Member Data Documentation

CurrentPiece* Tetris::fCurrentPiece [private]

Definition at line 361 of file Tetris.h.

Referenced by Continue(), CreateNewPiece(), DropDown(), MoveLeft(), MoveRight(), TetrisBoard::PaintModified(), Pause(), RotateLeft(), RotateRight(), SetLevel(), StopGame(), and Tetris().

TetrisBoard* Tetris::fBoard [private]

Definition at line 362 of file Tetris.h.

Referenced by Continue(), CreateNewPiece(), NewGame(), Pause(), and Tetris().

NextPiecePad* Tetris::fNextPiece [private]

Definition at line 363 of file Tetris.h.

Referenced by CreateNewPiece(), and Tetris().

InfoPad* Tetris::fLinesRemoved [private]

Definition at line 364 of file Tetris.h.

Referenced by GetLinesRemoved(), NewGame(), Tetris(), and UpdateLinesRemoved().

InfoPad* Tetris::fLevel [private]

Definition at line 365 of file Tetris.h.

Referenced by GetLevel(), SetLevel(), Tetris(), and UpdateLevel().

InfoPad* Tetris::fScore [private]

Definition at line 366 of file Tetris.h.

Referenced by GetScore(), NewGame(), Tetris(), and UpdateScore().

NewGameButton* Tetris::fNewGame [private]

Definition at line 367 of file Tetris.h.

Referenced by IsGameOn(), NewGame(), StopGame(), and Tetris().

QuitButton* Tetris::fQuit [private]

Definition at line 368 of file Tetris.h.

Referenced by Tetris().

PauseButton* Tetris::fPause [private]

Definition at line 369 of file Tetris.h.

Referenced by Continue(), IsPaused(), Pause(), StopGame(), and Tetris().

KeyHandler* Tetris::fKeyHandler [private]

Definition at line 370 of file Tetris.h.

Referenced by Quit(), Tetris(), and ~Tetris().

Int_t Tetris::fPiecesDropped [private]

Definition at line 372 of file Tetris.h.

Referenced by GetPiecesDropped(), NewGame(), Tetris(), and UpdatePiecesDropped().

UpdateLevelTimer* Tetris::fUpdateLevelTimer [private]

Definition at line 373 of file Tetris.h.

Referenced by NewGame(), StopGame(), and Tetris().


The documentation for this class was generated from the following files:
Generated on Tue Jul 5 16:36:27 2011 for ROOT_528-00b_version by  doxygen 1.5.1