PieceSprite Class Reference

The sprite for a pixmap piece on the canvas. More...

#include <piecesprite.h>

Inheritance diagram for PieceSprite:

Inheritance graph
[legend]
Collaboration diagram for PieceSprite:

Collaboration graph
[legend]
List of all members.

Public Types

enum  MovementState { Idle, LinearMove }
 Possible animation states of the sprite. More...

Public Member Functions

 PieceSprite (QString id, ThemeManager *theme, int advancePeriod, int no, QGraphicsScene *canvas)
 Constructor for the sprite.
 ~PieceSprite ()
 Destructor.
virtual void advance (int phase)
 Standard QGI advance function.
virtual int type () const
 Retrieve the type of QGI.
virtual void changeTheme ()
 Standard Themable function.
SpriteNotifynotify ()
 Retrieve the sprite notification object.
void startLinear (QPointF end, double velocity)
 Start a linear movement from the current position to the given end position with the given velocity.
void startLinear (QPointF start, QPointF end, double velocity)
 Start a linear movement from the start point to the given end position with the given velocity.

Detailed Description

The sprite for a pixmap piece on the canvas.

The pixmap can be animated and moving.

Definition at line 37 of file piecesprite.h.


Member Enumeration Documentation

enum PieceSprite::MovementState
 

Possible animation states of the sprite.

Enumerator:
Idle 
LinearMove 

Definition at line 51 of file piecesprite.h.


Constructor & Destructor Documentation

PieceSprite::PieceSprite QString  id,
ThemeManager theme,
int  advancePeriod,
int  no,
QGraphicsScene *  canvas
 

Constructor for the sprite.

Definition at line 35 of file piecesprite.cpp.

References ThemeManager::updateTheme().

Here is the call graph for this function:

PieceSprite::~PieceSprite  ) 
 

Destructor.

Definition at line 43 of file piecesprite.cpp.


Member Function Documentation

void PieceSprite::advance int  phase  )  [virtual]
 

Standard QGI advance function.

Parameters:
phase The advance phase

Reimplemented from PixmapSprite.

Definition at line 88 of file piecesprite.cpp.

References PixmapSprite::advance(), SpriteNotify::emitSignal(), Themable::getScale(), Idle, LinearMove, PixmapSprite::mStart, and PixmapSprite::mTime.

Here is the call graph for this function:

void PieceSprite::changeTheme  )  [virtual]
 

Standard Themable function.

It is called when the theme item needs to completely refresh iteself.

Reimplemented from PixmapSprite.

Definition at line 49 of file piecesprite.cpp.

References PixmapSprite::changeTheme().

Here is the call graph for this function:

SpriteNotify* PieceSprite::notify  )  [inline]
 

Retrieve the sprite notification object.

This object indicates the end of a movement.

Returns:
The notification object.

Definition at line 72 of file piecesprite.h.

Referenced by DisplayGame::displayPiece().

void PieceSprite::startLinear QPointF  start,
QPointF  end,
double  velocity
 

Start a linear movement from the start point to the given end position with the given velocity.

Parameters:
start The start position in relative coordinates [rel 0..1, rel 0..1]
end The end position in relative coordinates [rel 0..1, rel 0..1]
velocity The velocity of the move in [relative units/sec.]

Definition at line 56 of file piecesprite.cpp.

References Themable::getScale(), LinearMove, PixmapSprite::mStart, and PixmapSprite::mTime.

Here is the call graph for this function:

void PieceSprite::startLinear QPointF  end,
double  velocity
 

Start a linear movement from the current position to the given end position with the given velocity.

Parameters:
end The end position in relative coordinates [rel 0..1, rel 0..1]
velocity The velocity of the move in [relative units/sec.]

Definition at line 73 of file piecesprite.cpp.

References Themable::getScale(), LinearMove, PixmapSprite::mStart, and PixmapSprite::mTime.

Referenced by DisplayGame::displayPiece().

Here is the call graph for this function:

virtual int PieceSprite::type  )  const [inline, virtual]
 

Retrieve the type of QGI.

This item is UserType+2

Returns:
The type of item.

Reimplemented from PixmapSprite.

Definition at line 61 of file piecesprite.h.


The documentation for this class was generated from the following files:
Generated on Sun Mar 4 10:56:43 2007 for KWin4 by  doxygen 1.4.6