VoltAir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Groups Pages
MagneticHighlightLogic.h
1 /*
2  * Copyright (C) 2014 Google Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef MAGNETICHIGHLIGHTLOGIC_H
18 #define MAGNETICHIGHLIGHTLOGIC_H
19 
20 #include <Engine/Logic.h>
21 
38 class MagneticHighlightLogic : public Logic {
39  Q_OBJECT
40 
46 
47 public:
51  bool isInAttractorRange() const { return mInAttractorRange; }
56  void setInAttractorRange(bool value);
57 
65 
70  virtual void update() override;
71 
72 signals:
77 
78 private:
79  bool mInAttractorRange = false;
80  bool mMarkedInAttractorRange = false;
81 };
82 Q_DECLARE_METATYPE(MagneticHighlightLogic*)
83 
84 #endif // MAGNETICHIGHLIGHTLOGIC_H
bool isInAttractorRange() const
Returns inAttractorRange.
Definition: MagneticHighlightLogic.h:51
bool inAttractorRange
Whether or not there is currently an attractor within range of this actor.
Definition: MagneticHighlightLogic.h:45
void setInAttractorRange(bool value)
Sets inAttractorRange.
virtual void update() override
Performs latching of inAttractorRange in response to calls to notifyInAttractorRange().
void notifyInAttractorRange()
Marks this actor as having an attractor within range this frame.
Non-visual entities in the QML item tree that define behavior for their parent Actor.
Definition: Logic.h:31
void inAttractorRangeChanged()
Emitted when inAttractorRange has changed.
Class which mediates between magnetic attractors and magnet visual effects on target objects...
Definition: MagneticHighlightLogic.h:38