gameboy_worlds.emulation.harry_potter.registry

  1from typing import Optional, Union, Type, Dict
  2from gameboy_worlds.emulation.parser import StateParser
  3from gameboy_worlds.emulation.tracker import StateTracker
  4from gameboy_worlds.emulation.emulator import Emulator
  5from gameboy_worlds.emulation.harry_potter.parsers import (
  6    HarryPotterPhilosophersStoneParser,
  7    HarryPotterChamberOfSecretsParser,
  8)
  9from gameboy_worlds.emulation.harry_potter.trackers import (
 10    PotionsShopTestTracker,
 11    EnterOllivandersTestTracker,
 12    GetWandTestTracker,
 13    ReceiveFolioMagiTestTracker,
 14    SelectCardDeckTestTracker,
 15    EnterGringottsTestTracker,
 16    TalkHagridGringottsTestTracker,
 17    ExitGringottsWithoutHagridTestTracker,
 18    GetOnTrainTestTracker,
 19    BuyChocolateFrogsTestTracker,
 20    SellOneChocolateFrogTestTracker,
 21    LoseDuelTestTracker,
 22    WinDuelTestTracker,
 23    GainLevelTestTracker,
 24    GainSpellTestTracker,
 25    WinBattleTestTracker,
 26    BeatBossRatTestTracker,
 27    FailRatKingBattleTestTracker,
 28    DefeatRatKingWithDeflectTestTracker,
 29    HarryPotterOCRTracker,
 30    FindHagridVaultTestTracker,
 31    EnterMalkinsTestTracker,
 32    OpenMalkinsBuyMenuTestTracker,
 33    SelectRobesTestTracker,
 34    ConfirmRobesPurchaseTestTracker,
 35    EnterFlourishBlottsTestTracker,
 36    BuyBooksTestTracker,
 37    EnterApothecaryTestTracker,
 38    BuyPotionKitTestTracker,
 39    EnterCauldronShopTestTracker,
 40    BuyCauldronTestTracker,
 41    EnterSugarplumsTestTracker,
 42    OpenSugarplumsBuyMenuTestTracker,
 43    WalkTrain3TimesTestTracker,
 44    TalkToHagridDiagonTestTracker,
 45    FindDobbyTestTracker,
 46    SelectCardDeckCosTestTracker,
 47    BoardFlyingCarTestTracker,
 48    EnterBurrowTestTracker,
 49    EnterBattleCosTestTracker,
 50    EnterPercyRoomTestTracker,
 51    EnterGinnyRoomTestTracker,
 52    EnterParentsRoomTestTracker,
 53    EnterFredGeorgeRoomTestTracker,
 54    EnterRonsRoomTestTracker,
 55    TalkToRonBurrowTestTracker,
 56    EnterKitchenBurrowTestTracker,
 57    EnterBurrowGardenTestTracker,
 58    NavigateToCarTestTracker,
 59    StartMenuTestTracker,
 60    EatPumpkinPastyTestTracker,
 61    EquipPointedHatPlainWorkRobeTestTracker,
 62    RemoveAllEquippedItemsTestTracker,
 63    TalkToHagridBoatTestTracker,
 64    DieTestTracker,
 65    FightRatThenMonsterTestTracker,
 66    FightBatThenMonsterMiddleTestTracker,
 67)
 68
 69GAME_TO_GB_NAME = {
 70    "harry_potter_philosophers_stone": "HarryPotterPhilosophersStone.gbc",
 71    "harry_potter_chamber_of_secrets": "HarryPotterChamberOfSecrets.gbc",
 72}
 73""" Expected save name for each game. Save the file to <storage_dir_from_config_file>/<game_name>_rom_data/<gb_name>"""
 74
 75STRONGEST_PARSERS: Dict[str, Type[StateParser]] = {
 76    "harry_potter_philosophers_stone": HarryPotterPhilosophersStoneParser,
 77    "harry_potter_chamber_of_secrets": HarryPotterChamberOfSecretsParser,
 78}
 79""" Mapping of game names to their corresponding strongest StateParser classes.
 80Unless you have a very good reason, you should always use the STRONGEST possible parser for a given game.
 81The parser itself does not affect performance, as for it to perform a read / screen comparison operation , it must be called upon by the state tracker.
 82This means there is never a reason to use a weaker parser.
 83"""
 84
 85
 86AVAILABLE_STATE_TRACKERS: Dict[str, Dict[str, Type[StateTracker]]] = {
 87    "harry_potter_philosophers_stone": {
 88        "default": HarryPotterOCRTracker,
 89        "ocr": HarryPotterOCRTracker,
 90        "potions_shop_test": PotionsShopTestTracker,
 91        "enter_ollivanders_test": EnterOllivandersTestTracker,
 92        "get_wand_test": GetWandTestTracker,
 93        "receive_folio_magi_test": ReceiveFolioMagiTestTracker,
 94        "select_card_deck_test": SelectCardDeckTestTracker,
 95        "enter_gringotts_test": EnterGringottsTestTracker,
 96        "talk_hagrid_gringotts_test": TalkHagridGringottsTestTracker,
 97        "exit_gringotts_without_hagrid_test": ExitGringottsWithoutHagridTestTracker,
 98        "get_on_train_test": GetOnTrainTestTracker,
 99        "buy_chocolate_frogs_test": BuyChocolateFrogsTestTracker,
100        "sell_one_chocolate_frog_test": SellOneChocolateFrogTestTracker,
101        "lose_duel_test": LoseDuelTestTracker,
102        "win_duel_test": WinDuelTestTracker,
103        "gain_level_test": GainLevelTestTracker,
104        "gain_spell_test": GainSpellTestTracker,
105        "win_battle_test": WinBattleTestTracker,
106        "beat_boss_rat_test": BeatBossRatTestTracker,
107        "fail_rat_king_battle": FailRatKingBattleTestTracker,
108        "defeat_rat_king_with_deflect_test": DefeatRatKingWithDeflectTestTracker,
109        "find_hagrid_vault_test": FindHagridVaultTestTracker,
110        "enter_malkins_test": EnterMalkinsTestTracker,
111        "open_malkins_buy_menu_test": OpenMalkinsBuyMenuTestTracker,
112        "select_robes_test": SelectRobesTestTracker,
113        "confirm_robes_purchase_test": ConfirmRobesPurchaseTestTracker,
114        "enter_flourish_blotts_test": EnterFlourishBlottsTestTracker,
115        "buy_books_test": BuyBooksTestTracker,
116        "enter_apothecary_test": EnterApothecaryTestTracker,
117        "buy_potion_kit_test": BuyPotionKitTestTracker,
118        "enter_cauldron_shop_test": EnterCauldronShopTestTracker,
119        "buy_cauldron_test": BuyCauldronTestTracker,
120        "enter_sugarplums_test": EnterSugarplumsTestTracker,
121        "open_sugarplums_buy_menu_test": OpenSugarplumsBuyMenuTestTracker,
122        "walk_train_3_times": WalkTrain3TimesTestTracker,
123        "talk_to_hagrid_diagon_test": TalkToHagridDiagonTestTracker,
124        "start_menu_test": StartMenuTestTracker,
125        "eat_pumpkin_pasty_test": EatPumpkinPastyTestTracker,
126        "equip_pointed_hat_plain_work_robe_test": EquipPointedHatPlainWorkRobeTestTracker,
127        "remove_all_equipped_items_test": RemoveAllEquippedItemsTestTracker,
128        "talk_to_hagrid_boat_test": TalkToHagridBoatTestTracker,
129        "die_test": DieTestTracker,
130        "fight_rat_then_monster_test": FightRatThenMonsterTestTracker,
131        "fight_bat_then_monster_middle_test": FightBatThenMonsterMiddleTestTracker,
132    },
133    "harry_potter_chamber_of_secrets": {
134        "default": HarryPotterOCRTracker,
135        "ocr": HarryPotterOCRTracker,
136        "find_dobby_test": FindDobbyTestTracker,
137        "select_card_deck_cos_test": SelectCardDeckCosTestTracker,
138        "board_flying_car_test": BoardFlyingCarTestTracker,
139        "enter_burrow_test": EnterBurrowTestTracker,
140        "enter_battle_cos_test": EnterBattleCosTestTracker,
141        "enter_percy_room_test": EnterPercyRoomTestTracker,
142        "enter_ginny_room_test": EnterGinnyRoomTestTracker,
143        "enter_parents_room_test": EnterParentsRoomTestTracker,
144        "enter_fred_george_room_test": EnterFredGeorgeRoomTestTracker,
145        "enter_rons_room_test": EnterRonsRoomTestTracker,
146        "talk_to_ron_burrow_test": TalkToRonBurrowTestTracker,
147        "enter_kitchen_burrow_test": EnterKitchenBurrowTestTracker,
148        "enter_burrow_garden_test": EnterBurrowGardenTestTracker,
149        "navigate_to_car_test": NavigateToCarTestTracker,
150    },
151}
152""" Mapping of game names to their available StateTracker classes with string identifiers. """
153
154
155AVAILABLE_EMULATORS: Dict[str, Dict[str, Type[Emulator]]] = {
156    "harry_potter_philosophers_stone": {"default": Emulator},
157    "harry_potter_chamber_of_secrets": {"default": Emulator},
158}
159""" Mapping of game names to their available Emulator classes with string identifiers. """
GAME_TO_GB_NAME = {'harry_potter_philosophers_stone': 'HarryPotterPhilosophersStone.gbc', 'harry_potter_chamber_of_secrets': 'HarryPotterChamberOfSecrets.gbc'}

Expected save name for each game. Save the file to /_rom_data/

STRONGEST_PARSERS: Dict[str, Type[gameboy_worlds.emulation.parser.StateParser]] = {'harry_potter_philosophers_stone': <class 'gameboy_worlds.emulation.harry_potter.parsers.HarryPotterPhilosophersStoneParser'>, 'harry_potter_chamber_of_secrets': <class 'gameboy_worlds.emulation.harry_potter.parsers.HarryPotterChamberOfSecretsParser'>}

Mapping of game names to their corresponding strongest StateParser classes. Unless you have a very good reason, you should always use the STRONGEST possible parser for a given game. The parser itself does not affect performance, as for it to perform a read / screen comparison operation , it must be called upon by the state tracker. This means there is never a reason to use a weaker parser.

AVAILABLE_STATE_TRACKERS: Dict[str, Dict[str, Type[gameboy_worlds.emulation.tracker.StateTracker]]] = {'harry_potter_philosophers_stone': {'default': <class 'gameboy_worlds.emulation.harry_potter.trackers.HarryPotterOCRTracker'>, 'ocr': <class 'gameboy_worlds.emulation.harry_potter.trackers.HarryPotterOCRTracker'>, 'potions_shop_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.PotionsShopTestTracker'>, 'enter_ollivanders_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.EnterOllivandersTestTracker'>, 'get_wand_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.GetWandTestTracker'>, 'receive_folio_magi_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.ReceiveFolioMagiTestTracker'>, 'select_card_deck_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.SelectCardDeckTestTracker'>, 'enter_gringotts_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.EnterGringottsTestTracker'>, 'talk_hagrid_gringotts_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.TalkHagridGringottsTestTracker'>, 'exit_gringotts_without_hagrid_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.ExitGringottsWithoutHagridTestTracker'>, 'get_on_train_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.GetOnTrainTestTracker'>, 'buy_chocolate_frogs_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.BuyChocolateFrogsTestTracker'>, 'sell_one_chocolate_frog_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.SellOneChocolateFrogTestTracker'>, 'lose_duel_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.LoseDuelTestTracker'>, 'win_duel_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.WinDuelTestTracker'>, 'gain_level_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.GainLevelTestTracker'>, 'gain_spell_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.GainSpellTestTracker'>, 'win_battle_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.WinBattleTestTracker'>, 'beat_boss_rat_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.BeatBossRatTestTracker'>, 'fail_rat_king_battle': <class 'gameboy_worlds.emulation.harry_potter.trackers.FailRatKingBattleTestTracker'>, 'defeat_rat_king_with_deflect_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.DefeatRatKingWithDeflectTestTracker'>, 'find_hagrid_vault_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.FindHagridVaultTestTracker'>, 'enter_malkins_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.EnterMalkinsTestTracker'>, 'open_malkins_buy_menu_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.OpenMalkinsBuyMenuTestTracker'>, 'select_robes_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.SelectRobesTestTracker'>, 'confirm_robes_purchase_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.ConfirmRobesPurchaseTestTracker'>, 'enter_flourish_blotts_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.EnterFlourishBlottsTestTracker'>, 'buy_books_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.BuyBooksTestTracker'>, 'enter_apothecary_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.EnterApothecaryTestTracker'>, 'buy_potion_kit_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.BuyPotionKitTestTracker'>, 'enter_cauldron_shop_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.EnterCauldronShopTestTracker'>, 'buy_cauldron_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.BuyCauldronTestTracker'>, 'enter_sugarplums_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.EnterSugarplumsTestTracker'>, 'open_sugarplums_buy_menu_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.OpenSugarplumsBuyMenuTestTracker'>, 'walk_train_3_times': <class 'gameboy_worlds.emulation.harry_potter.trackers.WalkTrain3TimesTestTracker'>, 'talk_to_hagrid_diagon_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.TalkToHagridDiagonTestTracker'>, 'start_menu_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.StartMenuTestTracker'>, 'eat_pumpkin_pasty_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.EatPumpkinPastyTestTracker'>, 'equip_pointed_hat_plain_work_robe_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.EquipPointedHatPlainWorkRobeTestTracker'>, 'remove_all_equipped_items_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.RemoveAllEquippedItemsTestTracker'>, 'talk_to_hagrid_boat_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.TalkToHagridBoatTestTracker'>, 'die_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.DieTestTracker'>, 'fight_rat_then_monster_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.FightRatThenMonsterTestTracker'>, 'fight_bat_then_monster_middle_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.FightBatThenMonsterMiddleTestTracker'>}, 'harry_potter_chamber_of_secrets': {'default': <class 'gameboy_worlds.emulation.harry_potter.trackers.HarryPotterOCRTracker'>, 'ocr': <class 'gameboy_worlds.emulation.harry_potter.trackers.HarryPotterOCRTracker'>, 'find_dobby_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.FindDobbyTestTracker'>, 'select_card_deck_cos_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.SelectCardDeckCosTestTracker'>, 'board_flying_car_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.BoardFlyingCarTestTracker'>, 'enter_burrow_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.EnterBurrowTestTracker'>, 'enter_battle_cos_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.EnterBattleCosTestTracker'>, 'enter_percy_room_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.EnterPercyRoomTestTracker'>, 'enter_ginny_room_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.EnterGinnyRoomTestTracker'>, 'enter_parents_room_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.EnterParentsRoomTestTracker'>, 'enter_fred_george_room_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.EnterFredGeorgeRoomTestTracker'>, 'enter_rons_room_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.EnterRonsRoomTestTracker'>, 'talk_to_ron_burrow_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.TalkToRonBurrowTestTracker'>, 'enter_kitchen_burrow_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.EnterKitchenBurrowTestTracker'>, 'enter_burrow_garden_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.EnterBurrowGardenTestTracker'>, 'navigate_to_car_test': <class 'gameboy_worlds.emulation.harry_potter.trackers.NavigateToCarTestTracker'>}}

Mapping of game names to their available StateTracker classes with string identifiers.

AVAILABLE_EMULATORS: Dict[str, Dict[str, Type[gameboy_worlds.emulation.emulator.Emulator]]] = {'harry_potter_philosophers_stone': {'default': <class 'gameboy_worlds.emulation.emulator.Emulator'>}, 'harry_potter_chamber_of_secrets': {'default': <class 'gameboy_worlds.emulation.emulator.Emulator'>}}

Mapping of game names to their available Emulator classes with string identifiers.