Skip to content

Commit

Permalink
Restore a couple more consts; cleanup header.
Browse files Browse the repository at this point in the history
  • Loading branch information
Malkierian committed Nov 29, 2024
1 parent bf682fe commit a055d8f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
4 changes: 2 additions & 2 deletions soh/soh/Enhancements/randomizer/option.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Option Option::LogicTrick(std::string name_) {
"", WidgetType::Checkbox, 0, false, IMFLAG_NONE);
}

Option::operator bool() {
Option::operator bool() const {
return contextSelection != 0;
}

Expand Down Expand Up @@ -70,7 +70,7 @@ void Option::SetVariable() {
}
}

void Option::SetCVar() {
void Option::SetCVar() const {
if (!cvarName.empty()) {
CVarSetInteger(cvarName.c_str(), GetMenuOptionIndex());
}
Expand Down
16 changes: 2 additions & 14 deletions soh/soh/Enhancements/randomizer/option.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,20 +126,9 @@ class Option {
*/
static Option LogicTrick(std::string name_);

/**
* @brief Gets the selected index or boolean value of the Option.
*
* @tparam T uint8_t or bool, depending on how the option was constructed.
* @return T
*/
//template <typename T> T Value() {
// return std::get<T>(var);
//}

/**
* @brief Determines if the value/selected index of this Option matches the provided value.
*
* @tparam T uint8_t, bool, or an enum (which will be cast to uint8_t).
* @param other The value to compare.
* @return true
* @return false
Expand All @@ -151,7 +140,6 @@ class Option {
/**
* @brief Determines if the value/selected index of this Option does not match the provided value.
*
* @tparam T uint8_t, book, or an enum (which will be cast to uint8_t).
* @param other The value to compare.
* @return true
* @return false
Expand All @@ -166,7 +154,7 @@ class Option {
* @return true
* @return false
*/
explicit operator bool();
explicit operator bool() const;

/**
* @brief Get the size of the options array.
Expand Down Expand Up @@ -220,7 +208,7 @@ class Option {
* @brief Sets the CVar corresponding to the property `cvarName` equal to the value
* of the property `selectedValue`.
*/
void SetCVar();
void SetCVar() const;

/**
* @brief Sets the value of property `selectedValue` equal to the CVar corresponding
Expand Down

0 comments on commit a055d8f

Please sign in to comment.