Logo Search packages:      
Sourcecode: tagua version File versions  Download package

Board Class Reference

#include <board.h>

Inheritance diagram for Board:

List of all members.


Detailed Description

Board visualization class.

This class is a KGameCanvasItem that displaying a board filled with pieces. You can set custom tags for each square.

See also:
Table,

PiecePool,

Sprite

Definition at line 48 of file board.h.


Public Types

typedef Grid< NamedSprite > PieceGrid

Signals

void error (ErrorCode code)

Public Member Functions

boost::shared_ptr
< KGameCanvasPixmap > 
addTag (const QString &name, Point at, bool over=false)
void adjustSprite (const Point &p, bool immediate=false)
 Board (const AnimationSettings &animSettings, KGameCanvasAbstract *parent)
QRect boardRect ()
void cancelPremove ()
void cancelSelection ()
void clearTags ()
void clearTags (const QString &name)
PixmapLoadercontrolsLoader ()
const PointConverter * converter () const
PointConverter * converter ()
void createGrid (Point p, const QStringList &border_coords)
void draggingOn (int pool, int index, const QPoint &p)
bool dropOn (int pool, int index, const QPoint &point)
void enqueue (const boost::shared_ptr< Animation > &)
void flip ()
void flip (bool flipped)
bool flipped () const
Point gridSize () const
const PixmapLoaderloader () const
PixmapLoaderloader ()
QPixmap loadSprite (const QString &id)
virtual void onMouseEnter ()
virtual void onMouseLeave ()
virtual void onMouseMove (const QPoint &pos, int button)
virtual void onMousePress (const QPoint &pos, int button)
virtual void onMouseRelease (const QPoint &pos, int button)
virtual void onPositionChanged ()
virtual void onResize (int new_size, int border_size, int border_text_near, int border_text_far, bool force_reload=false)
KGameCanvasAbstract * piecesGroup ()
void reset ()
void setEntity (const boost::shared_ptr< UserEntity > &entity)
void setTags (const QString &name, Point p1=Point::invalid(), Point p2=Point::invalid(), Point p3=Point::invalid(), Point p4=Point::invalid(), Point p5=Point::invalid(), Point p6=Point::invalid())
virtual void settingsChanged ()
int squareSize () const
PixmapLoadertagsLoader ()

Protected Member Functions

virtual Point flipPoint (const Point &p) const
virtual Point toLogical (const QPoint &real) const
virtual QPoint toReal (const Point &logical) const

Private Types

typedef boost::shared_ptr
< DragInfo > 
DragInfoPtr

Private Member Functions

QRect computeRect (Point) const
QRegion computeRegion (Point) const
bool doMove (const NormalUserMove &)
void recreateBorder ()
void setPremove (const class Premove &move)
void setPremove (const DropUserMove &move)
void setPremove (const NormalUserMove &move)
void setSelection (const Point &p)
QRect squareRect (int x, int y) const
void updateBackground ()
void updateBorder ()
void updateHinting (Point pt, AbstractPiece::Ptr piece)
void updatePremove ()
void updateSprites ()
void updateTags ()

Private Attributes

Point lastSelection
const AnimationSettings & m_anim_settings
QStringList m_border_coords
QFont m_border_font
int m_border_size
std::vector< ConstrainedText * > m_border_text
QColor m_border_text_color
int m_border_text_far
int m_border_text_near
KGameCanvasGroup * m_canvas_background
KGameCanvasGroup * m_canvas_border
KGameCanvasGroup * m_canvas_border_text
PixmapLoader m_controls_loader
DragInfoPtr m_drag_info
int m_dropped_index
int m_dropped_pool
boost::weak_ptr< UserEntity > m_entity
bool m_flipped
NamedSprite m_hinting
Point m_hinting_pos
PixmapLoader m_loader
MainAnimationm_main_animation
KGameCanvasGroup * m_pieces_group
Point m_premove_from
Point m_premove_to
PieceGrid m_sprites
int m_square_size
BoardTagsPtr m_tags
PixmapLoader m_tags_loader
Point selection

Friends

class GraphicalSystem
class PiecePool

Classes

class  DragInfo

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index