Cleanup input stuff
This commit is contained in:
48
openVulkanoCpp/Input/BaseInputAction.hpp
Normal file
48
openVulkanoCpp/Input/BaseInputAction.hpp
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace OpenVulkano::Input
|
||||
{
|
||||
class InputDevice;
|
||||
|
||||
class BaseInputAction
|
||||
{
|
||||
std::string m_name;
|
||||
std::vector<InputDevice*> m_devices;
|
||||
bool m_enabled;
|
||||
|
||||
protected:
|
||||
BaseInputAction(const std::string& name) : m_name(name), m_enabled(true) {}
|
||||
|
||||
public:
|
||||
virtual ~BaseInputAction() = default;
|
||||
|
||||
[[nodiscard]] const std::string& GetName() const
|
||||
{
|
||||
return m_name;
|
||||
}
|
||||
|
||||
[[nodiscard]] const std::vector<InputDevice*>& GetDevices() const
|
||||
{
|
||||
return m_devices;
|
||||
}
|
||||
|
||||
[[nodiscard]] bool IsEnabled() const
|
||||
{
|
||||
return m_enabled;
|
||||
}
|
||||
|
||||
void SetEnabled(bool enabled)
|
||||
{
|
||||
m_enabled = enabled;
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user