1 | // Copyright (C) 2016 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef GROUPGOALAFFECTOR_H |
5 | #define GROUPGOALAFFECTOR_H |
6 | |
7 | // |
8 | // W A R N I N G |
9 | // ------------- |
10 | // |
11 | // This file is not part of the Qt API. It exists purely as an |
12 | // implementation detail. This header file may change from version to |
13 | // version without notice, or even be removed. |
14 | // |
15 | // We mean it. |
16 | // |
17 | #include "qquickparticleaffector_p.h" |
18 | |
19 | QT_BEGIN_NAMESPACE |
20 | |
21 | class QQuickStochasticEngine; |
22 | |
23 | class Q_QUICKPARTICLES_PRIVATE_EXPORT QQuickGroupGoalAffector : public QQuickParticleAffector |
24 | { |
25 | Q_OBJECT |
26 | Q_PROPERTY(QString goalState READ goalState WRITE setGoalState NOTIFY goalStateChanged FINAL) |
27 | Q_PROPERTY(bool jump READ jump WRITE setJump NOTIFY jumpChanged FINAL) |
28 | QML_NAMED_ELEMENT(GroupGoal) |
29 | QML_ADDED_IN_VERSION(2, 0) |
30 | public: |
31 | explicit QQuickGroupGoalAffector(QQuickItem *parent = nullptr); |
32 | |
33 | QString goalState() const |
34 | { |
35 | return m_goalState; |
36 | } |
37 | |
38 | bool jump() const |
39 | { |
40 | return m_jump; |
41 | } |
42 | |
43 | protected: |
44 | bool affectParticle(QQuickParticleData *d, qreal dt) override; |
45 | |
46 | Q_SIGNALS: |
47 | |
48 | void goalStateChanged(const QString &arg); |
49 | |
50 | void jumpChanged(bool arg); |
51 | |
52 | public Q_SLOTS: |
53 | |
54 | void setGoalState(const QString &arg); |
55 | |
56 | void setJump(bool arg) |
57 | { |
58 | if (m_jump != arg) { |
59 | m_jump = arg; |
60 | Q_EMIT jumpChanged(arg); |
61 | } |
62 | } |
63 | |
64 | private: |
65 | QString m_goalState; |
66 | bool m_jump; |
67 | }; |
68 | |
69 | QT_END_NAMESPACE |
70 | |
71 | #endif // GROUPGOALAFFECTOR_H |
72 |