-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stats reset: turn 1 quickball, move table options
- Loading branch information
1 parent
81ff69e
commit 696e44a
Showing
5 changed files
with
264 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
SerialPrograms/Source/PokemonSV/Options/PokemonSV_BattleMoveTable.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* Battle Move Table | ||
* | ||
* From: https://github.com/PokemonAutomation/Arduino-Source | ||
* | ||
*/ | ||
|
||
#include "PokemonSV_BattleMoveTable.h" | ||
|
||
namespace PokemonAutomation{ | ||
namespace NintendoSwitch{ | ||
namespace PokemonSV{ | ||
|
||
const EnumDatabase<BattleMoveType>& Battle_move_enum_database(){ | ||
static EnumDatabase<BattleMoveType> database{ | ||
{BattleMoveType::Move1, "move1", "Move 1"}, | ||
{BattleMoveType::Move2, "move2", "Move 2"}, | ||
{BattleMoveType::Move3, "move3", "Move 3"}, | ||
{BattleMoveType::Move4, "move4", "Move 4"}, | ||
//{BattleMoveType::tera, "tera", "Tera"}, | ||
}; | ||
return database; | ||
} | ||
|
||
BattleMoveTableRow::BattleMoveTableRow() | ||
: type(Battle_move_enum_database(), LockWhileRunning::UNLOCKED, BattleMoveType::Move1) | ||
, notes(false, LockWhileRunning::UNLOCKED, "", "(e.g. False Swipe, Thunder Wave)") | ||
{ | ||
PA_ADD_OPTION(type); | ||
PA_ADD_OPTION(notes); | ||
} | ||
std::unique_ptr<EditableTableRow> BattleMoveTableRow::clone() const{ | ||
std::unique_ptr<BattleMoveTableRow> ret(new BattleMoveTableRow()); | ||
ret->type.set(type); | ||
ret->notes.set(notes); | ||
return ret; | ||
} | ||
|
||
BattleMoveTable::BattleMoveTable() | ||
: EditableTableOption_t<BattleMoveTableRow>( | ||
"<b>Move Table:</b><br>" | ||
"Run this sequence of moves for your lead Pokemon only. " | ||
"If your lead faints or the end of the table is reached, the program will switch to throwing the selected ball. ", | ||
LockWhileRunning::LOCKED, | ||
make_defaults() | ||
) | ||
{} | ||
|
||
std::vector<std::string> BattleMoveTable::make_header() const{ | ||
return { | ||
"Move", | ||
"Notes", | ||
}; | ||
} | ||
std::vector<std::unique_ptr<EditableTableRow>> BattleMoveTable::make_defaults(){ | ||
std::vector<std::unique_ptr<EditableTableRow>> ret; | ||
ret.emplace_back(new BattleMoveTableRow()); | ||
return ret; | ||
} | ||
|
||
|
||
} | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
SerialPrograms/Source/PokemonSV/Options/PokemonSV_BattleMoveTable.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* Battle Move Table | ||
* | ||
* From: https://github.com/PokemonAutomation/Arduino-Source | ||
* | ||
*/ | ||
|
||
#ifndef PokemonAutomation_PokemonSV_BattleMoveTable_H | ||
#define PokemonAutomation_PokemonSV_BattleMoveTable_H | ||
|
||
#include "Common/Cpp/Options/SimpleIntegerOption.h" | ||
#include "Common/Cpp/Options/StringOption.h" | ||
#include "Common/Cpp/Options/EnumDropdownOption.h" | ||
#include "Common/Cpp/Options/EditableTableOption.h" | ||
|
||
namespace PokemonAutomation{ | ||
namespace NintendoSwitch{ | ||
namespace PokemonSV{ | ||
|
||
|
||
enum class BattleMoveType{ | ||
Move1, | ||
Move2, | ||
Move3, | ||
Move4, | ||
}; | ||
const EnumDatabase<BattleMoveType>& Battle_move_enum_database(); | ||
|
||
class BattleMoveTableRow : public EditableTableRow{ | ||
public: | ||
BattleMoveTableRow(); | ||
virtual std::unique_ptr<EditableTableRow> clone() const override; | ||
|
||
public: | ||
EnumDropdownCell<BattleMoveType> type; | ||
StringCell notes; | ||
}; | ||
|
||
class BattleMoveTable : public EditableTableOption_t<BattleMoveTableRow>{ | ||
public: | ||
BattleMoveTable(); | ||
|
||
virtual std::vector<std::string> make_header() const; | ||
static std::vector<std::unique_ptr<EditableTableRow>> make_defaults(); | ||
}; | ||
|
||
|
||
} | ||
} | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters