Skip to content

Commit

Permalink
Add bool option setter
Browse files Browse the repository at this point in the history
  • Loading branch information
xuvatilavv committed Feb 25, 2022
1 parent fe32f3f commit b80db36
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,16 @@ void options_manager::cOpt::setValue( int iSetIn )
}
}

//set value
void options_manager::cOpt::setValue( bool bSetIn )
{
if( sType != "bool" ) {
debugmsg( "tried to set a bool value to a %s option", sType );
return;
}
bSet = bSetIn;
}

//set value
void options_manager::cOpt::setValue( const std::string &sSetIn )
{
Expand Down
1 change: 1 addition & 0 deletions src/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ class options_manager
void setValue( const std::string &sSetIn );
void setValue( float fSetIn );
void setValue( int iSetIn );
void setValue( bool bSetIn );

template<typename T>
T value_as() const;
Expand Down

0 comments on commit b80db36

Please sign in to comment.