Cockatrice 2026-09-01-Development-3.1.0-beta.10
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
ArrowItem Class Reference

#include <arrow_item.h>

Inheritance diagram for ArrowItem:
[legend]
Collaboration diagram for ArrowItem:
[legend]

Public Types

enum  { Type = typeArrow }

Signals

void requestDeletion (int creatorId, int id)

Public Member Functions

int type () const override
 ArrowItem (QSharedPointer< const ArrowData > _data, ArrowTarget *_startItem, ArrowTarget *_targetItem)
 ~ArrowItem () override
void onTargetDestroyed ()
void delArrow ()
void updatePath ()
void updatePath (const QPointF &endPoint)
void startDrawAnimation ()
bool animationEvent () override
 Advances the item's animation by one timer tick.
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
QRectF boundingRect () const override
QPainterPath shape () const override
int getId () const
int getCreatorId () const
ArrowTargetgetStartItem () const
ArrowTargetgetTargetItem () const
void setTargetLocked (bool _targetLocked)
Public Member Functions inherited from IAnimatedItem
virtual ~IAnimatedItem ()=default

Protected Member Functions

void mousePressEvent (QGraphicsSceneMouseEvent *event) override

Protected Attributes

QSharedPointer< const ArrowDatadata
QPointer< ArrowTargetstartItem
QPointer< ArrowTargettargetItem
bool targetLocked = false
bool fullColor = true

Private Attributes

QPainterPath path
QPainterPath bodyPath
QPainterPath headPath
QPainterPath shaftOutlinePath
QPainterPath centerLine
qreal headBaseFraction = 1.0
QElapsedTimer animationClock
qreal strokeDurationMs = 0
qreal glowFadeDurationMs = 0
qreal drawProgress = 1.0
qreal glowAlpha = 0.0
bool animationStarted = false

Static Private Attributes

static constexpr qreal glowExtent = 12.0

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Type 

Constructor & Destructor Documentation

◆ ArrowItem()

ArrowItem::ArrowItem ( QSharedPointer< const ArrowData > _data,
ArrowTarget * _startItem,
ArrowTarget * _targetItem )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~ArrowItem()

ArrowItem::~ArrowItem ( )
override

Member Function Documentation

◆ animationEvent()

bool ArrowItem::animationEvent ( )
overridevirtual

Advances the item's animation by one timer tick.

Returns
true while the animation is still running, false once it has finished.

Implements IAnimatedItem.

◆ boundingRect()

QRectF ArrowItem::boundingRect ( ) const
inlinenodiscardoverride

◆ delArrow()

void ArrowItem::delArrow ( )
Here is the caller graph for this function:

◆ getCreatorId()

int ArrowItem::getCreatorId ( ) const
inlinenodiscard

◆ getId()

int ArrowItem::getId ( ) const
inlinenodiscard
Here is the caller graph for this function:

◆ getStartItem()

ArrowTarget * ArrowItem::getStartItem ( ) const
inlinenodiscard

◆ getTargetItem()

ArrowTarget * ArrowItem::getTargetItem ( ) const
inlinenodiscard

◆ mousePressEvent()

void ArrowItem::mousePressEvent ( QGraphicsSceneMouseEvent * event)
overrideprotected
Here is the call graph for this function:

◆ onTargetDestroyed()

void ArrowItem::onTargetDestroyed ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ paint()

void ArrowItem::paint ( QPainter * painter,
const QStyleOptionGraphicsItem * option,
QWidget * widget )
override

◆ requestDeletion

void ArrowItem::requestDeletion ( int creatorId,
int id )
signal
Here is the caller graph for this function:

◆ setTargetLocked()

void ArrowItem::setTargetLocked ( bool _targetLocked)
inline

◆ shape()

QPainterPath ArrowItem::shape ( ) const
inlinenodiscardoverride

◆ startDrawAnimation()

void ArrowItem::startDrawAnimation ( )
Here is the call graph for this function:

◆ type()

int ArrowItem::type ( ) const
inlinenodiscardoverride

◆ updatePath() [1/2]

void ArrowItem::updatePath ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updatePath() [2/2]

void ArrowItem::updatePath ( const QPointF & endPoint)

Member Data Documentation

◆ animationClock

QElapsedTimer ArrowItem::animationClock
private

◆ animationStarted

bool ArrowItem::animationStarted = false
private

◆ bodyPath

QPainterPath ArrowItem::bodyPath
private

◆ centerLine

QPainterPath ArrowItem::centerLine
private

◆ data

QSharedPointer<const ArrowData> ArrowItem::data
protected

◆ drawProgress

qreal ArrowItem::drawProgress = 1.0
private

◆ fullColor

bool ArrowItem::fullColor = true
protected

◆ glowAlpha

qreal ArrowItem::glowAlpha = 0.0
private

◆ glowExtent

qreal ArrowItem::glowExtent = 12.0
staticconstexprprivate

◆ glowFadeDurationMs

qreal ArrowItem::glowFadeDurationMs = 0
private

◆ headBaseFraction

qreal ArrowItem::headBaseFraction = 1.0
private

◆ headPath

QPainterPath ArrowItem::headPath
private

◆ path

QPainterPath ArrowItem::path
private

◆ shaftOutlinePath

QPainterPath ArrowItem::shaftOutlinePath
private

◆ startItem

QPointer<ArrowTarget> ArrowItem::startItem
protected

◆ strokeDurationMs

qreal ArrowItem::strokeDurationMs = 0
private

◆ targetItem

QPointer<ArrowTarget> ArrowItem::targetItem
protected

◆ targetLocked

bool ArrowItem::targetLocked = false
protected

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