Comments.

Took 23 minutes
This commit is contained in:
Lukas Brübach 2026-05-18 18:32:46 +02:00
parent e31e7a7425
commit 3730b3ea06
2 changed files with 36 additions and 36 deletions

View file

@ -22,13 +22,13 @@ void CardState::setZone(CardZoneLogic *_zone)
emit stateChanged(); emit stateChanged();
} }
void CardState::setAttacking(bool v) void CardState::setAttacking(bool _attacking)
{ {
if (attacking == v) { if (attacking == _attacking) {
return; return;
} }
attacking = v; attacking = _attacking;
emit attackingChanged(v); emit attackingChanged(_attacking);
emit stateChanged(); emit stateChanged();
} }
@ -59,53 +59,53 @@ void CardState::clearCounters()
emit stateChanged(); emit stateChanged();
} }
void CardState::setAnnotation(const QString &a) void CardState::setAnnotation(const QString &_annotation)
{ {
if (annotation == a) { if (annotation == _annotation) {
return; return;
} }
annotation = a; annotation = _annotation;
emit annotationChanged(annotation); emit annotationChanged(annotation);
emit stateChanged(); emit stateChanged();
} }
void CardState::setPT(const QString &v) void CardState::setPT(const QString &_pt)
{ {
if (pt == v) { if (pt == _pt) {
return; return;
} }
pt = v; pt = _pt;
emit ptChanged(pt); emit ptChanged(pt);
emit stateChanged(); emit stateChanged();
} }
void CardState::setDoesntUntap(bool v) void CardState::setDoesntUntap(bool _doesntUntap)
{ {
if (doesntUntap == v) { if (doesntUntap == _doesntUntap) {
return; return;
} }
doesntUntap = v; doesntUntap = _doesntUntap;
emit doesntUntapChanged(v); emit doesntUntapChanged(_doesntUntap);
emit stateChanged(); emit stateChanged();
} }
void CardState::setDestroyOnZoneChange(bool v) void CardState::setDestroyOnZoneChange(bool _destroyOnZoneChange)
{ {
if (destroyOnZoneChange == v) { if (destroyOnZoneChange == _destroyOnZoneChange) {
return; return;
} }
destroyOnZoneChange = v; destroyOnZoneChange = _destroyOnZoneChange;
emit destroyOnZoneChangeChanged(v); emit destroyOnZoneChangeChanged(_destroyOnZoneChange);
emit stateChanged(); emit stateChanged();
} }
void CardState::setAttachedTo(CardItem *c) void CardState::setAttachedTo(CardItem *_attachedTo)
{ {
if (attachedTo == c) { if (attachedTo == _attachedTo) {
return; return;
} }
attachedTo = c; attachedTo = _attachedTo;
emit attachedToChanged(c); emit attachedToChanged(_attachedTo);
emit stateChanged(); emit stateChanged();
} }

View file

@ -24,14 +24,14 @@ private:
signals: signals:
void stateChanged(); void stateChanged();
void attackingChanged(bool); void attackingChanged(bool newValue);
void countersChanged(QMap<int, int>); void countersChanged(const QMap<int, int> &newCounters);
void annotationChanged(QString); void annotationChanged(const QString &newAnnotation);
void ptChanged(QString); void ptChanged(const QString &newPt);
void doesntUntapChanged(bool); void doesntUntapChanged(bool newValue);
void destroyOnZoneChangeChanged(bool); void destroyOnZoneChangeChanged(bool newValue);
void attachedToChanged(CardItem *); void attachedToChanged(CardItem *newAttachedTo);
void zoneChanged(CardZoneLogic *); void zoneChanged(CardZoneLogic *newZone);
public: public:
explicit CardState(QObject *parent, CardZoneLogic *_zone) : QObject(parent), zone(_zone) explicit CardState(QObject *parent, CardZoneLogic *_zone) : QObject(parent), zone(_zone)
@ -51,7 +51,7 @@ public:
{ {
return attacking; return attacking;
} }
void setAttacking(bool v); void setAttacking(bool _attacking);
const QMap<int, int> &getCounters() const const QMap<int, int> &getCounters() const
{ {
@ -69,35 +69,35 @@ public:
return annotation; return annotation;
} }
void setAnnotation(const QString &a); void setAnnotation(const QString &_annotation);
QString getPT() const QString getPT() const
{ {
return pt; return pt;
} }
void setPT(const QString &v); void setPT(const QString &_pt);
bool getDoesntUntap() const bool getDoesntUntap() const
{ {
return doesntUntap; return doesntUntap;
} }
void setDoesntUntap(bool v); void setDoesntUntap(bool _doesntUntap);
bool getDestroyOnZoneChange() const bool getDestroyOnZoneChange() const
{ {
return destroyOnZoneChange; return destroyOnZoneChange;
} }
void setDestroyOnZoneChange(bool v); void setDestroyOnZoneChange(bool _destroyOnZoneChange);
CardItem *getAttachedTo() const CardItem *getAttachedTo() const
{ {
return attachedTo; return attachedTo;
} }
void setAttachedTo(CardItem *c); void setAttachedTo(CardItem *_attachedTo);
}; };
#endif // COCKATRICE_CARD_STATE_H #endif // COCKATRICE_CARD_STATE_H