Overte C++ Documentation
EndpointConditional.h
1 //
2 // Created by Bradley Austin Davis 2015/10/20
3 // Copyright 2015 High Fidelity, Inc.
4 //
5 // Distributed under the Apache License, Version 2.0.
6 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
7 //
8 
9 #pragma once
10 #ifndef hifi_Controllers_EndpointConditional_h
11 #define hifi_Controllers_EndpointConditional_h
12 
13 #include "../Conditional.h"
14 #include "../Endpoint.h"
15 
16 namespace controller {
17 
18 class EndpointConditional : public Conditional {
19 public:
20  EndpointConditional(Endpoint::Pointer endpoint) : _endpoint(endpoint) {}
21  virtual bool satisfied() override { return _endpoint && _endpoint->peek().value != 0.0f; }
22 private:
23  Endpoint::Pointer _endpoint;
24 };
25 
26 }
27 #endif