mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-30 15:30:28 +01:00
refactor(sonar): declare non-mutating member functions const (cpp:S5817)
Virtual functions are left untouched so overrides keep matching.
This commit is contained in:
@@ -854,7 +854,7 @@ command_queue::pop( command_data &Command, uint32_t const Recipient ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool command_queue::is_network_target(uint32_t const Recipient) {
|
||||
bool command_queue::is_network_target(uint32_t const Recipient) const {
|
||||
const command_target target = (command_target)(Recipient & ~0xffff);
|
||||
|
||||
if (target == command_target::entity)
|
||||
|
||||
@@ -469,7 +469,7 @@ public:
|
||||
update();
|
||||
// checks if given command must be scheduled on server
|
||||
bool
|
||||
is_network_target(const uint32_t Recipient);
|
||||
is_network_target(const uint32_t Recipient) const;
|
||||
|
||||
// pops commands from intercept queue
|
||||
commands_map pop_intercept_queue();
|
||||
|
||||
@@ -1116,7 +1116,7 @@ drivermouse_input::default_bindings() {
|
||||
}
|
||||
|
||||
user_command
|
||||
drivermouse_input::adjust_command( user_command Command ) {
|
||||
drivermouse_input::adjust_command( user_command Command ) const {
|
||||
|
||||
if( true == Global.shiftState
|
||||
&& Command != user_command::none ) {
|
||||
|
||||
@@ -91,7 +91,7 @@ private:
|
||||
default_bindings();
|
||||
// potentially replaces supplied command with a more relevant one
|
||||
user_command
|
||||
adjust_command( user_command Command );
|
||||
adjust_command( user_command Command ) const;
|
||||
|
||||
// members
|
||||
command_relay m_relay;
|
||||
|
||||
@@ -125,7 +125,7 @@ gamepad_input::poll() {
|
||||
}
|
||||
|
||||
void
|
||||
gamepad_input::bind( std::vector< std::reference_wrapper<user_command> > &Targets, cParser &Input, std::unordered_map<std::string, user_command> const &Translator, std::string const Point ) {
|
||||
gamepad_input::bind( std::vector< std::reference_wrapper<user_command> > &Targets, cParser &Input, std::unordered_map<std::string, user_command> const &Translator, std::string const Point ) const {
|
||||
|
||||
for( auto &bindingtarget : Targets ) {
|
||||
// grab command(s) associated with the input pin
|
||||
|
||||
@@ -77,7 +77,7 @@ private:
|
||||
using inputaxis_sequence = std::vector<input_axis>;
|
||||
// methods
|
||||
bool recall_bindings();
|
||||
void bind( std::vector< std::reference_wrapper<user_command> > &Targets, cParser &Input, std::unordered_map<std::string, user_command> const &Translator, std::string const Point );
|
||||
void bind( std::vector< std::reference_wrapper<user_command> > &Targets, cParser &Input, std::unordered_map<std::string, user_command> const &Translator, std::string const Point ) const;
|
||||
void on_button( int const Button, int const Action );
|
||||
void process_axes();
|
||||
|
||||
|
||||
@@ -225,7 +225,7 @@ keyboard_input::recall_bindings() {
|
||||
return true;
|
||||
}
|
||||
|
||||
void keyboard_input::dump_bindings()
|
||||
void keyboard_input::dump_bindings() const
|
||||
{
|
||||
std::fstream stream("eu07_input-keyboard.ini",
|
||||
std::ios_base::binary | std::ios_base::trunc | std::ios_base::out);
|
||||
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
std::string
|
||||
binding_hint( user_command const Command ) const;
|
||||
void
|
||||
dump_bindings();
|
||||
dump_bindings() const;
|
||||
|
||||
// members
|
||||
static std::unordered_map<int, std::string> keytonamemap;
|
||||
|
||||
Reference in New Issue
Block a user