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

StoneField Class Reference

#include </home/clem/local/src/opie/noncore/games/zsame/StoneField.h>

Collaboration diagram for StoneField:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 StoneField (int width=15, int height=10, int colors=3, unsigned int board=0, bool undoenabled=true)
 ~StoneField ()
int width () const
int height () const
void newGame (unsigned int board, int colors)
void reset ()
int mark (int x, int y, bool force=false)
void unmark ()
int remove (int x, int y, bool force=false)
int undo (int count=1)
bool isGameover () const
bool gotBonus () const
void clearBonus ()
bool undoPossible () const
int getBoard () const
int getScore () const
int getColors () const
int getMarked () const

Protected Member Functions

int getFieldSize () const
StonegetField () const
int map (int x, int y)
void mark (int index, unsigned char color)

Private Attributes

int sizex
int sizey
int maxstone
Stonefield
int colors
unsigned int board
unsigned int score
int gameover
bool m_gotBonus
int marked
KRandomSequence random
QList< StoneFieldState > * undolist

Friends

class StoneFieldState
class StoneWidget

Constructor & Destructor Documentation

StoneField::StoneField int  width = 15,
int  height = 10,
int  colors = 3,
unsigned int  board = 0,
bool  undoenabled = true
 

Definition at line 55 of file StoneField.cpp.

References field, m_gotBonus, maxstone, newGame(), sizex, sizey, and undolist.

StoneField::~StoneField  ) 
 

Definition at line 73 of file StoneField.cpp.

References field, and undolist.


Member Function Documentation

void StoneField::clearBonus  ) 
 

Definition at line 355 of file StoneField.cpp.

References m_gotBonus.

Referenced by StoneWidget::clearBonus().

int StoneField::getBoard  )  const
 

Definition at line 360 of file StoneField.cpp.

References board.

Referenced by StoneWidget::board(), and StoneWidget::newGame().

int StoneField::getColors  )  const
 

Definition at line 370 of file StoneField.cpp.

References colors.

Referenced by StoneWidget::colors(), and StoneWidget::newGame().

struct Stone * StoneField::getField  )  const [protected]
 

Definition at line 385 of file StoneField.cpp.

References field.

Referenced by StoneWidget::paintEvent().

int StoneField::getFieldSize  )  const [protected]
 

Definition at line 380 of file StoneField.cpp.

References maxstone.

int StoneField::getMarked  )  const
 

Definition at line 375 of file StoneField.cpp.

References marked.

Referenced by StoneWidget::marked(), StoneWidget::mousePressEvent(), and StoneWidget::undo().

int StoneField::getScore  )  const
 

Definition at line 365 of file StoneField.cpp.

References score.

Referenced by StoneWidget::mousePressEvent(), StoneWidget::score(), and StoneWidget::undo().

bool StoneField::gotBonus  )  const
 

Definition at line 351 of file StoneField.cpp.

References m_gotBonus.

Referenced by StoneWidget::hasBonus().

int StoneField::height  )  const
 

Definition at line 85 of file StoneField.cpp.

References sizey.

bool StoneField::isGameover  )  const
 

Definition at line 322 of file StoneField.cpp.

References field, gameover, i, maxstone, and sizex.

Referenced by StoneWidget::isGameover(), StoneWidget::mousePressEvent(), StoneWidget::myMoveEvent(), StoneWidget::undo(), and StoneWidget::undoPossible().

int StoneField::map int  x,
int  y
[protected]
 

Definition at line 136 of file StoneField.cpp.

References assert, sizex, and sizey.

Referenced by mark(), and remove().

void StoneField::mark int  index,
unsigned char  color
[protected]
 

Definition at line 163 of file StoneField.cpp.

References Stone::changed, Stone::color, field, mark(), marked, Stone::marked, maxstone, sizex, and sizey.

int StoneField::mark int  x,
int  y,
bool  force = false
 

Definition at line 142 of file StoneField.cpp.

References field, map(), Stone::marked, marked, and unmark().

Referenced by mark(), StoneWidget::mousePressEvent(), StoneWidget::myMoveEvent(), remove(), and StoneWidget::undo().

void StoneField::newGame unsigned int  board,
int  colors
 

Definition at line 90 of file StoneField.cpp.

References reset().

Referenced by StoneWidget::newGame(), and StoneField().

int StoneField::remove int  x,
int  y,
bool  force = false
 

Definition at line 199 of file StoneField.cpp.

References Stone::changed, col, Stone::color, Opie::MM::dest, empty, field, gameover, i, m_gotBonus, map(), mark(), Stone::marked, marked, maxstone, row, score, sizex, sizey, StoneFieldState, and undolist.

Referenced by StoneWidget::mousePressEvent().

void StoneField::reset  ) 
 

Definition at line 101 of file StoneField.cpp.

References board, Stone::changed, Stone::color, colors, field, gameover, KRandomSequence::getLong(), i, marked, Stone::marked, maxstone, random, score, KRandomSequence::setSeed(), and undolist.

Referenced by newGame(), and StoneWidget::reset().

int StoneField::undo int  count = 1  ) 
 

Definition at line 301 of file StoneField.cpp.

References StoneFieldState::restore(), undolist, and undoPossible().

Referenced by StoneWidget::undo().

bool StoneField::undoPossible  )  const
 

Definition at line 296 of file StoneField.cpp.

References undolist.

Referenced by undo(), and StoneWidget::undoPossible().

void StoneField::unmark  ) 
 

Definition at line 187 of file StoneField.cpp.

References Stone::changed, field, i, Stone::marked, marked, and maxstone.

Referenced by mark(), StoneWidget::myMoveEvent(), StoneWidget::timerEvent(), and StoneWidget::unmark().

int StoneField::width  )  const
 

Definition at line 80 of file StoneField.cpp.

References sizex.


Friends And Related Function Documentation

friend class StoneFieldState [friend]
 

Definition at line 54 of file StoneField.h.

Referenced by remove().

friend class StoneWidget [friend]
 

Definition at line 55 of file StoneField.h.


Member Data Documentation

unsigned int StoneField::board [private]
 

Definition at line 65 of file StoneField.h.

Referenced by getBoard(), reset(), StoneFieldState::restore(), and StoneFieldState::StoneFieldState().

int StoneField::colors [private]
 

Definition at line 64 of file StoneField.h.

Referenced by getColors(), reset(), StoneFieldState::restore(), and StoneFieldState::StoneFieldState().

struct Stone* StoneField::field [private]
 

Definition at line 62 of file StoneField.h.

Referenced by getField(), isGameover(), mark(), remove(), reset(), StoneFieldState::restore(), StoneField(), StoneFieldState::StoneFieldState(), unmark(), and ~StoneField().

int StoneField::gameover [mutable, private]
 

Definition at line 67 of file StoneField.h.

Referenced by isGameover(), remove(), reset(), StoneFieldState::restore(), and StoneFieldState::StoneFieldState().

bool StoneField::m_gotBonus [private]
 

Definition at line 68 of file StoneField.h.

Referenced by clearBonus(), gotBonus(), remove(), and StoneField().

int StoneField::marked [private]
 

Definition at line 69 of file StoneField.h.

Referenced by getMarked(), mark(), remove(), reset(), StoneFieldState::restore(), and unmark().

int StoneField::maxstone [private]
 

Definition at line 60 of file StoneField.h.

Referenced by getFieldSize(), isGameover(), mark(), remove(), reset(), StoneFieldState::restore(), StoneField(), StoneFieldState::StoneFieldState(), and unmark().

KRandomSequence StoneField::random [private]
 

Definition at line 71 of file StoneField.h.

Referenced by reset().

unsigned int StoneField::score [private]
 

Definition at line 66 of file StoneField.h.

Referenced by getScore(), remove(), reset(), StoneFieldState::restore(), and StoneFieldState::StoneFieldState().

int StoneField::sizex [private]
 

Definition at line 58 of file StoneField.h.

Referenced by isGameover(), map(), mark(), remove(), StoneField(), and width().

int StoneField::sizey [private]
 

Definition at line 59 of file StoneField.h.

Referenced by height(), map(), mark(), remove(), and StoneField().

QList<StoneFieldState>* StoneField::undolist [private]
 

Definition at line 72 of file StoneField.h.

Referenced by remove(), reset(), StoneField(), undo(), undoPossible(), and ~StoneField().


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