|
1 |
| -from typing import Dict, Type |
| 1 | +import pkgutil |
| 2 | +from typing import List, Type |
2 | 3 |
|
3 | 4 | from dataclasses import dataclass
|
4 | 5 |
|
5 |
| -from ..game import Game |
| 6 | +from ..game import AutoGameRegister |
6 | 7 |
|
7 |
| -# Game Imports |
8 |
| -from .a_dance_of_fire_and_ice_game import ADanceOfFireAndIceGame, ADanceOfFireAndIceArchipelagoOptions |
9 |
| -from .anger_foot_game import AngerFootGame, AngerFootArchipelagoOptions |
10 |
| -from .final_fantasy_xvi_game import FinalFantasyXVIGame, FinalFantasyXVIArchipelagoOptions |
11 |
| -from .halls_of_torment_game import HallsOfTormentGame, HallsOfTormentArchipelagoOptions |
12 |
| -from .neon_white_game import NeonWhiteGame, NeonWhiteArchipelagoOptions |
13 |
| -from .pinball_fx3_game import PinballFX3Game, PinballFX3ArchipelagoOptions |
14 |
| -from .pizza_tower_game import PizzaTowerGame, PizzaTowerArchipelagoOptions |
| 8 | +from pkgutil import iter_modules |
| 9 | +from importlib import import_module |
15 | 10 |
|
16 |
| -from .placid_plastic_duck_simulator_game import ( |
17 |
| - PlacidPlasticDuckSimulatorGame, PlacidPlasticDuckSimulatorArchipelagoOptions |
18 |
| -) |
| 11 | +for game in iter_modules(__path__): |
| 12 | + import_module(f".{game.name}", __package__) |
19 | 13 |
|
20 |
| -from .star_wars_battlefront_ii_classic_game import ( |
21 |
| - StarWarsBattlefrontIIClassicGame, StarWarsBattlefrontIIClassicArchipelagoOptions |
22 |
| -) |
23 | 14 |
|
24 |
| -from .street_fighter_6_game import StreetFighter6Game, StreetFighter6ArchipelagoOptions |
25 |
| -from .trackmania_game import TrackmaniaGame, TrackmaniaArchipelagoOptions |
26 |
| -from .trombone_champ_game import TromboneChampGame, TromboneChampArchipelagoOptions |
27 |
| -from .ultrakill_game import UltrakillGame, UltrakillArchipelagoOptions |
| 15 | +option_classes: List[Type] = [] |
28 | 16 |
|
29 |
| -# Metagame Imports |
30 |
| -from .archipelago_multiworld_randomizer_game import ( |
31 |
| - ArchipelagoMultiworldRandomizerGame, ArchipelagoMultiworldRandomizerArchipelagoOptions |
32 |
| -) |
33 |
| - |
34 |
| -from .game_backlog_game import GameBacklogGame, GameBacklogArchipelagoOptions |
35 |
| -from .retro_achievements_game import RetroAchievementsGame, RetroAchievementsArchipelagoOptions |
36 |
| - |
37 |
| - |
38 |
| -games: Dict[str, Type[Game]] = { |
39 |
| - ADanceOfFireAndIceGame.game_name_with_platforms(): ADanceOfFireAndIceGame, |
40 |
| - AngerFootGame.game_name_with_platforms(): AngerFootGame, |
41 |
| - FinalFantasyXVIGame.game_name_with_platforms(): FinalFantasyXVIGame, |
42 |
| - HallsOfTormentGame.game_name_with_platforms(): HallsOfTormentGame, |
43 |
| - NeonWhiteGame.game_name_with_platforms(): NeonWhiteGame, |
44 |
| - PinballFX3Game.game_name_with_platforms(): PinballFX3Game, |
45 |
| - PizzaTowerGame.game_name_with_platforms(): PizzaTowerGame, |
46 |
| - PlacidPlasticDuckSimulatorGame.game_name_with_platforms(): PlacidPlasticDuckSimulatorGame, |
47 |
| - StarWarsBattlefrontIIClassicGame.game_name_with_platforms(): StarWarsBattlefrontIIClassicGame, |
48 |
| - StreetFighter6Game.game_name_with_platforms(): StreetFighter6Game, |
49 |
| - TrackmaniaGame.game_name_with_platforms(): TrackmaniaGame, |
50 |
| - TromboneChampGame.game_name_with_platforms(): TromboneChampGame, |
51 |
| - UltrakillGame.game_name_with_platforms(): UltrakillGame, |
52 |
| -} |
53 |
| - |
54 |
| -metagames: Dict[str, Type[Game]] = { |
55 |
| - ArchipelagoMultiworldRandomizerGame.game_name_with_platforms(): ArchipelagoMultiworldRandomizerGame, |
56 |
| - GameBacklogGame.game_name_with_platforms(): GameBacklogGame, |
57 |
| - RetroAchievementsGame.game_name_with_platforms(): RetroAchievementsGame, |
58 |
| -} |
| 17 | +for name, game in [*sorted(AutoGameRegister.games.items(), reverse=True), |
| 18 | + *sorted(AutoGameRegister.metagames.items(), reverse=True)]: |
| 19 | + if game.options_cls: |
| 20 | + option_classes.append(game.options_cls) |
59 | 21 |
|
60 | 22 |
|
61 | 23 | @dataclass
|
62 | 24 | class GameArchipelagoOptions(
|
63 | 25 | # Add in reverse alphabetical order
|
64 |
| - UltrakillArchipelagoOptions, |
65 |
| - TromboneChampArchipelagoOptions, |
66 |
| - TrackmaniaArchipelagoOptions, |
67 |
| - StreetFighter6ArchipelagoOptions, |
68 |
| - StarWarsBattlefrontIIClassicArchipelagoOptions, |
69 |
| - RetroAchievementsArchipelagoOptions, |
70 |
| - PlacidPlasticDuckSimulatorArchipelagoOptions, |
71 |
| - PizzaTowerArchipelagoOptions, |
72 |
| - PinballFX3ArchipelagoOptions, |
73 |
| - NeonWhiteArchipelagoOptions, |
74 |
| - HallsOfTormentArchipelagoOptions, |
75 |
| - GameBacklogArchipelagoOptions, |
76 |
| - FinalFantasyXVIArchipelagoOptions, |
77 |
| - ArchipelagoMultiworldRandomizerArchipelagoOptions, |
78 |
| - AngerFootArchipelagoOptions, |
79 |
| - ADanceOfFireAndIceArchipelagoOptions, |
| 26 | + *option_classes |
80 | 27 | ):
|
81 | 28 | pass
|
0 commit comments