Overte C++ Documentation
ScriptConditional.h
1 //
2 // Created by Bradley Austin Davis 2015/10/20
3 // Copyright 2015 High Fidelity, Inc.
4 // Copyright 2023 Overte e.V.
5 //
6 // Distributed under the Apache License, Version 2.0.
7 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
8 // SPDX-License-Identifier: Apache-2.0
9 //
10 
11 #pragma once
12 #ifndef hifi_Controllers_ScriptConditional_h
13 #define hifi_Controllers_ScriptConditional_h
14 
15 #include <QtCore/QObject>
16 #include <ScriptValue.h>
17 
18 #include "../Conditional.h"
19 
20 namespace controller {
21 
22 class ScriptConditional : public QObject, public Conditional {
23  Q_OBJECT;
24 public:
25  ScriptConditional(const ScriptValue& callable) : _callable(callable) {}
26  virtual bool satisfied() override;
27 protected:
28  Q_INVOKABLE void updateValue();
29 private:
30  ScriptValue _callable;
31  bool _lastValue { false };
32 };
33 
34 }
35 #endif
[ScriptInterface] Provides an engine-independent interface for QScriptValue
Definition: ScriptValue.h:40