Skip to content

Commit

Permalink
Fix build.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mysticial committed Dec 29, 2023
1 parent 88c6fee commit b6cff91
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Common/Cpp/Options/EditableTableOption.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class EditableTableOption_t : public EditableTableOption{
if constexpr (std::is_default_constructible_v<RowType>){
return std::unique_ptr<EditableTableRow>(new RowType());
}else{
return std::unique_ptr<EditableTableRow>(new RowType(this));
return std::unique_ptr<EditableTableRow>(new RowType(*this));
}
}
};
Expand Down
7 changes: 3 additions & 4 deletions Common/Cpp/Options/IntegerRangeOption.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@

#include "Common/Qt/Options/IntegerRangeWidget.h"

// REMOVE
#include <iostream>
using std::cout;
using std::endl;
//#include <iostream>
//using std::cout;
//using std::endl;

namespace PokemonAutomation{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ StatsHuntIvJudgeFilterRow::StatsHuntIvJudgeFilterRow(const StatsHuntMiscFeatureF
PA_ADD_OPTION(iv_spdef);
PA_ADD_OPTION(iv_speed);
}
StatsHuntIvJudgeFilterRow::StatsHuntIvJudgeFilterRow(const EditableTableOption* table)
: StatsHuntIvJudgeFilterRow(static_cast<const StatsHuntIvJudgeFilterTable&>(*table).feature_flags)
StatsHuntIvJudgeFilterRow::StatsHuntIvJudgeFilterRow(const EditableTableOption& table)
: StatsHuntIvJudgeFilterRow(static_cast<const StatsHuntIvJudgeFilterTable&>(table).feature_flags)
{}
StatsHuntIvJudgeFilterRow::StatsHuntIvJudgeFilterRow(const StatsHuntMiscFeatureFlags& feature_flags, StatsHuntShinyFilter p_shiny)
: StatsHuntIvJudgeFilterRow(feature_flags)
Expand Down Expand Up @@ -289,8 +289,8 @@ StatsHuntIvRangeFilterRow::StatsHuntIvRangeFilterRow(const StatsHuntMiscFeatureF
PA_ADD_OPTION(iv_spdef);
PA_ADD_OPTION(iv_speed);
}
StatsHuntIvRangeFilterRow::StatsHuntIvRangeFilterRow(const EditableTableOption* table)
: StatsHuntIvRangeFilterRow(static_cast<const StatsHuntIvJudgeFilterTable&>(*table).feature_flags)
StatsHuntIvRangeFilterRow::StatsHuntIvRangeFilterRow(const EditableTableOption& table)
: StatsHuntIvRangeFilterRow(static_cast<const StatsHuntIvJudgeFilterTable&>(table).feature_flags)
{}
std::unique_ptr<EditableTableRow> StatsHuntIvRangeFilterRow::clone() const{
std::unique_ptr<StatsHuntIvRangeFilterRow> ret(new StatsHuntIvRangeFilterRow(misc.feature_flags));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class StatsHuntIvJudgeFilterTable;
class StatsHuntIvJudgeFilterRow : public EditableTableRow{
public:
StatsHuntIvJudgeFilterRow(const StatsHuntMiscFeatureFlags& feature_flags);
StatsHuntIvJudgeFilterRow(const EditableTableOption* table);
StatsHuntIvJudgeFilterRow(const EditableTableOption& table);
StatsHuntIvJudgeFilterRow(const StatsHuntMiscFeatureFlags& feature_flags, StatsHuntShinyFilter p_shiny);
virtual std::unique_ptr<EditableTableRow> clone() const override;

Expand Down Expand Up @@ -134,11 +134,10 @@ class StatsHuntIvJudgeFilterTable : public EditableTableOption_t<StatsHuntIvJudg
extern const char* StatsHuntIvRangeFilterTable_Label_Regular;


class StatsHuntIvRangeFilterTable;
class StatsHuntIvRangeFilterRow : public EditableTableRow{
public:
StatsHuntIvRangeFilterRow(const StatsHuntMiscFeatureFlags& feature_flags);
StatsHuntIvRangeFilterRow(const EditableTableOption* table);
StatsHuntIvRangeFilterRow(const EditableTableOption& table);
virtual std::unique_ptr<EditableTableRow> clone() const override;

bool matches(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ std::string SinglesMoveEntry::to_str() const{
SinglesMoveTableRow::~SinglesMoveTableRow(){
type.remove_listener(*this);
}
SinglesMoveTableRow::SinglesMoveTableRow(bool p_trainer_battle)
: type(
p_trainer_battle ? singles_move_enum_database_trainer() : singles_move_enum_database_wild(),
SinglesMoveTableRow::SinglesMoveTableRow(bool trainer_battle)
: m_trainer_battle(trainer_battle)
, type(
trainer_battle ? singles_move_enum_database_trainer() : singles_move_enum_database_wild(),
LockMode::UNLOCK_WHILE_RUNNING,
SinglesMoveType::Move1
)
Expand All @@ -72,8 +73,11 @@ SinglesMoveTableRow::SinglesMoveTableRow(bool p_trainer_battle)
SinglesMoveTableRow::value_changed();
type.add_listener(*this);
}
SinglesMoveTableRow::SinglesMoveTableRow(const EditableTableOption& table)
: SinglesMoveTableRow(static_cast<const SinglesMoveTable&>(table).m_trainer_battle)
{}
std::unique_ptr<EditableTableRow> SinglesMoveTableRow::clone() const{
std::unique_ptr<SinglesMoveTableRow> ret(new SinglesMoveTableRow(trainer_battle));
std::unique_ptr<SinglesMoveTableRow> ret(new SinglesMoveTableRow(m_trainer_battle));
ret->type.set(type);
ret->terastallize = (bool)terastallize;
ret->notes.set(notes);
Expand All @@ -100,7 +104,7 @@ SinglesMoveTable::SinglesMoveTable(std::string label, bool trainer_battle)
"Changes to this table take effect on the next battle.",
#endif
LockMode::UNLOCK_WHILE_RUNNING,
make_defaults(trainer_battle)
make_defaults()
)
{}

Expand All @@ -114,9 +118,9 @@ std::vector<std::string> SinglesMoveTable::make_header() const{
"Notes",
};
}
std::vector<std::unique_ptr<EditableTableRow>> SinglesMoveTable::make_defaults(bool trainer_battle){
std::vector<std::unique_ptr<EditableTableRow>> SinglesMoveTable::make_defaults(){
std::vector<std::unique_ptr<EditableTableRow>> ret;
ret.emplace_back(new SinglesMoveTableRow(trainer_battle));
ret.emplace_back(new SinglesMoveTableRow(*this));
return ret;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ struct SinglesMoveEntry{
};



class SinglesMoveTableRow : public EditableTableRow, public ConfigOption::Listener{
public:
~SinglesMoveTableRow();
SinglesMoveTableRow(bool p_trainer_battle);
SinglesMoveTableRow(bool trainer_battle);
SinglesMoveTableRow(const EditableTableOption& table);
virtual std::unique_ptr<EditableTableRow> clone() const override;

SinglesMoveEntry snapshot() const;
Expand All @@ -48,7 +50,7 @@ class SinglesMoveTableRow : public EditableTableRow, public ConfigOption::Listen
virtual void value_changed() override;

private:
bool trainer_battle;
const bool m_trainer_battle;
EnumDropdownCell<SinglesMoveType> type;
BooleanCheckBoxCell terastallize;
StringCell notes;
Expand All @@ -63,7 +65,12 @@ class SinglesMoveTable : public EditableTableOption_t<SinglesMoveTableRow>{

virtual std::vector<std::string> make_header() const;

static std::vector<std::unique_ptr<EditableTableRow>> make_defaults(bool trainer_battle);
std::vector<std::unique_ptr<EditableTableRow>> make_defaults();

private:
friend class SinglesMoveTableRow;

bool m_trainer_battle;
};


Expand Down

0 comments on commit b6cff91

Please sign in to comment.