| 1 | // tCompButton.h  |
| 2 | //  |
| 3 | // This file implements a button input component. Components are input classes that are grouped together  |
| 4 | // in a device.  |
| 5 | //  |
| 6 | // Copyright (c) 2025 Tristan Grimmer.  |
| 7 | // Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby  |
| 8 | // granted, provided that the above copyright notice and this permission notice appear in all copies.  |
| 9 | //  |
| 10 | // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL  |
| 11 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,  |
| 12 | // INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN  |
| 13 | // AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR  |
| 14 | // PERFORMANCE OF THIS SOFTWARE.  |
| 15 |   |
| 16 | #pragma once  |
| 17 | #include "Input/tComp.h"  |
| 18 | #include "Input/tUnitDiscreteBool.h"  |
| 19 | namespace tInput  |
| 20 | {  |
| 21 |   |
| 22 |   |
| 23 | class tCompButton : public tComponent  |
| 24 | {  |
| 25 | public:  |
| 26 | tCompButton(const tName& name, std::mutex& mutex) :  |
| 27 | tComponent(name),  |
| 28 | InitUnit(State) { }  |
| 29 | virtual ~tCompButton() { }  |
| 30 |   |
| 31 | void Update() { }  |
| 32 |   |
| 33 | private:  |
| 34 | // These are private because they need to be mutex-protected. Use the accessors.  |
| 35 | tUnitDiscreteBool State;  |
| 36 | };  |
| 37 |   |
| 38 |   |
| 39 | }  |
| 40 | |