Skip to content

Conversation

@c-poole
Copy link
Contributor

@c-poole c-poole commented Jun 12, 2024

Adds a third filter class DaycareFilter that each of the egg tabs now use, which has the option to ignore inherited stats for the purposes of filtering the results.

The primary utility I see for this feature is to make it so that searches for targets do not explicitly depend on the provided values of the parent IVs and instead provides a blueprint for what the parent IVs need to be to match the filters. This allows for a workflow pattern of identifying a target -> identifying parent targets to allow you to hit said target -> getting target parents/egg. This flexibility specifically allows for finding parent targets where you don't need to engineer both parents to have identical IV spreads to what you want your target to have, or to find options when you don't need an exact set of 6IVs on the egg and therefore fixing the parents to specific stats could filter out possibilities.

It also has some utility in gen 3 where there is an incomplete enumeration of the possible VBlank signatures, and therefore even if the user provides all the correct information for an egg they produced, they may not get a hit on any of the provided methods.

@c-poole
Copy link
Contributor Author

c-poole commented Jul 11, 2024

Is this feature not desired? I personally often want to use the egg page as a way to both find egg targets but also identify what parents need to be to reach desired goals, which this facilitates better options for. It is an additional "thing for the user to think about" which may not be desired. Can definitely adjust implementation as needed if it is desired.

@Admiral-Fish
Copy link
Owner

I get side tracked easily. I'll try to look this weekend at this

Copy link
Owner

@Admiral-Fish Admiral-Fish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the formatting stuff will likely be fixed if you run clang format


for (int i = 0; i < 6; i++)
{

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove space


for (int i = 0; i < 6; i++)
{

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove space

Comment on lines +261 to +262


Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spaces

class DaycareFilter : public StateFilter
{
public:

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove space

#include <Core/Global.hpp>
#include <array>


Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove space

/**
* @brief Enum that lists the different Filter types
*/
enum filter_types
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enum class FilterTypes

Might be worth putting this in its own header like Controls.hpp

Comment on lines +39 to +41
FILTER_STATE_FILTER = 0,
FILTER_WILD_FILTER = 1,
FILTER_DAYCARE_FILTER = 2
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Static,
Wild,
Daycare

* @return Filter object
*/
template <class FilterType, bool wild = false>
template <class FilterType, u16 type>
Copy link
Owner

@Admiral-Fish Admiral-Fish Jul 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FilterTypes type

if constexpr (wild)
{

if constexpr(type == 1){
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type == FilterType::Wild

}
else
{
else if constexpr(type == 2){
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type == FilterType::Daycare

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants