123456789101112131415161718192021222324252627 |
- #pragma once
- #include <unordered_map>
- #include "Input.hpp"
- template<typename T = int>
- class InputMap
- {
- public:
- InputMap(const InputMap& copy) = delete;
- InputMap<T>& operator=(const InputMap<T>& copy) = delete;
-
- InputMap() = default;
-
- void map(const T& key, const Input& input)
- {
- _map.emplace(key, input);
- }
- const Input& get(const T& key) const
- {
- return _map.at(key);
- }
- private:
- std::unordered_map<T, Input> _map;
- };
|