Skip to content

Commit

Permalink
added comments to clarify the limited dictionary in MaterialNameReader
Browse files Browse the repository at this point in the history
  • Loading branch information
jw098 committed Jul 2, 2024
1 parent fff8c27 commit 54a378d
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ MaterialNameReader& MaterialNameReader::instance(){
return reader;
}


// MaterialNameReader has a very limited dictionary,
// so it can only reliably read the material names with 68% value
// (i.e. Ditto Goo, Happiny Dust, Magby Hair, Beldum Claw)
MaterialNameReader::MaterialNameReader()
: SmallDictionaryMatcher("PokemonSV/ItemPrinterMaterialOCR.json")
{}
Expand Down Expand Up @@ -230,7 +232,7 @@ int8_t ItemPrinterMaterialDetector::find_happiny_dust_row_num(
&& detect_material_name(console, context, value_68_row_num) == "happiny-dust"
){
// found screen and row number with Happiny dust.
std::cout << "Happiny dust found. Row number: " << std::to_string(value_68_row_num) << std::endl;
// std::cout << "Happiny dust found. Row number: " << std::to_string(value_68_row_num) << std::endl;
return value_68_row_num;
}
// keep searching for Happiny dust
Expand All @@ -245,6 +247,10 @@ int8_t ItemPrinterMaterialDetector::find_happiny_dust_row_num(

}

// detects the material name at the given row_num
// MaterialNameReader has a very limited dictionary,
// so it can only reliably read the material names with 68% value
// (i.e. Ditto Goo, Happiny Dust, Magby Hair, Beldum Claw)
std::string ItemPrinterMaterialDetector::detect_material_name(
ConsoleHandle& console,
BotBaseContext& context,
Expand Down

0 comments on commit 54a378d

Please sign in to comment.