1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-25 16:31:42 +00:00

Improves constness of Joystick interface.

This commit is contained in:
Thomas Harte 2020-05-12 00:19:48 -04:00
parent 8596a9826f
commit b62ee33318

View File

@ -98,7 +98,7 @@ class Joystick {
};
/// @returns The list of all inputs defined on this joystick.
virtual std::vector<Input> &get_inputs() = 0;
virtual const std::vector<Input> &get_inputs() = 0;
/*!
Sets the digital value of @c input. This may have direct effect or
@ -170,7 +170,7 @@ class ConcreteJoystick: public Joystick {
}
}
std::vector<Input> &get_inputs() final {
const std::vector<Input> &get_inputs() final {
return inputs_;
}
@ -223,7 +223,7 @@ class ConcreteJoystick: public Joystick {
}
private:
std::vector<Input> inputs_;
const std::vector<Input> inputs_;
enum class StickType {
Digital,