• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegames API Reference
  • KDE Home
  • Contact Us
 

KShisen

Public Slots | Signals | Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
Board Class Reference

#include <board.h>

Inherits QWidget.

Public Slots

bool loadBackground (const QString &)
 
void loadSettings ()
 
bool loadTileset (const QString &)
 
void newGame ()
 
void setPauseEnabled (bool enabled)
 
void setSoundsEnabled (bool enabled)
 

Signals

void changed ()
 
void cheatStatusChanged ()
 
void endOfGame ()
 
void invalidMove ()
 
void markMatched ()
 
void newGameStarted ()
 
void resized ()
 
void selectAMatchingTile ()
 
void selectAMove ()
 
void selectATile ()
 
void tilesDoNotMatch ()
 

Public Member Functions

 Board (QWidget *parent=0)
 
 ~Board ()
 
bool canRedo () const
 
bool canUndo () const
 
int currentTime () const
 
int delay () const
 
bool gravityFlag () const
 
bool hasCheated () const
 
bool hint_I (PossibleMoves &possibleMoves) const
 
bool isOver () const
 
bool isPaused () const
 
bool isStuck () const
 
virtual void mousePressEvent (QMouseEvent *e)
 
virtual void paintEvent (QPaintEvent *e)
 
void redo ()
 
void resetRedo ()
 
void resetTimer ()
 
void resetUndo ()
 
void resizeBoard ()
 
virtual void resizeEvent (QResizeEvent *e)
 
void setCheatModeEnabled (bool enabled)
 
void setChineseStyleFlag (bool b)
 
void setDelay (int)
 
void setGameOverEnabled (bool enabled)
 
void setGameStuckEnabled (bool enabled)
 
void setGravityFlag (bool b)
 
void setSize (int x, int y)
 
void setSolvableFlag (bool b)
 
void setTilesCanSlideFlag (bool b)
 
void showHint ()
 
bool solvable (bool noRestore=false)
 
bool solvableFlag () const
 
int tilesLeft () const
 
void undo ()
 
int xTiles () const
 
int yTiles () const
 

Static Public Attributes

static const int nTiles = 42
 

Protected Member Functions

virtual QSize sizeHint () const
 

Detailed Description

Class holding the game board and its functions.

Definition at line 136 of file board.h.

Constructor & Destructor Documentation

Board::Board ( QWidget *  parent = 0)

Definition at line 69 of file board.cpp.

Board::~Board ( )

Definition at line 94 of file board.cpp.

Member Function Documentation

bool Board::canRedo ( ) const

Returns if redo step is available.

Definition at line 1459 of file board.cpp.

bool Board::canUndo ( ) const

Returns if undo step is available.

Definition at line 1454 of file board.cpp.

void Board::changed ( )
signal
void Board::cheatStatusChanged ( )
signal
int Board::currentTime ( ) const

Returns the current game time in seconds.

Definition at line 1824 of file board.cpp.

int Board::delay ( ) const

Definition at line 1433 of file board.cpp.

void Board::endOfGame ( )
signal
bool Board::gravityFlag ( ) const

Definition at line 1875 of file board.cpp.

bool Board::hasCheated ( ) const

Returns whether player is in cheat mode.

Returns
True if the player is in cheat mode, False if not

Definition at line 2012 of file board.cpp.

bool Board::hint_I ( PossibleMoves &  possibleMoves) const

Definition at line 1779 of file board.cpp.

void Board::invalidMove ( )
signal
bool Board::isOver ( ) const

Returns whether the game is over.

Returns
True if game is over, False if game is not over

Definition at line 1997 of file board.cpp.

bool Board::isPaused ( ) const

Returns whether the game is in pause mode.

Returns
True if game is paused, False if game is not paused

Definition at line 2002 of file board.cpp.

bool Board::isStuck ( ) const

Returns whether there are still matching tiles left.

Returns
True if there are no matching tiles left, False if there are matching tiles left

Definition at line 2007 of file board.cpp.

bool Board::loadBackground ( const QString &  pathToBackground)
slot

Loads the given background.

Definition at line 158 of file board.cpp.

void Board::loadSettings ( )
slot

Loads the game settings.

Definition at line 99 of file board.cpp.

bool Board::loadTileset ( const QString &  pathToTileset)
slot

Loads the given tileset.

Definition at line 137 of file board.cpp.

void Board::markMatched ( )
signal
void Board::mousePressEvent ( QMouseEvent *  e)
virtual

Definition at line 281 of file board.cpp.

void Board::newGame ( )
slot

Does most of the newGame work.

This slot is called from the App::invokeNewGame() signal from App and should call App::newGame again to do the work that cannot be done from Board.

Definition at line 436 of file board.cpp.

void Board::newGameStarted ( )
signal
void Board::paintEvent ( QPaintEvent *  e)
virtual

Definition at line 679 of file board.cpp.

void Board::redo ( )

Redoes one step.

Definition at line 1686 of file board.cpp.

void Board::resetRedo ( )

Resets the redo history.

Definition at line 1953 of file board.cpp.

void Board::resetTimer ( )

Resets the game timer.

Definition at line 1939 of file board.cpp.

void Board::resetUndo ( )

Resets the undo history.

Definition at line 1944 of file board.cpp.

void Board::resizeBoard ( )

Definition at line 422 of file board.cpp.

void Board::resized ( )
signal
void Board::resizeEvent ( QResizeEvent *  e)
virtual

Definition at line 412 of file board.cpp.

void Board::selectAMatchingTile ( )
signal
void Board::selectAMove ( )
signal
void Board::selectATile ( )
signal
void Board::setCheatModeEnabled ( bool  enabled)

Sets whether the game is in cheat mode.

Definition at line 1988 of file board.cpp.

void Board::setChineseStyleFlag ( bool  b)

Definition at line 1892 of file board.cpp.

void Board::setDelay ( int  newValue)

Definition at line 1425 of file board.cpp.

void Board::setGameOverEnabled ( bool  enabled)

Sets whether the game is over.

Definition at line 1978 of file board.cpp.

void Board::setGameStuckEnabled ( bool  enabled)

Sets whether there are no matching tiles left.

Definition at line 1962 of file board.cpp.

void Board::setGravityFlag ( bool  b)

Definition at line 1880 of file board.cpp.

void Board::setPauseEnabled ( bool  enabled)
slot

Controls the pause mode.

Definition at line 1914 of file board.cpp.

void Board::setSize ( int  x,
int  y 
)

Definition at line 381 of file board.cpp.

void Board::setSolvableFlag ( bool  b)

Definition at line 1863 of file board.cpp.

void Board::setSoundsEnabled ( bool  enabled)
slot

Enables / disables sounds.

Parameters
enabledWhether sound shall be enabled

Definition at line 2017 of file board.cpp.

void Board::setTilesCanSlideFlag ( bool  b)

Definition at line 1902 of file board.cpp.

void Board::showHint ( )

Definition at line 1709 of file board.cpp.

QSize Board::sizeHint ( ) const
protectedvirtual

Definition at line 1930 of file board.cpp.

bool Board::solvable ( bool  noRestore = false)

Returns whether the current game is solvable.

Definition at line 1829 of file board.cpp.

bool Board::solvableFlag ( ) const

Definition at line 1858 of file board.cpp.

void Board::tilesDoNotMatch ( )
signal
int Board::tilesLeft ( ) const

Returns the number of tiles left on the board.

Definition at line 1809 of file board.cpp.

void Board::undo ( )

Undoes one step.

Definition at line 1464 of file board.cpp.

int Board::xTiles ( ) const

Definition at line 179 of file board.cpp.

int Board::yTiles ( ) const

Definition at line 184 of file board.cpp.

Member Data Documentation

const int Board::nTiles = 42
static

Definition at line 144 of file board.h.


The documentation for this class was generated from the following files:
  • board.h
  • board.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:44:19 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KShisen

Skip menu "KShisen"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdegames API Reference

Skip menu "kdegames API Reference"
  • granatier
  • kapman
  • kblackbox
  • kgoldrunner
  • kigo
  • kmahjongg
  • KShisen
  • ksquares
  • libkdegames
  •   highscore
  •   libkdegamesprivate
  •     kgame
  • libkmahjongg
  • palapeli
  •   libpala

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal