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

KAstTopLevel Class Reference

#include </home/clem/local/src/opie/noncore/games/qasteroids/toplevel.h>

Collaboration diagram for KAstTopLevel:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 KAstTopLevel (QWidget *parent=0, const char *name=0, WFlags fl=0)
virtual ~KAstTopLevel ()

Static Public Member Functions

static QString appName ()

Protected Member Functions

virtual void showEvent (QShowEvent *)
virtual void hideEvent (QHideEvent *)
virtual void keyPressEvent (QKeyEvent *event)
virtual void keyReleaseEvent (QKeyEvent *event)
virtual void focusInEvent (QFocusEvent *event)
virtual void focusOutEvent (QFocusEvent *event)

Private Types

enum  Action {
  Launch, Thrust, RotateLeft, RotateRight,
  Shoot, Teleport, Brake, Shield,
  Pause, NewGame
}

Private Slots

void slotNewGame ()
void slotShipKilled ()
void slotRockHit (int size)
void slotRocksRemoved ()
void slotUpdateVitals ()

Private Member Functions

void playSound (const char *snd)
void readSoundMapping ()
void doStats ()

Private Attributes

KAsteroidsViewview
QLCDNumber * scoreLCD
QLCDNumber * levelLCD
QLCDNumber * shipsLCD
QLCDNumber * teleportsLCD
QLCDNumber * brakesLCD
QLCDNumber * shieldLCD
QLCDNumber * shootLCD
KALedMeterpowerMeter
bool sound
QDict< QStringsoundDict
bool waitShip
bool isPaused
int shipsRemain
int score
int level
bool showHiscores
QMap< int, Actionactions

Member Enumeration Documentation

enum KAstTopLevel::Action [private]
 

Enumeration values:
Launch 
Thrust 
RotateLeft 
RotateRight 
Shoot 
Teleport 
Brake 
Shield 
Pause 
NewGame 

Definition at line 94 of file toplevel.h.


Constructor & Destructor Documentation

KAstTopLevel::KAstTopLevel QWidget *  parent = 0,
const char *  name = 0,
WFlags  fl = 0
 

Definition at line 86 of file toplevel.cpp.

References actions, KALedMeter::addColorRange(), Brake, brakesLCD, FALSE, QString::find(), QPEApplication::grabKeyboard(), QMap< Key, T >::insert(), Qt::Key_Down, Qt::Key_Enter, Key_F10, Key_F11, Key_F12, Key_F9, Qt::Key_Left, Qt::Key_P, Qt::Key_Right, Qt::Key_Space, Qt::Key_Up, Qt::Key_Z, Launch, levelLCD, Opie::Core::OResource::loadPixmap(), MAX_POWER_LEVEL, Pause, powerMeter, RotateLeft, RotateRight, scoreLCD, KALedMeter::setCount(), KALedMeter::setRange(), Shield, shieldLCD, shipsLCD, shipsRemain, Shoot, shootLCD, showHiscores, slotNewGame(), slotRockHit(), slotRocksRemoved(), slotShipKilled(), slotUpdateVitals(), Teleport, Thrust, tr, TRUE, and view.

KAstTopLevel::~KAstTopLevel  )  [virtual]
 

Definition at line 292 of file toplevel.cpp.


Member Function Documentation

static QString KAstTopLevel::appName  )  [inline, static]
 

Definition at line 44 of file toplevel.h.

References QString::fromLatin1().

void KAstTopLevel::doStats  )  [private]
 

Definition at line 517 of file toplevel.cpp.

References FALSE, KAsteroidsView::hits(), QString::number(), KAsteroidsView::shots(), KAsteroidsView::showText(), tr, and view.

Referenced by slotShipKilled().

void KAstTopLevel::focusInEvent QFocusEvent *  event  )  [protected, virtual]
 

Definition at line 436 of file toplevel.cpp.

References FALSE, KAsteroidsView::pause(), and view.

void KAstTopLevel::focusOutEvent QFocusEvent *  event  )  [protected, virtual]
 

Definition at line 442 of file toplevel.cpp.

References KAsteroidsView::pause(), TRUE, and view.

void KAstTopLevel::hideEvent QHideEvent *   )  [protected, virtual]
 

Definition at line 430 of file toplevel.cpp.

References KAsteroidsView::pause(), TRUE, and view.

void KAstTopLevel::keyPressEvent QKeyEvent *  event  )  [protected, virtual]
 

Definition at line 300 of file toplevel.cpp.

References actions, KAsteroidsView::brake(), Brake, QMap< Key, T >::contains(), KAsteroidsView::rotateLeft(), RotateLeft, KAsteroidsView::rotateRight(), RotateRight, KAsteroidsView::setShield(), Shield, KAsteroidsView::shoot(), Shoot, KAsteroidsView::teleport(), Teleport, KAsteroidsView::thrust(), Thrust, TRUE, and view.

void KAstTopLevel::keyReleaseEvent QKeyEvent *  event  )  [protected, virtual]
 

Definition at line 347 of file toplevel.cpp.

References actions, KAsteroidsView::brake(), Brake, QMap< Key, T >::contains(), FALSE, KAsteroidsView::hideText(), Launch, KAsteroidsView::newShip(), KAsteroidsView::rotateLeft(), RotateLeft, KAsteroidsView::rotateRight(), RotateRight, KAsteroidsView::setShield(), Shield, KAsteroidsView::shoot(), Shoot, slotNewGame(), KAsteroidsView::teleport(), Teleport, KAsteroidsView::thrust(), Thrust, view, and waitShip.

void KAstTopLevel::playSound const char *  snd  )  [private]
 

Definition at line 296 of file toplevel.cpp.

Referenced by slotRockHit(), and slotShipKilled().

void KAstTopLevel::readSoundMapping  )  [private]
 

void KAstTopLevel::showEvent QShowEvent *   )  [protected, virtual]
 

Definition at line 423 of file toplevel.cpp.

References FALSE, KAsteroidsView::pause(), and view.

void KAstTopLevel::slotNewGame  )  [private, slot]
 

Definition at line 447 of file toplevel.cpp.

References KAsteroidsView::addRocks(), FALSE, KAsteroidsView::hideText(), isPaused, level, levelLCD, KAsteroidsView::newGame(), KAsteroidsView::newShip(), score, scoreLCD, KAsteroidsView::setRockSpeed(), shipsLCD, shipsRemain, view, and waitShip.

Referenced by KAstTopLevel(), and keyReleaseEvent().

void KAstTopLevel::slotRockHit int  size  )  [private, slot]
 

Definition at line 483 of file toplevel.cpp.

References playSound(), score, and scoreLCD.

Referenced by KAstTopLevel().

void KAstTopLevel::slotRocksRemoved  )  [private, slot]
 

Definition at line 504 of file toplevel.cpp.

References KAsteroidsView::addRocks(), level, levelLCD, MAX_LEVELS, KAsteroidsView::setRockSpeed(), and view.

Referenced by KAstTopLevel().

void KAstTopLevel::slotShipKilled  )  [private, slot]
 

Definition at line 464 of file toplevel.cpp.

References doStats(), KAsteroidsView::endGame(), playSound(), shipsLCD, shipsRemain, KAsteroidsView::showText(), tr, TRUE, view, and waitShip.

Referenced by KAstTopLevel().

void KAstTopLevel::slotUpdateVitals  )  [private, slot]
 

Definition at line 527 of file toplevel.cpp.

References KAsteroidsView::brakeCount(), brakesLCD, KAsteroidsView::power(), powerMeter, KALedMeter::setValue(), KAsteroidsView::shieldCount(), shieldLCD, KAsteroidsView::shootCount(), shootLCD, and view.

Referenced by KAstTopLevel().


Member Data Documentation

QMap<int,Action> KAstTopLevel::actions [private]
 

Definition at line 97 of file toplevel.h.

Referenced by KAstTopLevel(), keyPressEvent(), and keyReleaseEvent().

QLCDNumber* KAstTopLevel::brakesLCD [private]
 

Definition at line 77 of file toplevel.h.

Referenced by KAstTopLevel(), and slotUpdateVitals().

bool KAstTopLevel::isPaused [private]
 

Definition at line 87 of file toplevel.h.

Referenced by slotNewGame().

int KAstTopLevel::level [private]
 

Definition at line 91 of file toplevel.h.

Referenced by slotNewGame(), and slotRocksRemoved().

QLCDNumber* KAstTopLevel::levelLCD [private]
 

Definition at line 72 of file toplevel.h.

Referenced by KAstTopLevel(), slotNewGame(), and slotRocksRemoved().

KALedMeter* KAstTopLevel::powerMeter [private]
 

Definition at line 80 of file toplevel.h.

Referenced by KAstTopLevel(), and slotUpdateVitals().

int KAstTopLevel::score [private]
 

Definition at line 90 of file toplevel.h.

Referenced by slotNewGame(), and slotRockHit().

QLCDNumber* KAstTopLevel::scoreLCD [private]
 

Definition at line 71 of file toplevel.h.

Referenced by KAstTopLevel(), slotNewGame(), and slotRockHit().

QLCDNumber* KAstTopLevel::shieldLCD [private]
 

Definition at line 78 of file toplevel.h.

Referenced by KAstTopLevel(), and slotUpdateVitals().

QLCDNumber* KAstTopLevel::shipsLCD [private]
 

Definition at line 73 of file toplevel.h.

Referenced by KAstTopLevel(), slotNewGame(), and slotShipKilled().

int KAstTopLevel::shipsRemain [private]
 

Definition at line 89 of file toplevel.h.

Referenced by KAstTopLevel(), slotNewGame(), and slotShipKilled().

QLCDNumber* KAstTopLevel::shootLCD [private]
 

Definition at line 79 of file toplevel.h.

Referenced by KAstTopLevel(), and slotUpdateVitals().

bool KAstTopLevel::showHiscores [private]
 

Definition at line 92 of file toplevel.h.

Referenced by KAstTopLevel().

bool KAstTopLevel::sound [private]
 

Definition at line 82 of file toplevel.h.

QDict<QString> KAstTopLevel::soundDict [private]
 

Definition at line 83 of file toplevel.h.

QLCDNumber* KAstTopLevel::teleportsLCD [private]
 

Definition at line 75 of file toplevel.h.

KAsteroidsView* KAstTopLevel::view [private]
 

Definition at line 70 of file toplevel.h.

Referenced by doStats(), focusInEvent(), focusOutEvent(), hideEvent(), KAstTopLevel(), keyPressEvent(), keyReleaseEvent(), showEvent(), slotNewGame(), slotRocksRemoved(), slotShipKilled(), and slotUpdateVitals().

bool KAstTopLevel::waitShip [private]
 

Definition at line 86 of file toplevel.h.

Referenced by keyReleaseEvent(), slotNewGame(), and slotShipKilled().


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