From 2a780d6ff992e9b784371e1be521f4311915938c Mon Sep 17 00:00:00 2001 From: Vishal Date: Sat, 30 Nov 2024 11:34:35 +0530 Subject: [PATCH] Removing the hard-coded lines. --- .../ba_data/python/baclassic/_appsubsystem.py | 25 +++---------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/src/assets/ba_data/python/baclassic/_appsubsystem.py b/src/assets/ba_data/python/baclassic/_appsubsystem.py index 99702dc2..72c28c77 100644 --- a/src/assets/ba_data/python/baclassic/_appsubsystem.py +++ b/src/assets/ba_data/python/baclassic/_appsubsystem.py @@ -5,6 +5,7 @@ from __future__ import annotations from typing import TYPE_CHECKING, override import random +import inspect import logging import weakref @@ -177,27 +178,9 @@ class ClassicAppSubsystem(babase.AppSubsystem): if not env.debug and not env.test and not plus.is_blessed(): babase.screenmessage('WARNING: NON-BLESSED BUILD', color=(1, 0, 0)) - # FIXME: This should not be hard-coded. - for maptype in [ - stdmaps.HockeyStadium, - stdmaps.FootballStadium, - stdmaps.Bridgit, - stdmaps.BigG, - stdmaps.Roundabout, - stdmaps.MonkeyFace, - stdmaps.ZigZag, - stdmaps.ThePad, - stdmaps.DoomShroom, - stdmaps.LakeFrigid, - stdmaps.TipTop, - stdmaps.CragCastle, - stdmaps.TowerD, - stdmaps.HappyThoughts, - stdmaps.StepRightUp, - stdmaps.Courtyard, - stdmaps.Rampage, - ]: - bascenev1.register_map(maptype) + for _, maptype in inspect.getmembers(stdmaps, inspect.isclass): + if issubclass(maptype, bascenev1.Map): + bascenev1.register_map(maptype) spazappearance.register_appearances() bascenev1.init_campaigns()