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

kapman

  • sources
  • kde-4.14
  • kdegames
  • kapman
elementitem.h
Go to the documentation of this file.
1 /*
2  * Copyright 2007-2008 Thomas Gallinari <tg8187@yahoo.fr>
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of
7  * the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef ELEMENTITEM_H
19 #define ELEMENTITEM_H
20 
21 #include <QGraphicsSvgItem>
22 
23 #include "element.h"
24 
28 class ElementItem : public QGraphicsSvgItem {
29 
30  Q_OBJECT
31 
32  private:
34  QGraphicsTextItem* m_pointsToDisplay;
35 
36  protected:
37 
39  Element* m_model;
40 
41  public:
42 
47  ElementItem(Element* p_model);
48 
52  ~ElementItem();
53 
58  Element* getModel() const;
59 
63  QPainterPath shape() const;
64 
65  public slots:
66 
72  virtual void update(qreal p_x, qreal p_y);
73 };
74 
75 #endif
76 
element.h
ElementItem::update
virtual void update(qreal p_x, qreal p_y)
Updates the ElementItem coordinates.
Definition: elementitem.cpp:45
ElementItem::~ElementItem
~ElementItem()
Deletes the ElementItem instance.
Definition: elementitem.cpp:30
ElementItem::getModel
Element * getModel() const
Gets the Element model.
Definition: elementitem.cpp:35
ElementItem::m_model
Element * m_model
The instance of Element the ElementItem will represent.
Definition: elementitem.h:39
QGraphicsTextItem
ElementItem
This class is the graphical representation of a game Element.
Definition: elementitem.h:28
Element
This class describes the common characteristics and behaviour of any game Element (character or item)...
Definition: element.h:30
QGraphicsSvgItem
QPainterPath
ElementItem::shape
QPainterPath shape() const
Reimplement QGraphicsItem::shape() to return an ellipse to improve collisions.
Definition: elementitem.cpp:39
ElementItem::ElementItem
ElementItem(Element *p_model)
Creates a new ElementItem instance.
Definition: elementitem.cpp:20
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:15 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kapman

Skip menu "kapman"
  • 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