mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-04 04:23:55 -07:00
* [Game][Arrows] Split Arrows into ArrowData and ArrowItem Took 13 minutes Took 5 seconds Took 1 minute Took 26 seconds * Address comments. Took 17 minutes Took 9 seconds Took 1 minute * Change check. Took 3 minutes * Pass by const reference. Took 10 minutes * Remove extra method Took 2 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
23 lines
No EOL
605 B
C++
23 lines
No EOL
605 B
C++
#include "arrow_target.h"
|
|
|
|
#include "../player/player_logic.h"
|
|
#include "arrow_item.h"
|
|
|
|
ArrowTarget::ArrowTarget(PlayerLogic *_owner, QGraphicsItem *parent) : AbstractGraphicsItem(parent), owner(_owner)
|
|
{
|
|
setFlag(ItemSendsScenePositionChanges);
|
|
}
|
|
|
|
void ArrowTarget::setBeingPointedAt(bool _beingPointedAt)
|
|
{
|
|
beingPointedAt = _beingPointedAt;
|
|
update();
|
|
}
|
|
|
|
QVariant ArrowTarget::itemChange(GraphicsItemChange change, const QVariant &value)
|
|
{
|
|
if (change == ItemScenePositionHasChanged) {
|
|
emit scenePositionChanged();
|
|
}
|
|
return AbstractGraphicsItem::itemChange(change, value);
|
|
} |