Python 3.8 -> 3.9

This commit is contained in:
Eric Froemling 2021-10-23 14:22:47 -05:00
parent c8cf5b063f
commit 31ce93c5ad
No known key found for this signature in database
GPG Key ID: 89C93F0F8D6D5A98
370 changed files with 9722 additions and 8713 deletions

File diff suppressed because it is too large Load Diff

View File

@ -20,7 +20,7 @@ jobs:
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v1 uses: actions/setup-python@v1
with: with:
python-version: 3.8 python-version: 3.9
- name: Install dependencies - name: Install dependencies
run: tools/pcommand install_pip_reqs run: tools/pcommand install_pip_reqs
- name: Run checks and tests - name: Run checks and tests
@ -35,7 +35,7 @@ jobs:
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v1 uses: actions/setup-python@v1
with: with:
python-version: 3.8 python-version: 3.9
- name: Compile binary - name: Compile binary
run: make _cmake-simple-ci-server-build run: make _cmake-simple-ci-server-build
@ -51,7 +51,7 @@ jobs:
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v1 uses: actions/setup-python@v1
with: with:
python-version: 3.8 python-version: 3.9
- name: Install dependencies - name: Install dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip

View File

@ -64,7 +64,7 @@
<excludePattern pattern=".pytest_cache" /> <excludePattern pattern=".pytest_cache" />
<excludePattern pattern=".editorconfig" /> <excludePattern pattern=".editorconfig" />
</content> </content>
<orderEntry type="inheritedJdk" /> <orderEntry type="jdk" jdkName="Python 3.9" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
</component> </component>
</module> </module>

View File

@ -14,6 +14,7 @@
<w>aaak</w> <w>aaak</w>
<w>aarch</w> <w>aarch</w>
<w>abcdefghijklmnopqrstuvwxyz</w> <w>abcdefghijklmnopqrstuvwxyz</w>
<w>abcdefghjkmnpqrtuvwxy</w>
<w>abeb</w> <w>abeb</w>
<w>abishort</w> <w>abishort</w>
<w>abot</w> <w>abot</w>
@ -81,6 +82,7 @@
<w>apichanges</w> <w>apichanges</w>
<w>apis</w> <w>apis</w>
<w>apks</w> <w>apks</w>
<w>apost</w>
<w>appath</w> <w>appath</w>
<w>appathout</w> <w>appathout</w>
<w>appcfg</w> <w>appcfg</w>
@ -235,6 +237,7 @@
<w>bombsquadgame</w> <w>bombsquadgame</w>
<w>bools</w> <w>bools</w>
<w>bootlocale</w> <w>bootlocale</w>
<w>bootsubprocess</w>
<w>borhani</w> <w>borhani</w>
<w>bot's</w> <w>bot's</w>
<w>botdist</w> <w>botdist</w>
@ -394,10 +397,12 @@
<w>clrred</w> <w>clrred</w>
<w>cmakelists</w> <w>cmakelists</w>
<w>cmakeserver</w> <w>cmakeserver</w>
<w>cmath</w>
<w>cmathmodule</w> <w>cmathmodule</w>
<w>cmds</w> <w>cmds</w>
<w>cmembers</w> <w>cmembers</w>
<w>cmodel</w> <w>cmodel</w>
<w>cmodules</w>
<w>cmpf</w> <w>cmpf</w>
<w>cnode</w> <w>cnode</w>
<w>codecsmodule</w> <w>codecsmodule</w>
@ -564,6 +569,7 @@
<w>distroot</w> <w>distroot</w>
<w>distros</w> <w>distros</w>
<w>dline</w> <w>dline</w>
<w>dliwk</w>
<w>dlldir</w> <w>dlldir</w>
<w>dlls</w> <w>dlls</w>
<w>dmake</w> <w>dmake</w>
@ -710,6 +716,7 @@
<w>eventid</w> <w>eventid</w>
<w>ewww</w> <w>ewww</w>
<w>ewwww</w> <w>ewwww</w>
<w>exargs</w>
<w>excludepowerups</w> <w>excludepowerups</w>
<w>excludetypes</w> <w>excludetypes</w>
<w>excstr</w> <w>excstr</w>
@ -745,6 +752,7 @@
<w>fbase</w> <w>fbase</w>
<w>fclose</w> <w>fclose</w>
<w>fcmd</w> <w>fcmd</w>
<w>fcntl</w>
<w>fcntlmodule</w> <w>fcntlmodule</w>
<w>fcode</w> <w>fcode</w>
<w>fcontents</w> <w>fcontents</w>
@ -977,6 +985,7 @@
<w>gpsui</w> <w>gpsui</w>
<w>gradlepath</w> <w>gradlepath</w>
<w>gradlew</w> <w>gradlew</w>
<w>graphlib</w>
<w>gravis</w> <w>gravis</w>
<w>grpentry</w> <w>grpentry</w>
<w>grpkey</w> <w>grpkey</w>
@ -1202,6 +1211,7 @@
<w>lbits</w> <w>lbits</w>
<w>lbld</w> <w>lbld</w>
<w>lbval</w> <w>lbval</w>
<w>lbzip</w>
<w>lcfg</w> <w>lcfg</w>
<w>lcolor</w> <w>lcolor</w>
<w>lcrypto</w> <w>lcrypto</w>
@ -1217,6 +1227,8 @@
<w>lfull</w> <w>lfull</w>
<w>lfval</w> <w>lfval</w>
<w>libballisticacore</w> <w>libballisticacore</w>
<w>libbz</w>
<w>libbzip</w>
<w>libcrypto</w> <w>libcrypto</w>
<w>libdir</w> <w>libdir</w>
<w>libegl</w> <w>libegl</w>
@ -1235,6 +1247,7 @@
<w>libsdl</w> <w>libsdl</w>
<w>libsqlite</w> <w>libsqlite</w>
<w>libssl</w> <w>libssl</w>
<w>libuuid</w>
<w>libvorbi</w> <w>libvorbi</w>
<w>libvorbis</w> <w>libvorbis</w>
<w>libvorbisfile</w> <w>libvorbisfile</w>
@ -1313,6 +1326,7 @@
<w>ltex</w> <w>ltex</w>
<w>ltypes</w> <w>ltypes</w>
<w>lubyte</w> <w>lubyte</w>
<w>luuid</w>
<w>lzma</w> <w>lzma</w>
<w>lzmamodule</w> <w>lzmamodule</w>
<w>macappstore</w> <w>macappstore</w>
@ -1580,6 +1594,7 @@
<w>ortho</w> <w>ortho</w>
<w>osascript</w> <w>osascript</w>
<w>osmusic</w> <w>osmusic</w>
<w>ossaudiodev</w>
<w>ostype</w> <w>ostype</w>
<w>osval</w> <w>osval</w>
<w>otherplayer</w> <w>otherplayer</w>
@ -1695,6 +1710,7 @@
<w>pogotron</w> <w>pogotron</w>
<w>pointpos</w> <w>pointpos</w>
<w>policybase</w> <w>policybase</w>
<w>popd</w>
<w>popen</w> <w>popen</w>
<w>poplib</w> <w>poplib</w>
<w>popupcolor</w> <w>popupcolor</w>
@ -2294,6 +2310,7 @@
<w>testfull</w> <w>testfull</w>
<w>testhelpers</w> <w>testhelpers</w>
<w>testimportmultiple</w> <w>testimportmultiple</w>
<w>testinternalcapi</w>
<w>testm</w> <w>testm</w>
<w>testmagicmethods</w> <w>testmagicmethods</w>
<w>testmock</w> <w>testmock</w>
@ -2405,6 +2422,7 @@
<w>typestr</w> <w>typestr</w>
<w>tzdiff</w> <w>tzdiff</w>
<w>tzinfos</w> <w>tzinfos</w>
<w>tzpath</w>
<w>uadfc</w> <w>uadfc</w>
<w>uber</w> <w>uber</w>
<w>ucrtbased</w> <w>ucrtbased</w>
@ -2463,6 +2481,7 @@
<w>userfunctions</w> <w>userfunctions</w>
<w>utcnow</w> <w>utcnow</w>
<w>utimensat</w> <w>utimensat</w>
<w>uuidmodule</w>
<w>uval</w> <w>uval</w>
<w>valanntype</w> <w>valanntype</w>
<w>validpgpkeys</w> <w>validpgpkeys</w>
@ -2521,6 +2540,7 @@
<w>webbrowser</w> <w>webbrowser</w>
<w>webpage</w> <w>webpage</w>
<w>webpages</w> <w>webpages</w>
<w>weeeird</w>
<w>whatevs</w> <w>whatevs</w>
<w>wheee</w> <w>wheee</w>
<w>whos</w> <w>whos</w>
@ -2593,7 +2613,10 @@
<w>xval</w> <w>xval</w>
<w>xxdiff</w> <w>xxdiff</w>
<w>xxhdpi</w> <w>xxhdpi</w>
<w>xxlimited</w>
<w>xxsubinterpreters</w>
<w>xxsubtype</w> <w>xxsubtype</w>
<w>xxtestfuzz</w>
<w>xxxhdpi</w> <w>xxxhdpi</w>
<w>yach</w> <w>yach</w>
<w>yapf</w> <w>yapf</w>
@ -2610,6 +2633,7 @@
<w>zipapp</w> <w>zipapp</w>
<w>zlib</w> <w>zlib</w>
<w>zlibmodule</w> <w>zlibmodule</w>
<w>zoneinfo</w>
<w>zoomtext</w> <w>zoomtext</w>
<w>zpos</w> <w>zpos</w>
<w>zval</w> <w>zval</w>

2
.idea/misc.xml generated
View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8" project-jdk-type="Python SDK" /> <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9" project-jdk-type="Python SDK" />
<component name="PythonCompatibilityInspectionAdvertiser"> <component name="PythonCompatibilityInspectionAdvertiser">
<option name="version" value="3" /> <option name="version" value="3" />
</component> </component>

View File

@ -1,5 +1,7 @@
### 1.6.5 (20388) ### 1.6.5 (20394)
- Added co-op support to server builds (thanks Dliwk!) - Added co-op support to server builds (thanks Dliwk!)
- Updated everything from Python 3.8 to Python 3.9. The biggest immediate impact to our code is that basic types such as list, dict, and tuple can be used in annotations, eliminating the need to import typing.Dict, typing.List, etc. See python.org for more changes.
- Note: accessing mods on external storage on Android will not work in this release. This functionality has not been working in recent versions of Android due to increased security features anyway and I am in the process of replacing it with a cloud based system for installing mods. More on this soon.
### 1.6.4 (20382) ### 1.6.4 (20382)
- Some cleanups in the Favorites tab of the gather window. - Some cleanups in the Favorites tab of the gather window.

File diff suppressed because it is too large Load Diff

View File

@ -1,68 +1,68 @@
[ [
"ba_data/python/ba/__init__.py", "ba_data/python/ba/__init__.py",
"ba_data/python/ba/__pycache__/__init__.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/__init__.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_account.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_account.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_achievement.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_achievement.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_activity.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_activity.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_activitytypes.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_activitytypes.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_actor.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_actor.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_ads.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_ads.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_analytics.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_analytics.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_app.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_app.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_appconfig.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_appconfig.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_appdelegate.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_appdelegate.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_appmode.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_appmode.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_apputils.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_apputils.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_assetmanager.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_assetmanager.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_asyncio.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_asyncio.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_benchmark.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_benchmark.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_campaign.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_campaign.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_collision.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_collision.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_coopgame.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_coopgame.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_coopsession.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_coopsession.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_dependency.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_dependency.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_dualteamsession.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_dualteamsession.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_error.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_error.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_freeforallsession.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_freeforallsession.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_gameactivity.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_gameactivity.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_gameresults.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_gameresults.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_gameutils.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_gameutils.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_general.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_general.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_hooks.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_hooks.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_input.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_input.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_keyboard.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_keyboard.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_language.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_language.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_level.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_level.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_lobby.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_lobby.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_map.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_map.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_math.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_math.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_messages.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_messages.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_meta.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_meta.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_multiteamsession.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_multiteamsession.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_music.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_music.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_net.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_net.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_nodeactor.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_nodeactor.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_player.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_player.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_playlist.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_playlist.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_plugin.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_plugin.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_powerup.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_powerup.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_profile.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_profile.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_score.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_score.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_servermode.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_servermode.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_session.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_session.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_settings.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_settings.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_stats.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_stats.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_store.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_store.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_team.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_team.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_teamgame.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_teamgame.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_tips.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_tips.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_tournament.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_tournament.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/_ui.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/_ui.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/deprecated.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/deprecated.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/internal.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/internal.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/macmusicapp.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/macmusicapp.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/modutils.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/modutils.cpython-39.opt-1.pyc",
"ba_data/python/ba/__pycache__/osmusic.cpython-38.opt-1.pyc", "ba_data/python/ba/__pycache__/osmusic.cpython-39.opt-1.pyc",
"ba_data/python/ba/_account.py", "ba_data/python/ba/_account.py",
"ba_data/python/ba/_achievement.py", "ba_data/python/ba/_achievement.py",
"ba_data/python/ba/_activity.py", "ba_data/python/ba/_activity.py",
@ -91,8 +91,8 @@
"ba_data/python/ba/_gameutils.py", "ba_data/python/ba/_gameutils.py",
"ba_data/python/ba/_general.py", "ba_data/python/ba/_general.py",
"ba_data/python/ba/_generated/__init__.py", "ba_data/python/ba/_generated/__init__.py",
"ba_data/python/ba/_generated/__pycache__/__init__.cpython-38.opt-1.pyc", "ba_data/python/ba/_generated/__pycache__/__init__.cpython-39.opt-1.pyc",
"ba_data/python/ba/_generated/__pycache__/enums.cpython-38.opt-1.pyc", "ba_data/python/ba/_generated/__pycache__/enums.cpython-39.opt-1.pyc",
"ba_data/python/ba/_generated/enums.py", "ba_data/python/ba/_generated/enums.py",
"ba_data/python/ba/_hooks.py", "ba_data/python/ba/_hooks.py",
"ba_data/python/ba/_input.py", "ba_data/python/ba/_input.py",
@ -130,33 +130,33 @@
"ba_data/python/ba/modutils.py", "ba_data/python/ba/modutils.py",
"ba_data/python/ba/osmusic.py", "ba_data/python/ba/osmusic.py",
"ba_data/python/ba/ui/__init__.py", "ba_data/python/ba/ui/__init__.py",
"ba_data/python/ba/ui/__pycache__/__init__.cpython-38.opt-1.pyc", "ba_data/python/ba/ui/__pycache__/__init__.cpython-39.opt-1.pyc",
"ba_data/python/bacommon/__init__.py", "ba_data/python/bacommon/__init__.py",
"ba_data/python/bacommon/__pycache__/__init__.cpython-38.opt-1.pyc", "ba_data/python/bacommon/__pycache__/__init__.cpython-39.opt-1.pyc",
"ba_data/python/bacommon/__pycache__/assets.cpython-38.opt-1.pyc", "ba_data/python/bacommon/__pycache__/assets.cpython-39.opt-1.pyc",
"ba_data/python/bacommon/__pycache__/net.cpython-38.opt-1.pyc", "ba_data/python/bacommon/__pycache__/net.cpython-39.opt-1.pyc",
"ba_data/python/bacommon/__pycache__/servermanager.cpython-38.opt-1.pyc", "ba_data/python/bacommon/__pycache__/servermanager.cpython-39.opt-1.pyc",
"ba_data/python/bacommon/assets.py", "ba_data/python/bacommon/assets.py",
"ba_data/python/bacommon/net.py", "ba_data/python/bacommon/net.py",
"ba_data/python/bacommon/servermanager.py", "ba_data/python/bacommon/servermanager.py",
"ba_data/python/bastd/__init__.py", "ba_data/python/bastd/__init__.py",
"ba_data/python/bastd/__pycache__/__init__.cpython-38.opt-1.pyc", "ba_data/python/bastd/__pycache__/__init__.cpython-39.opt-1.pyc",
"ba_data/python/bastd/__pycache__/appdelegate.cpython-38.opt-1.pyc", "ba_data/python/bastd/__pycache__/appdelegate.cpython-39.opt-1.pyc",
"ba_data/python/bastd/__pycache__/gameutils.cpython-38.opt-1.pyc", "ba_data/python/bastd/__pycache__/gameutils.cpython-39.opt-1.pyc",
"ba_data/python/bastd/__pycache__/mainmenu.cpython-38.opt-1.pyc", "ba_data/python/bastd/__pycache__/mainmenu.cpython-39.opt-1.pyc",
"ba_data/python/bastd/__pycache__/maps.cpython-38.opt-1.pyc", "ba_data/python/bastd/__pycache__/maps.cpython-39.opt-1.pyc",
"ba_data/python/bastd/__pycache__/stdmap.cpython-38.opt-1.pyc", "ba_data/python/bastd/__pycache__/stdmap.cpython-39.opt-1.pyc",
"ba_data/python/bastd/__pycache__/tutorial.cpython-38.opt-1.pyc", "ba_data/python/bastd/__pycache__/tutorial.cpython-39.opt-1.pyc",
"ba_data/python/bastd/activity/__init__.py", "ba_data/python/bastd/activity/__init__.py",
"ba_data/python/bastd/activity/__pycache__/__init__.cpython-38.opt-1.pyc", "ba_data/python/bastd/activity/__pycache__/__init__.cpython-39.opt-1.pyc",
"ba_data/python/bastd/activity/__pycache__/coopjoin.cpython-38.opt-1.pyc", "ba_data/python/bastd/activity/__pycache__/coopjoin.cpython-39.opt-1.pyc",
"ba_data/python/bastd/activity/__pycache__/coopscore.cpython-38.opt-1.pyc", "ba_data/python/bastd/activity/__pycache__/coopscore.cpython-39.opt-1.pyc",
"ba_data/python/bastd/activity/__pycache__/drawscore.cpython-38.opt-1.pyc", "ba_data/python/bastd/activity/__pycache__/drawscore.cpython-39.opt-1.pyc",
"ba_data/python/bastd/activity/__pycache__/dualteamscore.cpython-38.opt-1.pyc", "ba_data/python/bastd/activity/__pycache__/dualteamscore.cpython-39.opt-1.pyc",
"ba_data/python/bastd/activity/__pycache__/freeforallvictory.cpython-38.opt-1.pyc", "ba_data/python/bastd/activity/__pycache__/freeforallvictory.cpython-39.opt-1.pyc",
"ba_data/python/bastd/activity/__pycache__/multiteamjoin.cpython-38.opt-1.pyc", "ba_data/python/bastd/activity/__pycache__/multiteamjoin.cpython-39.opt-1.pyc",
"ba_data/python/bastd/activity/__pycache__/multiteamscore.cpython-38.opt-1.pyc", "ba_data/python/bastd/activity/__pycache__/multiteamscore.cpython-39.opt-1.pyc",
"ba_data/python/bastd/activity/__pycache__/multiteamvictory.cpython-38.opt-1.pyc", "ba_data/python/bastd/activity/__pycache__/multiteamvictory.cpython-39.opt-1.pyc",
"ba_data/python/bastd/activity/coopjoin.py", "ba_data/python/bastd/activity/coopjoin.py",
"ba_data/python/bastd/activity/coopscore.py", "ba_data/python/bastd/activity/coopscore.py",
"ba_data/python/bastd/activity/drawscore.py", "ba_data/python/bastd/activity/drawscore.py",
@ -166,27 +166,27 @@
"ba_data/python/bastd/activity/multiteamscore.py", "ba_data/python/bastd/activity/multiteamscore.py",
"ba_data/python/bastd/activity/multiteamvictory.py", "ba_data/python/bastd/activity/multiteamvictory.py",
"ba_data/python/bastd/actor/__init__.py", "ba_data/python/bastd/actor/__init__.py",
"ba_data/python/bastd/actor/__pycache__/__init__.cpython-38.opt-1.pyc", "ba_data/python/bastd/actor/__pycache__/__init__.cpython-39.opt-1.pyc",
"ba_data/python/bastd/actor/__pycache__/background.cpython-38.opt-1.pyc", "ba_data/python/bastd/actor/__pycache__/background.cpython-39.opt-1.pyc",
"ba_data/python/bastd/actor/__pycache__/bomb.cpython-38.opt-1.pyc", "ba_data/python/bastd/actor/__pycache__/bomb.cpython-39.opt-1.pyc",
"ba_data/python/bastd/actor/__pycache__/controlsguide.cpython-38.opt-1.pyc", "ba_data/python/bastd/actor/__pycache__/controlsguide.cpython-39.opt-1.pyc",
"ba_data/python/bastd/actor/__pycache__/flag.cpython-38.opt-1.pyc", "ba_data/python/bastd/actor/__pycache__/flag.cpython-39.opt-1.pyc",
"ba_data/python/bastd/actor/__pycache__/image.cpython-38.opt-1.pyc", "ba_data/python/bastd/actor/__pycache__/image.cpython-39.opt-1.pyc",
"ba_data/python/bastd/actor/__pycache__/onscreencountdown.cpython-38.opt-1.pyc", "ba_data/python/bastd/actor/__pycache__/onscreencountdown.cpython-39.opt-1.pyc",
"ba_data/python/bastd/actor/__pycache__/onscreentimer.cpython-38.opt-1.pyc", "ba_data/python/bastd/actor/__pycache__/onscreentimer.cpython-39.opt-1.pyc",
"ba_data/python/bastd/actor/__pycache__/playerspaz.cpython-38.opt-1.pyc", "ba_data/python/bastd/actor/__pycache__/playerspaz.cpython-39.opt-1.pyc",
"ba_data/python/bastd/actor/__pycache__/popuptext.cpython-38.opt-1.pyc", "ba_data/python/bastd/actor/__pycache__/popuptext.cpython-39.opt-1.pyc",
"ba_data/python/bastd/actor/__pycache__/powerupbox.cpython-38.opt-1.pyc", "ba_data/python/bastd/actor/__pycache__/powerupbox.cpython-39.opt-1.pyc",
"ba_data/python/bastd/actor/__pycache__/respawnicon.cpython-38.opt-1.pyc", "ba_data/python/bastd/actor/__pycache__/respawnicon.cpython-39.opt-1.pyc",
"ba_data/python/bastd/actor/__pycache__/scoreboard.cpython-38.opt-1.pyc", "ba_data/python/bastd/actor/__pycache__/scoreboard.cpython-39.opt-1.pyc",
"ba_data/python/bastd/actor/__pycache__/spawner.cpython-38.opt-1.pyc", "ba_data/python/bastd/actor/__pycache__/spawner.cpython-39.opt-1.pyc",
"ba_data/python/bastd/actor/__pycache__/spaz.cpython-38.opt-1.pyc", "ba_data/python/bastd/actor/__pycache__/spaz.cpython-39.opt-1.pyc",
"ba_data/python/bastd/actor/__pycache__/spazappearance.cpython-38.opt-1.pyc", "ba_data/python/bastd/actor/__pycache__/spazappearance.cpython-39.opt-1.pyc",
"ba_data/python/bastd/actor/__pycache__/spazbot.cpython-38.opt-1.pyc", "ba_data/python/bastd/actor/__pycache__/spazbot.cpython-39.opt-1.pyc",
"ba_data/python/bastd/actor/__pycache__/spazfactory.cpython-38.opt-1.pyc", "ba_data/python/bastd/actor/__pycache__/spazfactory.cpython-39.opt-1.pyc",
"ba_data/python/bastd/actor/__pycache__/text.cpython-38.opt-1.pyc", "ba_data/python/bastd/actor/__pycache__/text.cpython-39.opt-1.pyc",
"ba_data/python/bastd/actor/__pycache__/tipstext.cpython-38.opt-1.pyc", "ba_data/python/bastd/actor/__pycache__/tipstext.cpython-39.opt-1.pyc",
"ba_data/python/bastd/actor/__pycache__/zoomtext.cpython-38.opt-1.pyc", "ba_data/python/bastd/actor/__pycache__/zoomtext.cpython-39.opt-1.pyc",
"ba_data/python/bastd/actor/background.py", "ba_data/python/bastd/actor/background.py",
"ba_data/python/bastd/actor/bomb.py", "ba_data/python/bastd/actor/bomb.py",
"ba_data/python/bastd/actor/controlsguide.py", "ba_data/python/bastd/actor/controlsguide.py",
@ -209,25 +209,25 @@
"ba_data/python/bastd/actor/zoomtext.py", "ba_data/python/bastd/actor/zoomtext.py",
"ba_data/python/bastd/appdelegate.py", "ba_data/python/bastd/appdelegate.py",
"ba_data/python/bastd/game/__init__.py", "ba_data/python/bastd/game/__init__.py",
"ba_data/python/bastd/game/__pycache__/__init__.cpython-38.opt-1.pyc", "ba_data/python/bastd/game/__pycache__/__init__.cpython-39.opt-1.pyc",
"ba_data/python/bastd/game/__pycache__/assault.cpython-38.opt-1.pyc", "ba_data/python/bastd/game/__pycache__/assault.cpython-39.opt-1.pyc",
"ba_data/python/bastd/game/__pycache__/capturetheflag.cpython-38.opt-1.pyc", "ba_data/python/bastd/game/__pycache__/capturetheflag.cpython-39.opt-1.pyc",
"ba_data/python/bastd/game/__pycache__/chosenone.cpython-38.opt-1.pyc", "ba_data/python/bastd/game/__pycache__/chosenone.cpython-39.opt-1.pyc",
"ba_data/python/bastd/game/__pycache__/conquest.cpython-38.opt-1.pyc", "ba_data/python/bastd/game/__pycache__/conquest.cpython-39.opt-1.pyc",
"ba_data/python/bastd/game/__pycache__/deathmatch.cpython-38.opt-1.pyc", "ba_data/python/bastd/game/__pycache__/deathmatch.cpython-39.opt-1.pyc",
"ba_data/python/bastd/game/__pycache__/easteregghunt.cpython-38.opt-1.pyc", "ba_data/python/bastd/game/__pycache__/easteregghunt.cpython-39.opt-1.pyc",
"ba_data/python/bastd/game/__pycache__/elimination.cpython-38.opt-1.pyc", "ba_data/python/bastd/game/__pycache__/elimination.cpython-39.opt-1.pyc",
"ba_data/python/bastd/game/__pycache__/football.cpython-38.opt-1.pyc", "ba_data/python/bastd/game/__pycache__/football.cpython-39.opt-1.pyc",
"ba_data/python/bastd/game/__pycache__/hockey.cpython-38.opt-1.pyc", "ba_data/python/bastd/game/__pycache__/hockey.cpython-39.opt-1.pyc",
"ba_data/python/bastd/game/__pycache__/keepaway.cpython-38.opt-1.pyc", "ba_data/python/bastd/game/__pycache__/keepaway.cpython-39.opt-1.pyc",
"ba_data/python/bastd/game/__pycache__/kingofthehill.cpython-38.opt-1.pyc", "ba_data/python/bastd/game/__pycache__/kingofthehill.cpython-39.opt-1.pyc",
"ba_data/python/bastd/game/__pycache__/meteorshower.cpython-38.opt-1.pyc", "ba_data/python/bastd/game/__pycache__/meteorshower.cpython-39.opt-1.pyc",
"ba_data/python/bastd/game/__pycache__/ninjafight.cpython-38.opt-1.pyc", "ba_data/python/bastd/game/__pycache__/ninjafight.cpython-39.opt-1.pyc",
"ba_data/python/bastd/game/__pycache__/onslaught.cpython-38.opt-1.pyc", "ba_data/python/bastd/game/__pycache__/onslaught.cpython-39.opt-1.pyc",
"ba_data/python/bastd/game/__pycache__/race.cpython-38.opt-1.pyc", "ba_data/python/bastd/game/__pycache__/race.cpython-39.opt-1.pyc",
"ba_data/python/bastd/game/__pycache__/runaround.cpython-38.opt-1.pyc", "ba_data/python/bastd/game/__pycache__/runaround.cpython-39.opt-1.pyc",
"ba_data/python/bastd/game/__pycache__/targetpractice.cpython-38.opt-1.pyc", "ba_data/python/bastd/game/__pycache__/targetpractice.cpython-39.opt-1.pyc",
"ba_data/python/bastd/game/__pycache__/thelaststand.cpython-38.opt-1.pyc", "ba_data/python/bastd/game/__pycache__/thelaststand.cpython-39.opt-1.pyc",
"ba_data/python/bastd/game/assault.py", "ba_data/python/bastd/game/assault.py",
"ba_data/python/bastd/game/capturetheflag.py", "ba_data/python/bastd/game/capturetheflag.py",
"ba_data/python/bastd/game/chosenone.py", "ba_data/python/bastd/game/chosenone.py",
@ -248,29 +248,29 @@
"ba_data/python/bastd/game/thelaststand.py", "ba_data/python/bastd/game/thelaststand.py",
"ba_data/python/bastd/gameutils.py", "ba_data/python/bastd/gameutils.py",
"ba_data/python/bastd/keyboard/__init__.py", "ba_data/python/bastd/keyboard/__init__.py",
"ba_data/python/bastd/keyboard/__pycache__/__init__.cpython-38.opt-1.pyc", "ba_data/python/bastd/keyboard/__pycache__/__init__.cpython-39.opt-1.pyc",
"ba_data/python/bastd/keyboard/__pycache__/englishkeyboard.cpython-38.opt-1.pyc", "ba_data/python/bastd/keyboard/__pycache__/englishkeyboard.cpython-39.opt-1.pyc",
"ba_data/python/bastd/keyboard/englishkeyboard.py", "ba_data/python/bastd/keyboard/englishkeyboard.py",
"ba_data/python/bastd/mainmenu.py", "ba_data/python/bastd/mainmenu.py",
"ba_data/python/bastd/mapdata/__init__.py", "ba_data/python/bastd/mapdata/__init__.py",
"ba_data/python/bastd/mapdata/__pycache__/__init__.cpython-38.opt-1.pyc", "ba_data/python/bastd/mapdata/__pycache__/__init__.cpython-39.opt-1.pyc",
"ba_data/python/bastd/mapdata/__pycache__/big_g.cpython-38.opt-1.pyc", "ba_data/python/bastd/mapdata/__pycache__/big_g.cpython-39.opt-1.pyc",
"ba_data/python/bastd/mapdata/__pycache__/bridgit.cpython-38.opt-1.pyc", "ba_data/python/bastd/mapdata/__pycache__/bridgit.cpython-39.opt-1.pyc",
"ba_data/python/bastd/mapdata/__pycache__/courtyard.cpython-38.opt-1.pyc", "ba_data/python/bastd/mapdata/__pycache__/courtyard.cpython-39.opt-1.pyc",
"ba_data/python/bastd/mapdata/__pycache__/crag_castle.cpython-38.opt-1.pyc", "ba_data/python/bastd/mapdata/__pycache__/crag_castle.cpython-39.opt-1.pyc",
"ba_data/python/bastd/mapdata/__pycache__/doom_shroom.cpython-38.opt-1.pyc", "ba_data/python/bastd/mapdata/__pycache__/doom_shroom.cpython-39.opt-1.pyc",
"ba_data/python/bastd/mapdata/__pycache__/football_stadium.cpython-38.opt-1.pyc", "ba_data/python/bastd/mapdata/__pycache__/football_stadium.cpython-39.opt-1.pyc",
"ba_data/python/bastd/mapdata/__pycache__/happy_thoughts.cpython-38.opt-1.pyc", "ba_data/python/bastd/mapdata/__pycache__/happy_thoughts.cpython-39.opt-1.pyc",
"ba_data/python/bastd/mapdata/__pycache__/hockey_stadium.cpython-38.opt-1.pyc", "ba_data/python/bastd/mapdata/__pycache__/hockey_stadium.cpython-39.opt-1.pyc",
"ba_data/python/bastd/mapdata/__pycache__/lake_frigid.cpython-38.opt-1.pyc", "ba_data/python/bastd/mapdata/__pycache__/lake_frigid.cpython-39.opt-1.pyc",
"ba_data/python/bastd/mapdata/__pycache__/monkey_face.cpython-38.opt-1.pyc", "ba_data/python/bastd/mapdata/__pycache__/monkey_face.cpython-39.opt-1.pyc",
"ba_data/python/bastd/mapdata/__pycache__/rampage.cpython-38.opt-1.pyc", "ba_data/python/bastd/mapdata/__pycache__/rampage.cpython-39.opt-1.pyc",
"ba_data/python/bastd/mapdata/__pycache__/roundabout.cpython-38.opt-1.pyc", "ba_data/python/bastd/mapdata/__pycache__/roundabout.cpython-39.opt-1.pyc",
"ba_data/python/bastd/mapdata/__pycache__/step_right_up.cpython-38.opt-1.pyc", "ba_data/python/bastd/mapdata/__pycache__/step_right_up.cpython-39.opt-1.pyc",
"ba_data/python/bastd/mapdata/__pycache__/the_pad.cpython-38.opt-1.pyc", "ba_data/python/bastd/mapdata/__pycache__/the_pad.cpython-39.opt-1.pyc",
"ba_data/python/bastd/mapdata/__pycache__/tip_top.cpython-38.opt-1.pyc", "ba_data/python/bastd/mapdata/__pycache__/tip_top.cpython-39.opt-1.pyc",
"ba_data/python/bastd/mapdata/__pycache__/tower_d.cpython-38.opt-1.pyc", "ba_data/python/bastd/mapdata/__pycache__/tower_d.cpython-39.opt-1.pyc",
"ba_data/python/bastd/mapdata/__pycache__/zig_zag.cpython-38.opt-1.pyc", "ba_data/python/bastd/mapdata/__pycache__/zig_zag.cpython-39.opt-1.pyc",
"ba_data/python/bastd/mapdata/big_g.py", "ba_data/python/bastd/mapdata/big_g.py",
"ba_data/python/bastd/mapdata/bridgit.py", "ba_data/python/bastd/mapdata/bridgit.py",
"ba_data/python/bastd/mapdata/courtyard.py", "ba_data/python/bastd/mapdata/courtyard.py",
@ -290,57 +290,57 @@
"ba_data/python/bastd/mapdata/zig_zag.py", "ba_data/python/bastd/mapdata/zig_zag.py",
"ba_data/python/bastd/maps.py", "ba_data/python/bastd/maps.py",
"ba_data/python/bastd/session/__init__.py", "ba_data/python/bastd/session/__init__.py",
"ba_data/python/bastd/session/__pycache__/__init__.cpython-38.opt-1.pyc", "ba_data/python/bastd/session/__pycache__/__init__.cpython-39.opt-1.pyc",
"ba_data/python/bastd/stdmap.py", "ba_data/python/bastd/stdmap.py",
"ba_data/python/bastd/tutorial.py", "ba_data/python/bastd/tutorial.py",
"ba_data/python/bastd/ui/__init__.py", "ba_data/python/bastd/ui/__init__.py",
"ba_data/python/bastd/ui/__pycache__/__init__.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/__init__.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/achievements.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/achievements.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/appinvite.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/appinvite.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/characterpicker.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/characterpicker.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/colorpicker.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/colorpicker.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/config.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/config.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/configerror.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/configerror.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/confirm.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/confirm.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/continues.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/continues.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/creditslist.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/creditslist.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/debug.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/debug.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/feedback.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/feedback.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/fileselector.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/fileselector.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/getcurrency.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/getcurrency.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/getremote.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/getremote.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/helpui.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/helpui.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/iconpicker.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/iconpicker.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/kiosk.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/kiosk.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/mainmenu.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/mainmenu.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/onscreenkeyboard.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/onscreenkeyboard.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/party.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/party.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/partyqueue.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/partyqueue.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/play.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/play.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/playoptions.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/playoptions.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/popup.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/popup.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/promocode.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/promocode.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/purchase.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/purchase.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/qrcode.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/qrcode.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/radiogroup.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/radiogroup.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/report.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/report.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/resourcetypeinfo.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/resourcetypeinfo.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/serverdialog.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/serverdialog.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/specialoffer.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/specialoffer.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/tabs.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/tabs.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/teamnamescolors.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/teamnamescolors.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/telnet.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/telnet.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/tournamententry.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/tournamententry.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/tournamentscores.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/tournamentscores.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/trophies.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/trophies.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/url.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/url.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/__pycache__/watch.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/__pycache__/watch.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/account/__init__.py", "ba_data/python/bastd/ui/account/__init__.py",
"ba_data/python/bastd/ui/account/__pycache__/__init__.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/account/__pycache__/__init__.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/account/__pycache__/link.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/account/__pycache__/link.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/account/__pycache__/settings.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/account/__pycache__/settings.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/account/__pycache__/unlink.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/account/__pycache__/unlink.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/account/__pycache__/viewer.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/account/__pycache__/viewer.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/account/link.py", "ba_data/python/bastd/ui/account/link.py",
"ba_data/python/bastd/ui/account/settings.py", "ba_data/python/bastd/ui/account/settings.py",
"ba_data/python/bastd/ui/account/unlink.py", "ba_data/python/bastd/ui/account/unlink.py",
@ -354,10 +354,10 @@
"ba_data/python/bastd/ui/confirm.py", "ba_data/python/bastd/ui/confirm.py",
"ba_data/python/bastd/ui/continues.py", "ba_data/python/bastd/ui/continues.py",
"ba_data/python/bastd/ui/coop/__init__.py", "ba_data/python/bastd/ui/coop/__init__.py",
"ba_data/python/bastd/ui/coop/__pycache__/__init__.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/coop/__pycache__/__init__.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/coop/__pycache__/browser.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/coop/__pycache__/browser.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/coop/__pycache__/gamebutton.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/coop/__pycache__/gamebutton.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/coop/__pycache__/level.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/coop/__pycache__/level.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/coop/browser.py", "ba_data/python/bastd/ui/coop/browser.py",
"ba_data/python/bastd/ui/coop/gamebutton.py", "ba_data/python/bastd/ui/coop/gamebutton.py",
"ba_data/python/bastd/ui/coop/level.py", "ba_data/python/bastd/ui/coop/level.py",
@ -366,12 +366,12 @@
"ba_data/python/bastd/ui/feedback.py", "ba_data/python/bastd/ui/feedback.py",
"ba_data/python/bastd/ui/fileselector.py", "ba_data/python/bastd/ui/fileselector.py",
"ba_data/python/bastd/ui/gather/__init__.py", "ba_data/python/bastd/ui/gather/__init__.py",
"ba_data/python/bastd/ui/gather/__pycache__/__init__.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/gather/__pycache__/__init__.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/gather/__pycache__/abouttab.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/gather/__pycache__/abouttab.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/gather/__pycache__/manualtab.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/gather/__pycache__/manualtab.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/gather/__pycache__/nearbytab.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/gather/__pycache__/nearbytab.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/gather/__pycache__/privatetab.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/gather/__pycache__/privatetab.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/gather/__pycache__/publictab.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/gather/__pycache__/publictab.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/gather/abouttab.py", "ba_data/python/bastd/ui/gather/abouttab.py",
"ba_data/python/bastd/ui/gather/manualtab.py", "ba_data/python/bastd/ui/gather/manualtab.py",
"ba_data/python/bastd/ui/gather/nearbytab.py", "ba_data/python/bastd/ui/gather/nearbytab.py",
@ -383,9 +383,9 @@
"ba_data/python/bastd/ui/iconpicker.py", "ba_data/python/bastd/ui/iconpicker.py",
"ba_data/python/bastd/ui/kiosk.py", "ba_data/python/bastd/ui/kiosk.py",
"ba_data/python/bastd/ui/league/__init__.py", "ba_data/python/bastd/ui/league/__init__.py",
"ba_data/python/bastd/ui/league/__pycache__/__init__.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/league/__pycache__/__init__.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/league/__pycache__/rankbutton.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/league/__pycache__/rankbutton.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/league/__pycache__/rankwindow.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/league/__pycache__/rankwindow.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/league/rankbutton.py", "ba_data/python/bastd/ui/league/rankbutton.py",
"ba_data/python/bastd/ui/league/rankwindow.py", "ba_data/python/bastd/ui/league/rankwindow.py",
"ba_data/python/bastd/ui/mainmenu.py", "ba_data/python/bastd/ui/mainmenu.py",
@ -394,15 +394,15 @@
"ba_data/python/bastd/ui/partyqueue.py", "ba_data/python/bastd/ui/partyqueue.py",
"ba_data/python/bastd/ui/play.py", "ba_data/python/bastd/ui/play.py",
"ba_data/python/bastd/ui/playlist/__init__.py", "ba_data/python/bastd/ui/playlist/__init__.py",
"ba_data/python/bastd/ui/playlist/__pycache__/__init__.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/playlist/__pycache__/__init__.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/playlist/__pycache__/addgame.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/playlist/__pycache__/addgame.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/playlist/__pycache__/browser.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/playlist/__pycache__/browser.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/playlist/__pycache__/customizebrowser.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/playlist/__pycache__/customizebrowser.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/playlist/__pycache__/edit.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/playlist/__pycache__/edit.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/playlist/__pycache__/editcontroller.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/playlist/__pycache__/editcontroller.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/playlist/__pycache__/editgame.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/playlist/__pycache__/editgame.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/playlist/__pycache__/mapselect.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/playlist/__pycache__/mapselect.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/playlist/__pycache__/share.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/playlist/__pycache__/share.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/playlist/addgame.py", "ba_data/python/bastd/ui/playlist/addgame.py",
"ba_data/python/bastd/ui/playlist/browser.py", "ba_data/python/bastd/ui/playlist/browser.py",
"ba_data/python/bastd/ui/playlist/customizebrowser.py", "ba_data/python/bastd/ui/playlist/customizebrowser.py",
@ -414,10 +414,10 @@
"ba_data/python/bastd/ui/playoptions.py", "ba_data/python/bastd/ui/playoptions.py",
"ba_data/python/bastd/ui/popup.py", "ba_data/python/bastd/ui/popup.py",
"ba_data/python/bastd/ui/profile/__init__.py", "ba_data/python/bastd/ui/profile/__init__.py",
"ba_data/python/bastd/ui/profile/__pycache__/__init__.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/profile/__pycache__/__init__.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/profile/__pycache__/browser.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/profile/__pycache__/browser.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/profile/__pycache__/edit.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/profile/__pycache__/edit.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/profile/__pycache__/upgrade.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/profile/__pycache__/upgrade.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/profile/browser.py", "ba_data/python/bastd/ui/profile/browser.py",
"ba_data/python/bastd/ui/profile/edit.py", "ba_data/python/bastd/ui/profile/edit.py",
"ba_data/python/bastd/ui/profile/upgrade.py", "ba_data/python/bastd/ui/profile/upgrade.py",
@ -429,25 +429,25 @@
"ba_data/python/bastd/ui/resourcetypeinfo.py", "ba_data/python/bastd/ui/resourcetypeinfo.py",
"ba_data/python/bastd/ui/serverdialog.py", "ba_data/python/bastd/ui/serverdialog.py",
"ba_data/python/bastd/ui/settings/__init__.py", "ba_data/python/bastd/ui/settings/__init__.py",
"ba_data/python/bastd/ui/settings/__pycache__/__init__.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/settings/__pycache__/__init__.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/settings/__pycache__/advanced.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/settings/__pycache__/advanced.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/settings/__pycache__/allsettings.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/settings/__pycache__/allsettings.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/settings/__pycache__/audio.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/settings/__pycache__/audio.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/settings/__pycache__/controls.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/settings/__pycache__/controls.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/settings/__pycache__/gamepad.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/settings/__pycache__/gamepad.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/settings/__pycache__/gamepadadvanced.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/settings/__pycache__/gamepadadvanced.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/settings/__pycache__/gamepadselect.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/settings/__pycache__/gamepadselect.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/settings/__pycache__/graphics.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/settings/__pycache__/graphics.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/settings/__pycache__/keyboard.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/settings/__pycache__/keyboard.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/settings/__pycache__/nettesting.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/settings/__pycache__/nettesting.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/settings/__pycache__/plugins.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/settings/__pycache__/plugins.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/settings/__pycache__/ps3controller.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/settings/__pycache__/ps3controller.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/settings/__pycache__/remoteapp.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/settings/__pycache__/remoteapp.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/settings/__pycache__/testing.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/settings/__pycache__/testing.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/settings/__pycache__/touchscreen.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/settings/__pycache__/touchscreen.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/settings/__pycache__/vrtesting.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/settings/__pycache__/vrtesting.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/settings/__pycache__/wiimote.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/settings/__pycache__/wiimote.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/settings/__pycache__/xbox360controller.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/settings/__pycache__/xbox360controller.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/settings/advanced.py", "ba_data/python/bastd/ui/settings/advanced.py",
"ba_data/python/bastd/ui/settings/allsettings.py", "ba_data/python/bastd/ui/settings/allsettings.py",
"ba_data/python/bastd/ui/settings/audio.py", "ba_data/python/bastd/ui/settings/audio.py",
@ -467,21 +467,21 @@
"ba_data/python/bastd/ui/settings/wiimote.py", "ba_data/python/bastd/ui/settings/wiimote.py",
"ba_data/python/bastd/ui/settings/xbox360controller.py", "ba_data/python/bastd/ui/settings/xbox360controller.py",
"ba_data/python/bastd/ui/soundtrack/__init__.py", "ba_data/python/bastd/ui/soundtrack/__init__.py",
"ba_data/python/bastd/ui/soundtrack/__pycache__/__init__.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/soundtrack/__pycache__/__init__.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/soundtrack/__pycache__/browser.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/soundtrack/__pycache__/browser.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/soundtrack/__pycache__/edit.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/soundtrack/__pycache__/edit.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/soundtrack/__pycache__/entrytypeselect.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/soundtrack/__pycache__/entrytypeselect.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/soundtrack/__pycache__/macmusicapp.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/soundtrack/__pycache__/macmusicapp.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/soundtrack/browser.py", "ba_data/python/bastd/ui/soundtrack/browser.py",
"ba_data/python/bastd/ui/soundtrack/edit.py", "ba_data/python/bastd/ui/soundtrack/edit.py",
"ba_data/python/bastd/ui/soundtrack/entrytypeselect.py", "ba_data/python/bastd/ui/soundtrack/entrytypeselect.py",
"ba_data/python/bastd/ui/soundtrack/macmusicapp.py", "ba_data/python/bastd/ui/soundtrack/macmusicapp.py",
"ba_data/python/bastd/ui/specialoffer.py", "ba_data/python/bastd/ui/specialoffer.py",
"ba_data/python/bastd/ui/store/__init__.py", "ba_data/python/bastd/ui/store/__init__.py",
"ba_data/python/bastd/ui/store/__pycache__/__init__.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/store/__pycache__/__init__.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/store/__pycache__/browser.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/store/__pycache__/browser.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/store/__pycache__/button.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/store/__pycache__/button.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/store/__pycache__/item.cpython-38.opt-1.pyc", "ba_data/python/bastd/ui/store/__pycache__/item.cpython-39.opt-1.pyc",
"ba_data/python/bastd/ui/store/browser.py", "ba_data/python/bastd/ui/store/browser.py",
"ba_data/python/bastd/ui/store/button.py", "ba_data/python/bastd/ui/store/button.py",
"ba_data/python/bastd/ui/store/item.py", "ba_data/python/bastd/ui/store/item.py",
@ -494,21 +494,21 @@
"ba_data/python/bastd/ui/url.py", "ba_data/python/bastd/ui/url.py",
"ba_data/python/bastd/ui/watch.py", "ba_data/python/bastd/ui/watch.py",
"ba_data/python/efro/__init__.py", "ba_data/python/efro/__init__.py",
"ba_data/python/efro/__pycache__/__init__.cpython-38.opt-1.pyc", "ba_data/python/efro/__pycache__/__init__.cpython-39.opt-1.pyc",
"ba_data/python/efro/__pycache__/call.cpython-38.opt-1.pyc", "ba_data/python/efro/__pycache__/call.cpython-39.opt-1.pyc",
"ba_data/python/efro/__pycache__/error.cpython-38.opt-1.pyc", "ba_data/python/efro/__pycache__/error.cpython-39.opt-1.pyc",
"ba_data/python/efro/__pycache__/message.cpython-38.opt-1.pyc", "ba_data/python/efro/__pycache__/message.cpython-39.opt-1.pyc",
"ba_data/python/efro/__pycache__/terminal.cpython-38.opt-1.pyc", "ba_data/python/efro/__pycache__/terminal.cpython-39.opt-1.pyc",
"ba_data/python/efro/__pycache__/util.cpython-38.opt-1.pyc", "ba_data/python/efro/__pycache__/util.cpython-39.opt-1.pyc",
"ba_data/python/efro/call.py", "ba_data/python/efro/call.py",
"ba_data/python/efro/dataclassio/__init__.py", "ba_data/python/efro/dataclassio/__init__.py",
"ba_data/python/efro/dataclassio/__pycache__/__init__.cpython-38.opt-1.pyc", "ba_data/python/efro/dataclassio/__pycache__/__init__.cpython-39.opt-1.pyc",
"ba_data/python/efro/dataclassio/__pycache__/_base.cpython-38.opt-1.pyc", "ba_data/python/efro/dataclassio/__pycache__/_base.cpython-39.opt-1.pyc",
"ba_data/python/efro/dataclassio/__pycache__/_inputter.cpython-38.opt-1.pyc", "ba_data/python/efro/dataclassio/__pycache__/_inputter.cpython-39.opt-1.pyc",
"ba_data/python/efro/dataclassio/__pycache__/_outputter.cpython-38.opt-1.pyc", "ba_data/python/efro/dataclassio/__pycache__/_outputter.cpython-39.opt-1.pyc",
"ba_data/python/efro/dataclassio/__pycache__/_pathcapture.cpython-38.opt-1.pyc", "ba_data/python/efro/dataclassio/__pycache__/_pathcapture.cpython-39.opt-1.pyc",
"ba_data/python/efro/dataclassio/__pycache__/_prep.cpython-38.opt-1.pyc", "ba_data/python/efro/dataclassio/__pycache__/_prep.cpython-39.opt-1.pyc",
"ba_data/python/efro/dataclassio/__pycache__/extras.cpython-38.opt-1.pyc", "ba_data/python/efro/dataclassio/__pycache__/extras.cpython-39.opt-1.pyc",
"ba_data/python/efro/dataclassio/_base.py", "ba_data/python/efro/dataclassio/_base.py",
"ba_data/python/efro/dataclassio/_inputter.py", "ba_data/python/efro/dataclassio/_inputter.py",
"ba_data/python/efro/dataclassio/_outputter.py", "ba_data/python/efro/dataclassio/_outputter.py",
@ -519,6 +519,6 @@
"ba_data/python/efro/message.py", "ba_data/python/efro/message.py",
"ba_data/python/efro/terminal.py", "ba_data/python/efro/terminal.py",
"ba_data/python/efro/util.py", "ba_data/python/efro/util.py",
"server/__pycache__/ballisticacore_server.cpython-38.opt-1.pyc", "server/__pycache__/ballisticacore_server.cpython-39.opt-1.pyc",
"server/ballisticacore_server.py" "server/ballisticacore_server.py"
] ]

File diff suppressed because it is too large Load Diff

View File

@ -1 +1 @@
67151430861016518839485378649631062235 291441930138756424684870937756526517762

View File

@ -37,8 +37,7 @@ from typing import TYPE_CHECKING, overload, Sequence, TypeVar
from ba._generated.enums import TimeFormat, TimeType from ba._generated.enums import TimeFormat, TimeType
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import (Any, Dict, Callable, Tuple, List, Optional, Union, from typing import Any, Callable, Optional, Union, Literal
List, Type, Literal)
from ba._app import App from ba._app import App
import ba import ba
@ -386,9 +385,9 @@ class Material:
label: str label: str
def add_actions(self, def add_actions(self,
actions: Tuple, actions: tuple,
conditions: Optional[Tuple] = None) -> None: conditions: Optional[tuple] = None) -> None:
"""add_actions(actions: Tuple, conditions: Optional[Tuple] = None) """add_actions(actions: tuple, conditions: Optional[tuple] = None)
-> None -> None
Add one or more actions to the material, optionally with conditions. Add one or more actions to the material, optionally with conditions.
@ -724,16 +723,16 @@ class Node:
# Show that ur return type varies based on "doraise" value: # Show that ur return type varies based on "doraise" value:
@overload @overload
def getdelegate(self, def getdelegate(self,
type: Type[_T], type: type[_T],
doraise: Literal[False] = False) -> Optional[_T]: doraise: Literal[False] = False) -> Optional[_T]:
... ...
@overload @overload
def getdelegate(self, type: Type[_T], doraise: Literal[True]) -> _T: def getdelegate(self, type: type[_T], doraise: Literal[True]) -> _T:
... ...
def getdelegate(self, type: Any, doraise: bool = False) -> Any: def getdelegate(self, type: Any, doraise: bool = False) -> Any:
"""getdelegate(type: Type, doraise: bool = False) -> <varies> """getdelegate(type: type, doraise: bool = False) -> <varies>
Return the node's current delegate object if it matches a certain type. Return the node's current delegate object if it matches a certain type.
@ -849,9 +848,9 @@ class SessionPlayer:
character: str character: str
activityplayer: Optional[ba.Player] activityplayer: Optional[ba.Player]
def assigninput(self, type: Union[ba.InputType, Tuple[ba.InputType, ...]], def assigninput(self, type: Union[ba.InputType, tuple[ba.InputType, ...]],
call: Callable) -> None: call: Callable) -> None:
"""assigninput(type: Union[ba.InputType, Tuple[ba.InputType, ...]], """assigninput(type: Union[ba.InputType, tuple[ba.InputType, ...]],
call: Callable) -> None call: Callable) -> None
Set the python callable to be run for one or more types of input. Set the python callable to be run for one or more types of input.
@ -877,15 +876,15 @@ class SessionPlayer:
""" """
return str() return str()
def get_icon(self) -> Dict[str, Any]: def get_icon(self) -> dict[str, Any]:
"""get_icon() -> Dict[str, Any] """get_icon() -> dict[str, Any]
Returns the character's icon (images, colors, etc contained in a dict) Returns the character's icon (images, colors, etc contained in a dict)
""" """
return {'foo': 'bar'} return {'foo': 'bar'}
def get_icon_info(self) -> Dict[str, Any]: def get_icon_info(self) -> dict[str, Any]:
"""get_icon_info() -> Dict[str, Any] """get_icon_info() -> dict[str, Any]
(internal) (internal)
""" """
@ -1203,15 +1202,15 @@ class Widget:
""" """
return bool() return bool()
def get_children(self) -> List[ba.Widget]: def get_children(self) -> list[ba.Widget]:
"""get_children() -> List[ba.Widget] """get_children() -> list[ba.Widget]
Returns any child Widgets of this Widget. Returns any child Widgets of this Widget.
""" """
return [Widget()] return [Widget()]
def get_screen_space_center(self) -> Tuple[float, float]: def get_screen_space_center(self) -> tuple[float, float]:
"""get_screen_space_center() -> Tuple[float, float] """get_screen_space_center() -> tuple[float, float]
Returns the coords of the Widget center relative to the center of the Returns the coords of the Widget center relative to the center of the
screen. This can be useful for placing pop-up windows and other special screen. This can be useful for placing pop-up windows and other special
@ -1993,8 +1992,8 @@ def get_account_type() -> str:
return str() return str()
def get_appconfig_builtin_keys() -> List[str]: def get_appconfig_builtin_keys() -> list[str]:
"""get_appconfig_builtin_keys() -> List[str] """get_appconfig_builtin_keys() -> list[str]
(internal) (internal)
""" """
@ -2009,8 +2008,8 @@ def get_appconfig_default_value(key: str) -> Any:
return _uninferrable() return _uninferrable()
def get_chat_messages() -> List[str]: def get_chat_messages() -> list[str]:
"""get_chat_messages() -> List[str] """get_chat_messages() -> list[str]
(internal) (internal)
""" """
@ -2050,8 +2049,8 @@ def get_connection_to_host_info() -> dict:
return dict() return dict()
def get_display_resolution() -> Optional[Tuple[int, int]]: def get_display_resolution() -> Optional[tuple[int, int]]:
"""get_display_resolution() -> Optional[Tuple[int, int]] """get_display_resolution() -> Optional[tuple[int, int]]
(internal) (internal)
@ -2095,8 +2094,8 @@ def get_game_port() -> int:
return int() return int()
def get_game_roster() -> List[Dict[str, Any]]: def get_game_roster() -> list[dict[str, Any]]:
"""get_game_roster() -> List[Dict[str, Any]] """get_game_roster() -> list[dict[str, Any]]
(internal) (internal)
""" """
@ -2895,8 +2894,8 @@ def mac_music_app_get_library_source() -> None:
return None return None
def mac_music_app_get_playlists() -> List[str]: def mac_music_app_get_playlists() -> list[str]:
"""mac_music_app_get_playlists() -> List[str] """mac_music_app_get_playlists() -> list[str]
(internal) (internal)
""" """
@ -3001,9 +3000,9 @@ def music_player_stop() -> None:
return None return None
def new_host_session(sessiontype: Type[ba.Session], def new_host_session(sessiontype: type[ba.Session],
benchmark_type: str = None) -> None: benchmark_type: str = None) -> None:
"""new_host_session(sessiontype: Type[ba.Session], """new_host_session(sessiontype: type[ba.Session],
benchmark_type: str = None) -> None benchmark_type: str = None) -> None
(internal) (internal)
@ -3019,9 +3018,9 @@ def new_replay_session(file_name: str) -> None:
return None return None
def newactivity(activity_type: Type[ba.Activity], def newactivity(activity_type: type[ba.Activity],
settings: dict = None) -> ba.Activity: settings: dict = None) -> ba.Activity:
"""newactivity(activity_type: Type[ba.Activity], """newactivity(activity_type: type[ba.Activity],
settings: dict = None) -> ba.Activity settings: dict = None) -> ba.Activity
Instantiates a ba.Activity given a type object. Instantiates a ba.Activity given a type object.
@ -3370,9 +3369,9 @@ def run_transactions() -> None:
def safecolor(color: Sequence[float], def safecolor(color: Sequence[float],
target_intensity: float = 0.6) -> Tuple[float, ...]: target_intensity: float = 0.6) -> tuple[float, ...]:
"""safecolor(color: Sequence[float], target_intensity: float = 0.6) """safecolor(color: Sequence[float], target_intensity: float = 0.6)
-> Tuple[float, ...] -> tuple[float, ...]
Given a color tuple, return a color safe to display as text. Given a color tuple, return a color safe to display as text.
@ -3387,13 +3386,13 @@ def safecolor(color: Sequence[float],
def screenmessage(message: Union[str, ba.Lstr], def screenmessage(message: Union[str, ba.Lstr],
color: Sequence[float] = None, color: Sequence[float] = None,
top: bool = False, top: bool = False,
image: Dict[str, Any] = None, image: dict[str, Any] = None,
log: bool = False, log: bool = False,
clients: Sequence[int] = None, clients: Sequence[int] = None,
transient: bool = False) -> None: transient: bool = False) -> None:
"""screenmessage(message: Union[str, ba.Lstr], """screenmessage(message: Union[str, ba.Lstr],
color: Sequence[float] = None, top: bool = False, color: Sequence[float] = None, top: bool = False,
image: Dict[str, Any] = None, log: bool = False, image: dict[str, Any] = None, log: bool = False,
clients: Sequence[int] = None, transient: bool = False) -> None clients: Sequence[int] = None, transient: bool = False) -> None
Print a message to the local client's screen, in a given color. Print a message to the local client's screen, in a given color.
@ -3456,8 +3455,8 @@ def scrollwidget(edit: ba.Widget = None,
return ba.Widget() return ba.Widget()
def set_admins(admins: List[str]) -> None: def set_admins(admins: list[str]) -> None:
"""set_admins(admins: List[str]) -> None """set_admins(admins: list[str]) -> None
(internal) (internal)
""" """
@ -3513,10 +3512,10 @@ def set_have_mods(have_mods: bool) -> None:
def set_internal_language_keys( def set_internal_language_keys(
listobj: List[Tuple[str, str]], listobj: list[tuple[str, str]],
random_names_list: List[Tuple[str, str]]) -> None: random_names_list: list[tuple[str, str]]) -> None:
"""set_internal_language_keys(listobj: List[Tuple[str, str]], """set_internal_language_keys(listobj: list[tuple[str, str]],
random_names_list: List[Tuple[str, str]]) -> None random_names_list: list[tuple[str, str]]) -> None
(internal) (internal)
""" """
@ -3532,8 +3531,8 @@ def set_low_level_config_value(key: str, value: int) -> None:
def set_map_bounds( def set_map_bounds(
bounds: Tuple[float, float, float, float, float, float]) -> None: bounds: tuple[float, float, float, float, float, float]) -> None:
"""set_map_bounds(bounds: Tuple[float, float, float, float, float, float]) """set_map_bounds(bounds: tuple[float, float, float, float, float, float])
-> None -> None
(internal) (internal)
@ -4020,18 +4019,18 @@ def timer(time: float,
return None return None
def tournament_query(callback: Callable[[Optional[Dict]], None], def tournament_query(callback: Callable[[Optional[dict]], None],
args: Dict) -> None: args: dict) -> None:
"""tournament_query(callback: Callable[[Optional[Dict]], None], """tournament_query(callback: Callable[[Optional[dict]], None],
args: Dict) -> None args: dict) -> None
(internal) (internal)
""" """
return None return None
def uibounds() -> Tuple[float, float, float, float]: def uibounds() -> tuple[float, float, float, float]:
"""uibounds() -> Tuple[float, float, float, float] """uibounds() -> tuple[float, float, float, float]
(internal) (internal)

View File

@ -11,7 +11,7 @@ from typing import TYPE_CHECKING
import _ba import _ba
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, Optional, Dict, List, Tuple from typing import Any, Optional
import ba import ba
@ -24,16 +24,16 @@ class AccountSubsystem:
""" """
def __init__(self) -> None: def __init__(self) -> None:
self.account_tournament_list: Optional[Tuple[int, List[str]]] = None self.account_tournament_list: Optional[tuple[int, list[str]]] = None
# FIXME: should abstract/structure these. # FIXME: should abstract/structure these.
self.tournament_info: Dict = {} self.tournament_info: dict = {}
self.league_rank_cache: Dict = {} self.league_rank_cache: dict = {}
self.last_post_purchase_message_time: Optional[float] = None self.last_post_purchase_message_time: Optional[float] = None
# If we try to run promo-codes due to launch-args/etc we might # If we try to run promo-codes due to launch-args/etc we might
# not be signed in yet; go ahead and queue them up in that case. # not be signed in yet; go ahead and queue them up in that case.
self.pending_promo_codes: List[str] = [] self.pending_promo_codes: list[str] = []
def on_app_launch(self) -> None: def on_app_launch(self) -> None:
"""Called when the app is done bootstrapping.""" """Called when the app is done bootstrapping."""
@ -74,7 +74,7 @@ class AccountSubsystem:
return self.league_rank_cache.get('info', None) return self.league_rank_cache.get('info', None)
def get_league_rank_points(self, def get_league_rank_points(self,
data: Optional[Dict[str, Any]], data: Optional[dict[str, Any]],
subset: str = None) -> int: subset: str = None) -> int:
"""(internal)""" """(internal)"""
if data is None: if data is None:
@ -132,7 +132,7 @@ class AccountSubsystem:
TimeFormat.MILLISECONDS) TimeFormat.MILLISECONDS)
cache_entry['valid'] = True cache_entry['valid'] = True
def get_purchased_icons(self) -> List[str]: def get_purchased_icons(self) -> list[str]:
"""(internal)""" """(internal)"""
# pylint: disable=cyclic-import # pylint: disable=cyclic-import
from ba import _store from ba import _store

View File

@ -9,7 +9,7 @@ import _ba
from ba._error import print_exception from ba._error import print_exception
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, Sequence, List, Dict, Union, Optional, Tuple, Set from typing import Any, Sequence, Union, Optional
import ba import ba
# This could use some cleanup. # This could use some cleanup.
@ -71,11 +71,11 @@ class AchievementSubsystem:
""" """
def __init__(self) -> None: def __init__(self) -> None:
self.achievements: List[Achievement] = [] self.achievements: list[Achievement] = []
self.achievements_to_display: (List[Tuple[ba.Achievement, bool]]) = [] self.achievements_to_display: (list[tuple[ba.Achievement, bool]]) = []
self.achievement_display_timer: Optional[_ba.Timer] = None self.achievement_display_timer: Optional[_ba.Timer] = None
self.last_achievement_display_time: float = 0.0 self.last_achievement_display_time: float = 0.0
self.achievement_completion_banner_slots: Set[int] = set() self.achievement_completion_banner_slots: set[int] = set()
self._init_achievements() self._init_achievements()
def _init_achievements(self) -> None: def _init_achievements(self) -> None:
@ -374,7 +374,7 @@ class AchievementSubsystem:
return achs[0] return achs[0]
def achievements_for_coop_level(self, def achievements_for_coop_level(self,
level_name: str) -> List[Achievement]: level_name: str) -> list[Achievement]:
"""Given a level name, return achievements available for it.""" """Given a level name, return achievements available for it."""
# For the Easy campaign we return achievements for the Default # For the Easy campaign we return achievements for the Default
@ -612,7 +612,7 @@ class Achievement:
delay: float, delay: float,
outdelay: float = None, outdelay: float = None,
color: Sequence[float] = None, color: Sequence[float] = None,
style: str = 'post_game') -> List[ba.Actor]: style: str = 'post_game') -> list[ba.Actor]:
"""Create a display for the Achievement. """Create a display for the Achievement.
Shows the Achievement icon, name, and description. Shows the Achievement icon, name, and description.
@ -663,7 +663,7 @@ class Achievement:
print_exception('Error determining campaign.') print_exception('Error determining campaign.')
hmo = False hmo = False
objs: List[ba.Actor] objs: list[ba.Actor]
if in_game_colors: if in_game_colors:
objs = [] objs = []
@ -898,12 +898,12 @@ class Achievement:
transition_out_delay=None).autoretain()) transition_out_delay=None).autoretain())
return objs return objs
def _getconfig(self) -> Dict[str, Any]: def _getconfig(self) -> dict[str, Any]:
""" """
Return the sub-dict in settings where this achievement's Return the sub-dict in settings where this achievement's
state is stored, creating it if need be. state is stored, creating it if need be.
""" """
val: Dict[str, Any] = (_ba.app.config.setdefault( val: dict[str, Any] = (_ba.app.config.setdefault(
'Achievements', {}).setdefault(self._name, {'Complete': False})) 'Achievements', {}).setdefault(self._name, {'Complete': False}))
assert isinstance(val, dict) assert isinstance(val, dict)
return val return val
@ -971,7 +971,7 @@ class Achievement:
i += 1 i += 1
assert self._completion_banner_slot is not None assert self._completion_banner_slot is not None
y_offs = 110 * self._completion_banner_slot y_offs = 110 * self._completion_banner_slot
objs: List[ba.Actor] = [] objs: list[ba.Actor] = []
obj = Image(_ba.gettexture('shadow'), obj = Image(_ba.gettexture('shadow'),
position=(-30, 30 + y_offs), position=(-30, 30 + y_offs),
front=True, front=True,

View File

@ -16,8 +16,7 @@ from ba._general import Call, verify_object_death
from ba._messages import UNHANDLED from ba._messages import UNHANDLED
if TYPE_CHECKING: if TYPE_CHECKING:
from weakref import ReferenceType from typing import Optional, Any
from typing import Optional, Type, Any, Dict, List
import ba import ba
from bastd.actor.respawnicon import RespawnIcon from bastd.actor.respawnicon import RespawnIcon
@ -58,9 +57,9 @@ class Activity(DependencyComponent, Generic[PlayerType, TeamType]):
# pylint: disable=too-many-public-methods # pylint: disable=too-many-public-methods
# Annotating attr types at the class level lets us introspect at runtime. # Annotating attr types at the class level lets us introspect at runtime.
settings_raw: Dict[str, Any] settings_raw: dict[str, Any]
teams: List[TeamType] teams: list[TeamType]
players: List[PlayerType] players: list[PlayerType]
# Whether to print every time a player dies. This can be pertinent # Whether to print every time a player dies. This can be pertinent
# in games such as Death-Match but can be annoying in games where it # in games such as Death-Match but can be annoying in games where it
@ -150,8 +149,8 @@ class Activity(DependencyComponent, Generic[PlayerType, TeamType]):
# Player/Team types should have been specified as type args; # Player/Team types should have been specified as type args;
# grab those. # grab those.
self._playertype: Type[PlayerType] self._playertype: type[PlayerType]
self._teamtype: Type[TeamType] self._teamtype: type[TeamType]
self._setup_player_and_team_types() self._setup_player_and_team_types()
# FIXME: Relocate or remove the need for this stuff. # FIXME: Relocate or remove the need for this stuff.
@ -160,7 +159,7 @@ class Activity(DependencyComponent, Generic[PlayerType, TeamType]):
self._session = weakref.ref(_ba.getsession()) self._session = weakref.ref(_ba.getsession())
# Preloaded data for actors, maps, etc; indexed by type. # Preloaded data for actors, maps, etc; indexed by type.
self.preloads: Dict[Type, Any] = {} self.preloads: dict[type, Any] = {}
# Hopefully can eventually kill this; activities should # Hopefully can eventually kill this; activities should
# validate/store whatever settings they need at init time # validate/store whatever settings they need at init time
@ -172,17 +171,17 @@ class Activity(DependencyComponent, Generic[PlayerType, TeamType]):
self._has_ended = False self._has_ended = False
self._activity_death_check_timer: Optional[ba.Timer] = None self._activity_death_check_timer: Optional[ba.Timer] = None
self._expired = False self._expired = False
self._delay_delete_players: List[PlayerType] = [] self._delay_delete_players: list[PlayerType] = []
self._delay_delete_teams: List[TeamType] = [] self._delay_delete_teams: list[TeamType] = []
self._players_that_left: List[ReferenceType[PlayerType]] = [] self._players_that_left: list[weakref.ref[PlayerType]] = []
self._teams_that_left: List[ReferenceType[TeamType]] = [] self._teams_that_left: list[weakref.ref[TeamType]] = []
self._transitioning_out = False self._transitioning_out = False
# A handy place to put most actors; this list is pruned of dead # A handy place to put most actors; this list is pruned of dead
# actors regularly and these actors are insta-killed as the activity # actors regularly and these actors are insta-killed as the activity
# is dying. # is dying.
self._actor_refs: List[ba.Actor] = [] self._actor_refs: list[ba.Actor] = []
self._actor_weak_refs: List[ReferenceType[ba.Actor]] = [] self._actor_weak_refs: list[weakref.ref[ba.Actor]] = []
self._last_prune_dead_actors_time = _ba.time() self._last_prune_dead_actors_time = _ba.time()
self._prune_dead_actors_timer: Optional[ba.Timer] = None self._prune_dead_actors_timer: Optional[ba.Timer] = None
@ -262,12 +261,12 @@ class Activity(DependencyComponent, Generic[PlayerType, TeamType]):
return self._expired return self._expired
@property @property
def playertype(self) -> Type[PlayerType]: def playertype(self) -> type[PlayerType]:
"""The type of ba.Player this Activity is using.""" """The type of ba.Player this Activity is using."""
return self._playertype return self._playertype
@property @property
def teamtype(self) -> Type[TeamType]: def teamtype(self) -> type[TeamType]:
"""The type of ba.Team this Activity is using.""" """The type of ba.Team this Activity is using."""
return self._teamtype return self._teamtype
@ -709,8 +708,8 @@ class Activity(DependencyComponent, Generic[PlayerType, TeamType]):
assert issubclass(self._teamtype, Team) assert issubclass(self._teamtype, Team)
@classmethod @classmethod
def _check_activity_death(cls, activity_ref: ReferenceType[Activity], def _check_activity_death(cls, activity_ref: weakref.ref[Activity],
counter: List[int]) -> None: counter: list[int]) -> None:
"""Sanity check to make sure an Activity was destroyed properly. """Sanity check to make sure an Activity was destroyed properly.
Receives a weakref to a ba.Activity which should have torn itself Receives a weakref to a ba.Activity which should have torn itself

View File

@ -14,7 +14,7 @@ from ba._player import EmptyPlayer # pylint: disable=W0611
from ba._team import EmptyTeam # pylint: disable=W0611 from ba._team import EmptyTeam # pylint: disable=W0611
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, Dict, Optional from typing import Optional
import ba import ba
from ba._lobby import JoinInfo from ba._lobby import JoinInfo

View File

@ -21,7 +21,7 @@ from ba._net import NetworkSubsystem
if TYPE_CHECKING: if TYPE_CHECKING:
import ba import ba
from bastd.actor import spazappearance from bastd.actor import spazappearance
from typing import Optional, Dict, Set, Any, Type, Tuple, Callable, List from typing import Optional, Any, Callable
class App: class App:
@ -167,7 +167,7 @@ class App:
return self._env['vr_mode'] return self._env['vr_mode']
@property @property
def ui_bounds(self) -> Tuple[float, float, float, float]: def ui_bounds(self) -> tuple[float, float, float, float]:
"""Bounds of the 'safe' screen area in ui space. """Bounds of the 'safe' screen area in ui space.
This tuple contains: (x-min, x-max, y-min, y-max) This tuple contains: (x-min, x-max, y-min, y-max)
@ -208,7 +208,7 @@ class App:
self.allow_ticket_purchases: bool = not self.iircade_mode self.allow_ticket_purchases: bool = not self.iircade_mode
# Misc. # Misc.
self.tips: List[str] = [] self.tips: list[str] = []
self.stress_test_reset_timer: Optional[ba.Timer] = None self.stress_test_reset_timer: Optional[ba.Timer] = None
self.did_weak_call_warning = False self.did_weak_call_warning = False
@ -225,7 +225,7 @@ class App:
self.input_map_hash: Optional[str] = None self.input_map_hash: Optional[str] = None
# Co-op Campaigns. # Co-op Campaigns.
self.campaigns: Dict[str, ba.Campaign] = {} self.campaigns: dict[str, ba.Campaign] = {}
# Server Mode. # Server Mode.
self.server: Optional[ba.ServerController] = None self.server: Optional[ba.ServerController] = None
@ -250,27 +250,27 @@ class App:
self.main_menu_last_news_fetch_time: Optional[float] = None self.main_menu_last_news_fetch_time: Optional[float] = None
# Spaz. # Spaz.
self.spaz_appearances: Dict[str, spazappearance.Appearance] = {} self.spaz_appearances: dict[str, spazappearance.Appearance] = {}
self.last_spaz_turbo_warn_time: float = -99999.0 self.last_spaz_turbo_warn_time: float = -99999.0
# Maps. # Maps.
self.maps: Dict[str, Type[ba.Map]] = {} self.maps: dict[str, type[ba.Map]] = {}
# Gameplay. # Gameplay.
self.teams_series_length = 7 self.teams_series_length = 7
self.ffa_series_length = 24 self.ffa_series_length = 24
self.coop_session_args: Dict = {} self.coop_session_args: dict = {}
self.value_test_defaults: dict = {} self.value_test_defaults: dict = {}
self.first_main_menu = True # FIXME: Move to mainmenu class. self.first_main_menu = True # FIXME: Move to mainmenu class.
self.did_menu_intro = False # FIXME: Move to mainmenu class. self.did_menu_intro = False # FIXME: Move to mainmenu class.
self.main_menu_window_refresh_check_count = 0 # FIXME: Mv to mainmenu. self.main_menu_window_refresh_check_count = 0 # FIXME: Mv to mainmenu.
self.main_menu_resume_callbacks: list = [] # Can probably go away. self.main_menu_resume_callbacks: list = [] # Can probably go away.
self.special_offer: Optional[Dict] = None self.special_offer: Optional[dict] = None
self.ping_thread_count = 0 self.ping_thread_count = 0
self.invite_confirm_windows: List[Any] = [] # FIXME: Don't use Any. self.invite_confirm_windows: list[Any] = [] # FIXME: Don't use Any.
self.store_layout: Optional[Dict[str, List[Dict[str, Any]]]] = None self.store_layout: Optional[dict[str, list[dict[str, Any]]]] = None
self.store_items: Optional[Dict[str, Dict]] = None self.store_items: Optional[dict[str, dict]] = None
self.pro_sale_start_time: Optional[int] = None self.pro_sale_start_time: Optional[int] = None
self.pro_sale_start_val: Optional[int] = None self.pro_sale_start_val: Optional[int] = None
@ -518,7 +518,7 @@ class App:
def launch_coop_game(self, def launch_coop_game(self,
game: str, game: str,
force: bool = False, force: bool = False,
args: Dict = None) -> bool: args: dict = None) -> bool:
"""High level way to launch a local co-op session.""" """High level way to launch a local co-op session."""
# pylint: disable=cyclic-import # pylint: disable=cyclic-import
from ba._campaign import getcampaign from ba._campaign import getcampaign

View File

@ -8,7 +8,7 @@ from typing import TYPE_CHECKING
import _ba import _ba
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, List, Tuple from typing import Any
class AppConfig(dict): class AppConfig(dict):
@ -57,7 +57,7 @@ class AppConfig(dict):
""" """
return _ba.get_appconfig_default_value(key) return _ba.get_appconfig_default_value(key)
def builtin_keys(self) -> List[str]: def builtin_keys(self) -> list[str]:
"""Return the list of valid key names recognized by ba.AppConfig. """Return the list of valid key names recognized by ba.AppConfig.
This set of keys can be used with resolve(), default_value(), etc. This set of keys can be used with resolve(), default_value(), etc.
@ -93,7 +93,7 @@ class AppConfig(dict):
self.commit() self.commit()
def read_config() -> Tuple[AppConfig, bool]: def read_config() -> tuple[AppConfig, bool]:
"""Read the game config.""" """Read the game config."""
import os import os
import json import json

View File

@ -6,7 +6,7 @@ from __future__ import annotations
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Type, Optional, Any, Dict, Callable from typing import Optional, Callable
import ba import ba
@ -17,8 +17,8 @@ class AppDelegate:
""" """
def create_default_game_settings_ui( def create_default_game_settings_ui(
self, gameclass: Type[ba.GameActivity], self, gameclass: type[ba.GameActivity],
sessiontype: Type[ba.Session], settings: Optional[dict], sessiontype: type[ba.Session], settings: Optional[dict],
completion_call: Callable[[Optional[dict]], None]) -> None: completion_call: Callable[[Optional[dict]], None]) -> None:
"""Launch a UI to configure the given game config. """Launch a UI to configure the given game config.

View File

@ -10,7 +10,7 @@ from typing import TYPE_CHECKING
import _ba import _ba
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import List, Any, Callable, Optional from typing import Any
import ba import ba
@ -186,9 +186,9 @@ def print_live_object_warnings(when: Any,
from ba._actor import Actor from ba._actor import Actor
from ba._activity import Activity from ba._activity import Activity
sessions: List[ba.Session] = [] sessions: list[ba.Session] = []
activities: List[ba.Activity] = [] activities: list[ba.Activity] = []
actors: List[ba.Actor] = [] actors: list[ba.Actor] = []
# Once we come across leaked stuff, printing again is probably # Once we come across leaked stuff, printing again is probably
# redundant. # redundant.

View File

@ -4,7 +4,7 @@
from __future__ import annotations from __future__ import annotations
from typing import TYPE_CHECKING, Dict from typing import TYPE_CHECKING, Annotated
from dataclasses import dataclass, field from dataclasses import dataclass, field
from pathlib import Path from pathlib import Path
import threading import threading
@ -15,14 +15,11 @@ import time
import os import os
import sys import sys
from typing_extensions import Annotated
from efro.dataclassio import (ioprepped, IOAttrs, dataclass_from_json, from efro.dataclassio import (ioprepped, IOAttrs, dataclass_from_json,
dataclass_to_json) dataclass_to_json)
if TYPE_CHECKING: if TYPE_CHECKING:
from bacommon.assets import AssetPackageFlavor from bacommon.assets import AssetPackageFlavor
from typing import List
@ioprepped @ioprepped
@ -36,7 +33,7 @@ class FileValue:
class State: class State:
"""Holds all persistent state for the asset-manager.""" """Holds all persistent state for the asset-manager."""
files: Annotated[Dict[str, FileValue], files: Annotated[dict[str, FileValue],
IOAttrs('files')] = field(default_factory=dict) IOAttrs('files')] = field(default_factory=dict)
@ -63,7 +60,7 @@ class AssetManager:
def launch_gather( def launch_gather(
self, self,
packages: List[str], packages: list[str],
flavor: AssetPackageFlavor, flavor: AssetPackageFlavor,
account_token: str, account_token: str,
) -> AssetGather: ) -> AssetGather:

View File

@ -9,7 +9,7 @@ from typing import TYPE_CHECKING
import _ba import _ba
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Dict, Any, Sequence from typing import Any, Sequence
import ba import ba
@ -88,7 +88,7 @@ def stop_stress_test() -> None:
_ba.app.stress_test_reset_timer = None _ba.app.stress_test_reset_timer = None
def start_stress_test(args: Dict[str, Any]) -> None: def start_stress_test(args: dict[str, Any]) -> None:
"""(internal)""" """(internal)"""
from ba._general import Call from ba._general import Call
from ba._dualteamsession import DualTeamSession from ba._dualteamsession import DualTeamSession
@ -125,7 +125,7 @@ def start_stress_test(args: Dict[str, Any]) -> None:
timeformat=TimeFormat.MILLISECONDS) timeformat=TimeFormat.MILLISECONDS)
def _reset_stress_test(args: Dict[str, Any]) -> None: def _reset_stress_test(args: dict[str, Any]) -> None:
from ba._general import Call from ba._general import Call
from ba._generated.enums import TimeType from ba._generated.enums import TimeType
_ba.set_stress_testing(False, args['player_count']) _ba.set_stress_testing(False, args['player_count'])

View File

@ -8,7 +8,7 @@ from typing import TYPE_CHECKING
import _ba import _ba
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, List, Dict from typing import Any
import ba import ba
@ -30,7 +30,7 @@ class Campaign:
def __init__(self, name: str, sequential: bool = True): def __init__(self, name: str, sequential: bool = True):
self._name = name self._name = name
self._levels: List[ba.Level] = [] self._levels: list[ba.Level] = []
self._sequential = sequential self._sequential = sequential
@property @property
@ -51,7 +51,7 @@ class Campaign:
self._levels.append(level) self._levels.append(level)
@property @property
def levels(self) -> List[ba.Level]: def levels(self) -> list[ba.Level]:
"""The list of ba.Levels in the Campaign.""" """The list of ba.Levels in the Campaign."""
return self._levels return self._levels
@ -80,9 +80,9 @@ class Campaign:
return self.configdict.get('Selection', self._levels[0].name) return self.configdict.get('Selection', self._levels[0].name)
@property @property
def configdict(self) -> Dict[str, Any]: def configdict(self) -> dict[str, Any]:
"""Return the live config dict for this campaign.""" """Return the live config dict for this campaign."""
val: Dict[str, Any] = (_ba.app.config.setdefault('Campaigns', val: dict[str, Any] = (_ba.app.config.setdefault('Campaigns',
{}).setdefault( {}).setdefault(
self._name, {})) self._name, {}))
assert isinstance(val, dict) assert isinstance(val, dict)

View File

@ -10,7 +10,7 @@ from ba._gameactivity import GameActivity
from ba._general import WeakCall from ba._general import WeakCall
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Type, Dict, Any, Set, List, Sequence, Optional from typing import Any, Sequence, Optional
from bastd.actor.playerspaz import PlayerSpaz from bastd.actor.playerspaz import PlayerSpaz
import ba import ba
@ -28,7 +28,7 @@ class CoopGameActivity(GameActivity[PlayerType, TeamType]):
session: ba.CoopSession session: ba.CoopSession
@classmethod @classmethod
def supports_session_type(cls, sessiontype: Type[ba.Session]) -> bool: def supports_session_type(cls, sessiontype: type[ba.Session]) -> bool:
from ba._coopsession import CoopSession from ba._coopsession import CoopSession
return issubclass(sessiontype, CoopSession) return issubclass(sessiontype, CoopSession)
@ -36,7 +36,7 @@ class CoopGameActivity(GameActivity[PlayerType, TeamType]):
super().__init__(settings) super().__init__(settings)
# Cache these for efficiency. # Cache these for efficiency.
self._achievements_awarded: Set[str] = set() self._achievements_awarded: set[str] = set()
self._life_warning_beep: Optional[ba.Actor] = None self._life_warning_beep: Optional[ba.Actor] = None
self._life_warning_beep_timer: Optional[ba.Timer] = None self._life_warning_beep_timer: Optional[ba.Timer] = None
@ -62,11 +62,11 @@ class CoopGameActivity(GameActivity[PlayerType, TeamType]):
_ba.get_scores_to_beat(levelname, config_str, _ba.get_scores_to_beat(levelname, config_str,
WeakCall(self._on_got_scores_to_beat)) WeakCall(self._on_got_scores_to_beat))
def _on_got_scores_to_beat(self, scores: List[Dict[str, Any]]) -> None: def _on_got_scores_to_beat(self, scores: list[dict[str, Any]]) -> None:
pass pass
def _show_standard_scores_to_beat_ui(self, def _show_standard_scores_to_beat_ui(self,
scores: List[Dict[str, Any]]) -> None: scores: list[dict[str, Any]]) -> None:
from efro.util import asserttype from efro.util import asserttype
from ba._gameutils import timestring, animate from ba._gameutils import timestring, animate
from ba._nodeactor import NodeActor from ba._nodeactor import NodeActor

View File

@ -9,7 +9,7 @@ import _ba
from ba._session import Session from ba._session import Session
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, List, Dict, Optional, Callable, Sequence from typing import Any, Optional, Callable, Sequence
import ba import ba
TEAM_COLORS = [(0.2, 0.4, 1.6)] TEAM_COLORS = [(0.2, 0.4, 1.6)]
@ -77,7 +77,7 @@ class CoopSession(Session):
self._ran_tutorial_activity = False self._ran_tutorial_activity = False
self._tutorial_activity: Optional[ba.Activity] = None self._tutorial_activity: Optional[ba.Activity] = None
self._custom_menu_ui: List[Dict[str, Any]] = [] self._custom_menu_ui: list[dict[str, Any]] = []
# Start our joining screen. # Start our joining screen.
self.setactivity(_ba.newactivity(CoopJoinActivity)) self.setactivity(_ba.newactivity(CoopJoinActivity))
@ -159,7 +159,7 @@ class CoopSession(Session):
from bastd.tutorial import TutorialActivity from bastd.tutorial import TutorialActivity
self._tutorial_activity = _ba.newactivity(TutorialActivity) self._tutorial_activity = _ba.newactivity(TutorialActivity)
def get_custom_menu_entries(self) -> List[Dict[str, Any]]: def get_custom_menu_entries(self) -> list[dict[str, Any]]:
return self._custom_menu_ui return self._custom_menu_ui
def on_player_leave(self, sessionplayer: ba.SessionPlayer) -> None: def on_player_leave(self, sessionplayer: ba.SessionPlayer) -> None:
@ -341,7 +341,7 @@ class CoopSession(Session):
self.setactivity(_ba.newactivity(TransitionActivity)) self.setactivity(_ba.newactivity(TransitionActivity))
else: else:
playerinfos: List[ba.PlayerInfo] playerinfos: list[ba.PlayerInfo]
# Generic team games. # Generic team games.
if isinstance(results, GameResults): if isinstance(results, GameResults):

View File

@ -10,8 +10,7 @@ from typing import (Generic, TypeVar, TYPE_CHECKING)
import _ba import _ba
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Optional, Any, Dict, List, Set, Type from typing import Optional, Any
from weakref import ReferenceType
import ba import ba
T = TypeVar('T', bound='DependencyComponent') T = TypeVar('T', bound='DependencyComponent')
@ -32,13 +31,13 @@ class Dependency(Generic[T]):
methods via self.floofcls(). methods via self.floofcls().
""" """
def __init__(self, cls: Type[T], config: Any = None): def __init__(self, cls: type[T], config: Any = None):
"""Instantiate a Dependency given a ba.DependencyComponent type. """Instantiate a Dependency given a ba.DependencyComponent type.
Optionally, an arbitrary object can be passed as 'config' to Optionally, an arbitrary object can be passed as 'config' to
influence dependency calculation for the target class. influence dependency calculation for the target class.
""" """
self.cls: Type[T] = cls self.cls: type[T] = cls
self.config = config self.config = config
self._hash: Optional[int] = None self._hash: Optional[int] = None
@ -91,7 +90,7 @@ class DependencyComponent:
category: Dependency Classes category: Dependency Classes
""" """
_dep_entry: ReferenceType[DependencyEntry] _dep_entry: weakref.ref[DependencyEntry]
def __init__(self) -> None: def __init__(self) -> None:
"""Instantiate a DependencyComponent.""" """Instantiate a DependencyComponent."""
@ -110,7 +109,7 @@ class DependencyComponent:
return True return True
@classmethod @classmethod
def get_dynamic_deps(cls, config: Any = None) -> List[Dependency]: def get_dynamic_deps(cls, config: Any = None) -> list[Dependency]:
"""Return any dynamically-calculated deps for this component/config. """Return any dynamically-calculated deps for this component/config.
Deps declared statically as part of the class do not need to be Deps declared statically as part of the class do not need to be
@ -180,7 +179,7 @@ class DependencySet(Generic[T]):
self._loaded = False self._loaded = False
# Dependency data indexed by hash. # Dependency data indexed by hash.
self.entries: Dict[int, DependencyEntry] = {} self.entries: dict[int, DependencyEntry] = {}
# def __del__(self) -> None: # def __del__(self) -> None:
# print("~DepSet()") # print("~DepSet()")
@ -220,12 +219,12 @@ class DependencySet(Generic[T]):
"""Whether this set has been successfully resolved.""" """Whether this set has been successfully resolved."""
return self._resolved return self._resolved
def get_asset_package_ids(self) -> Set[str]: def get_asset_package_ids(self) -> set[str]:
"""Return the set of asset-package-ids required by this dep-set. """Return the set of asset-package-ids required by this dep-set.
Must be called on a resolved dep-set. Must be called on a resolved dep-set.
""" """
ids: Set[str] = set() ids: set[str] = set()
if not self._resolved: if not self._resolved:
raise Exception('Must be called on a resolved dep-set.') raise Exception('Must be called on a resolved dep-set.')
for entry in self.entries.values(): for entry in self.entries.values():

View File

@ -9,7 +9,7 @@ from typing import TYPE_CHECKING
import _ba import _ba
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, List from typing import Any
import ba import ba
@ -21,12 +21,12 @@ class DependencyError(Exception):
(this will generally be missing assets). (this will generally be missing assets).
""" """
def __init__(self, deps: List[ba.Dependency]): def __init__(self, deps: list[ba.Dependency]):
super().__init__() super().__init__()
self._deps = deps self._deps = deps
@property @property
def deps(self) -> List[ba.Dependency]: def deps(self) -> list[ba.Dependency]:
"""The list of missing dependencies causing this error.""" """The list of missing dependencies causing this error."""
return self._deps return self._deps

View File

@ -10,7 +10,6 @@ import _ba
from ba._multiteamsession import MultiTeamSession from ba._multiteamsession import MultiTeamSession
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Dict
import ba import ba
@ -25,12 +24,12 @@ class FreeForAllSession(MultiTeamSession):
_playlist_randomize_var = 'Free-for-All Playlist Randomize' _playlist_randomize_var = 'Free-for-All Playlist Randomize'
_playlists_var = 'Free-for-All Playlists' _playlists_var = 'Free-for-All Playlists'
def get_ffa_point_awards(self) -> Dict[int, int]: def get_ffa_point_awards(self) -> dict[int, int]:
"""Return the number of points awarded for different rankings. """Return the number of points awarded for different rankings.
This is based on the current number of players. This is based on the current number of players.
""" """
point_awards: Dict[int, int] point_awards: dict[int, int]
if len(self.sessionplayers) == 1: if len(self.sessionplayers) == 1:
point_awards = {} point_awards = {}
elif len(self.sessionplayers) == 2: elif len(self.sessionplayers) == 2:

View File

@ -19,8 +19,7 @@ from ba._player import PlayerInfo
from ba import _map from ba import _map
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import (List, Optional, Dict, Type, Any, Callable, Sequence, from typing import Optional, Any, Callable, Sequence, Union
Tuple, Union)
from bastd.actor.playerspaz import PlayerSpaz from bastd.actor.playerspaz import PlayerSpaz
from bastd.actor.bomb import TNTSpawner from bastd.actor.bomb import TNTSpawner
import ba import ba
@ -37,7 +36,7 @@ class GameActivity(Activity[PlayerType, TeamType]):
# pylint: disable=too-many-public-methods # pylint: disable=too-many-public-methods
# Tips to be presented to the user at the start of the game. # Tips to be presented to the user at the start of the game.
tips: List[Union[str, ba.GameTip]] = [] tips: list[Union[str, ba.GameTip]] = []
# Default getname() will return this if not None. # Default getname() will return this if not None.
name: Optional[str] = None name: Optional[str] = None
@ -46,7 +45,7 @@ class GameActivity(Activity[PlayerType, TeamType]):
description: Optional[str] = None description: Optional[str] = None
# Default get_available_settings() will return this if not None. # Default get_available_settings() will return this if not None.
available_settings: Optional[List[ba.Setting]] = None available_settings: Optional[list[ba.Setting]] = None
# Default getscoreconfig() will return this if not None. # Default getscoreconfig() will return this if not None.
scoreconfig: Optional[ba.ScoreConfig] = None scoreconfig: Optional[ba.ScoreConfig] = None
@ -65,7 +64,7 @@ class GameActivity(Activity[PlayerType, TeamType]):
@classmethod @classmethod
def create_settings_ui( def create_settings_ui(
cls, cls,
sessiontype: Type[ba.Session], sessiontype: type[ba.Session],
settings: Optional[dict], settings: Optional[dict],
completion_call: Callable[[Optional[dict]], None], completion_call: Callable[[Optional[dict]], None],
) -> None: ) -> None:
@ -104,7 +103,7 @@ class GameActivity(Activity[PlayerType, TeamType]):
return cls.name if cls.name is not None else 'Untitled Game' return cls.name if cls.name is not None else 'Untitled Game'
@classmethod @classmethod
def get_display_string(cls, settings: Optional[Dict] = None) -> ba.Lstr: def get_display_string(cls, settings: Optional[dict] = None) -> ba.Lstr:
"""Return a descriptive name for this game/settings combo. """Return a descriptive name for this game/settings combo.
Subclasses should override getname(); not this. Subclasses should override getname(); not this.
@ -130,7 +129,7 @@ class GameActivity(Activity[PlayerType, TeamType]):
return Lstr(translate=('teamNames', name)) return Lstr(translate=('teamNames', name))
@classmethod @classmethod
def get_description(cls, sessiontype: Type[ba.Session]) -> str: def get_description(cls, sessiontype: type[ba.Session]) -> str:
"""Get a str description of this game type. """Get a str description of this game type.
The default implementation simply returns the 'description' class var. The default implementation simply returns the 'description' class var.
@ -142,7 +141,7 @@ class GameActivity(Activity[PlayerType, TeamType]):
@classmethod @classmethod
def get_description_display_string( def get_description_display_string(
cls, sessiontype: Type[ba.Session]) -> ba.Lstr: cls, sessiontype: type[ba.Session]) -> ba.Lstr:
"""Return a translated version of get_description(). """Return a translated version of get_description().
Sub-classes should override get_description(); not this. Sub-classes should override get_description(); not this.
@ -152,7 +151,7 @@ class GameActivity(Activity[PlayerType, TeamType]):
@classmethod @classmethod
def get_available_settings( def get_available_settings(
cls, sessiontype: Type[ba.Session]) -> List[ba.Setting]: cls, sessiontype: type[ba.Session]) -> list[ba.Setting]:
"""Return a list of settings relevant to this game type when """Return a list of settings relevant to this game type when
running under the provided session type. running under the provided session type.
""" """
@ -160,7 +159,7 @@ class GameActivity(Activity[PlayerType, TeamType]):
return [] if cls.available_settings is None else cls.available_settings return [] if cls.available_settings is None else cls.available_settings
@classmethod @classmethod
def get_supported_maps(cls, sessiontype: Type[ba.Session]) -> List[str]: def get_supported_maps(cls, sessiontype: type[ba.Session]) -> list[str]:
""" """
Called by the default ba.GameActivity.create_settings_ui() Called by the default ba.GameActivity.create_settings_ui()
implementation; should return a list of map names valid implementation; should return a list of map names valid
@ -170,7 +169,7 @@ class GameActivity(Activity[PlayerType, TeamType]):
return _map.getmaps('melee') return _map.getmaps('melee')
@classmethod @classmethod
def get_settings_display_string(cls, config: Dict[str, Any]) -> ba.Lstr: def get_settings_display_string(cls, config: dict[str, Any]) -> ba.Lstr:
"""Given a game config dict, return a short description for it. """Given a game config dict, return a short description for it.
This is used when viewing game-lists or showing what game This is used when viewing game-lists or showing what game
@ -200,7 +199,7 @@ class GameActivity(Activity[PlayerType, TeamType]):
return sval return sval
@classmethod @classmethod
def supports_session_type(cls, sessiontype: Type[ba.Session]) -> bool: def supports_session_type(cls, sessiontype: type[ba.Session]) -> bool:
"""Return whether this game supports the provided Session type.""" """Return whether this game supports the provided Session type."""
from ba._multiteamsession import MultiTeamSession from ba._multiteamsession import MultiTeamSession
@ -213,7 +212,7 @@ class GameActivity(Activity[PlayerType, TeamType]):
# Holds some flattened info about the player set at the point # Holds some flattened info about the player set at the point
# when on_begin() is called. # when on_begin() is called.
self.initialplayerinfos: Optional[List[ba.PlayerInfo]] = None self.initialplayerinfos: Optional[list[ba.PlayerInfo]] = None
# Go ahead and get our map loading. # Go ahead and get our map loading.
self._map_type = _map.get_map_class(self._calc_map_name(settings)) self._map_type = _map.get_map_class(self._calc_map_name(settings))
@ -222,7 +221,7 @@ class GameActivity(Activity[PlayerType, TeamType]):
self._map_type.preload() self._map_type.preload()
self._map: Optional[ba.Map] = None self._map: Optional[ba.Map] = None
self._powerup_drop_timer: Optional[ba.Timer] = None self._powerup_drop_timer: Optional[ba.Timer] = None
self._tnt_spawners: Optional[Dict[int, TNTSpawner]] = None self._tnt_spawners: Optional[dict[int, TNTSpawner]] = None
self._tnt_drop_timer: Optional[ba.Timer] = None self._tnt_drop_timer: Optional[ba.Timer] = None
self._game_scoreboard_name_text: Optional[ba.Actor] = None self._game_scoreboard_name_text: Optional[ba.Actor] = None
self._game_scoreboard_description_text: Optional[ba.Actor] = None self._game_scoreboard_description_text: Optional[ba.Actor] = None
@ -235,7 +234,7 @@ class GameActivity(Activity[PlayerType, TeamType]):
self._tournament_time_limit_title_text: Optional[ba.NodeActor] = None self._tournament_time_limit_title_text: Optional[ba.NodeActor] = None
self._tournament_time_limit_text: Optional[ba.NodeActor] = None self._tournament_time_limit_text: Optional[ba.NodeActor] = None
self._tournament_time_limit_text_input: Optional[ba.NodeActor] = None self._tournament_time_limit_text_input: Optional[ba.NodeActor] = None
self._zoom_message_times: Dict[int, float] = {} self._zoom_message_times: dict[int, float] = {}
self._is_waiting_for_continue = False self._is_waiting_for_continue = False
self._continue_cost = _ba.get_account_misc_read_val( self._continue_cost = _ba.get_account_misc_read_val(
@ -459,7 +458,7 @@ class GameActivity(Activity[PlayerType, TeamType]):
callback=WeakCall(self._on_tournament_query_response), callback=WeakCall(self._on_tournament_query_response),
) )
def _on_tournament_query_response(self, data: Optional[Dict[str, def _on_tournament_query_response(self, data: Optional[dict[str,
Any]]) -> None: Any]]) -> None:
if data is not None: if data is not None:
data_t = data['t'] # This used to be the whole payload. data_t = data['t'] # This used to be the whole payload.
@ -1154,7 +1153,7 @@ class GameActivity(Activity[PlayerType, TeamType]):
# If settings doesn't specify a map, pick a random one from the # If settings doesn't specify a map, pick a random one from the
# list of supported ones. # list of supported ones.
unowned_maps = _map.get_unowned_maps() unowned_maps = _map.get_unowned_maps()
valid_maps: List[str] = [ valid_maps: list[str] = [
m for m in self.get_supported_maps(type(self.session)) m for m in self.get_supported_maps(type(self.session))
if m not in unowned_maps if m not in unowned_maps
] ]

View File

@ -12,8 +12,7 @@ from efro.util import asserttype
from ba._team import Team, SessionTeam from ba._team import Team, SessionTeam
if TYPE_CHECKING: if TYPE_CHECKING:
from weakref import ReferenceType from typing import Sequence, Optional
from typing import Sequence, Tuple, Any, Optional, Dict, List, Union
import ba import ba
@ -36,11 +35,10 @@ class GameResults:
def __init__(self) -> None: def __init__(self) -> None:
self._game_set = False self._game_set = False
self._scores: Dict[int, Tuple[ReferenceType[ba.SessionTeam], self._scores: dict[int, tuple[weakref.ref[ba.SessionTeam],
Optional[int]]] = {} Optional[int]]] = {}
self._sessionteams: Optional[List[ReferenceType[ self._sessionteams: Optional[list[weakref.ref[ba.SessionTeam]]] = None
ba.SessionTeam]]] = None self._playerinfos: Optional[list[ba.PlayerInfo]] = None
self._playerinfos: Optional[List[ba.PlayerInfo]] = None
self._lower_is_better: Optional[bool] = None self._lower_is_better: Optional[bool] = None
self._score_label: Optional[str] = None self._score_label: Optional[str] = None
self._none_is_winner: Optional[bool] = None self._none_is_winner: Optional[bool] = None
@ -83,7 +81,7 @@ class GameResults:
return None return None
@property @property
def sessionteams(self) -> List[ba.SessionTeam]: def sessionteams(self) -> list[ba.SessionTeam]:
"""Return all ba.SessionTeams in the results.""" """Return all ba.SessionTeams in the results."""
if not self._game_set: if not self._game_set:
raise RuntimeError("Can't get teams until game is set.") raise RuntimeError("Can't get teams until game is set.")
@ -127,7 +125,7 @@ class GameResults:
return Lstr(value='-') return Lstr(value='-')
@property @property
def playerinfos(self) -> List[ba.PlayerInfo]: def playerinfos(self) -> list[ba.PlayerInfo]:
"""Get info about the players represented by the results.""" """Get info about the players represented by the results."""
if not self._game_set: if not self._game_set:
raise RuntimeError("Can't get player-info until game is set.") raise RuntimeError("Can't get player-info until game is set.")
@ -169,13 +167,13 @@ class GameResults:
return None return None
@property @property
def winnergroups(self) -> List[WinnerGroup]: def winnergroups(self) -> list[WinnerGroup]:
"""Get an ordered list of winner groups.""" """Get an ordered list of winner groups."""
if not self._game_set: if not self._game_set:
raise RuntimeError("Can't get winners until game is set.") raise RuntimeError("Can't get winners until game is set.")
# Group by best scoring teams. # Group by best scoring teams.
winners: Dict[int, List[ba.SessionTeam]] = {} winners: dict[int, list[ba.SessionTeam]] = {}
scores = [ scores = [
score for score in self._scores.values() score for score in self._scores.values()
if score[0]() is not None and score[1] is not None if score[0]() is not None and score[1] is not None
@ -186,13 +184,13 @@ class GameResults:
team = score[0]() team = score[0]()
assert team is not None assert team is not None
sval.append(team) sval.append(team)
results: List[Tuple[Optional[int], results: list[tuple[Optional[int],
List[ba.SessionTeam]]] = list(winners.items()) list[ba.SessionTeam]]] = list(winners.items())
results.sort(reverse=not self._lower_is_better, results.sort(reverse=not self._lower_is_better,
key=lambda x: asserttype(x[0], int)) key=lambda x: asserttype(x[0], int))
# Also group the 'None' scores. # Also group the 'None' scores.
none_sessionteams: List[ba.SessionTeam] = [] none_sessionteams: list[ba.SessionTeam] = []
for score in self._scores.values(): for score in self._scores.values():
scoreteam = score[0]() scoreteam = score[0]()
if scoreteam is not None and score[1] is None: if scoreteam is not None and score[1] is None:
@ -201,7 +199,7 @@ class GameResults:
# Add the Nones to the list (either as winners or losers # Add the Nones to the list (either as winners or losers
# depending on the rules). # depending on the rules).
if none_sessionteams: if none_sessionteams:
nones: List[Tuple[Optional[int], List[ba.SessionTeam]]] = [ nones: list[tuple[Optional[int], list[ba.SessionTeam]]] = [
(None, none_sessionteams) (None, none_sessionteams)
] ]
if self._none_is_winner: if self._none_is_winner:

View File

@ -12,7 +12,7 @@ from ba._generated.enums import TimeType, TimeFormat, SpecialChar, UIScale
from ba._error import ActivityNotFoundError from ba._error import ActivityNotFoundError
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, Dict, Sequence, Optional from typing import Sequence, Optional
import ba import ba
TROPHY_CHARS = { TROPHY_CHARS = {
@ -45,7 +45,7 @@ def get_trophy_string(trophy_id: str) -> str:
def animate(node: ba.Node, def animate(node: ba.Node,
attr: str, attr: str,
keys: Dict[float, float], keys: dict[float, float],
loop: bool = False, loop: bool = False,
offset: float = 0, offset: float = 0,
timetype: ba.TimeType = TimeType.SIM, timetype: ba.TimeType = TimeType.SIM,
@ -119,7 +119,7 @@ def animate(node: ba.Node,
def animate_array(node: ba.Node, def animate_array(node: ba.Node,
attr: str, attr: str,
size: int, size: int,
keys: Dict[float, Sequence[float]], keys: dict[float, Sequence[float]],
loop: bool = False, loop: bool = False,
offset: float = 0, offset: float = 0,
timetype: ba.TimeType = TimeType.SIM, timetype: ba.TimeType = TimeType.SIM,

View File

@ -17,9 +17,8 @@ from ba._generated.enums import TimeType
if TYPE_CHECKING: if TYPE_CHECKING:
from types import FrameType from types import FrameType
from typing import Any, Type, Optional from typing import Any, Optional
from efro.call import Call as Call # 'as Call' so we re-export. from efro.call import Call as Call # 'as Call' so we re-export.
from weakref import ReferenceType
class Existable(Protocol): class Existable(Protocol):
@ -57,7 +56,7 @@ def existing(obj: Optional[ExistableType]) -> Optional[ExistableType]:
return obj if obj is not None and obj.exists() else None return obj if obj is not None and obj.exists() else None
def getclass(name: str, subclassof: Type[T]) -> Type[T]: def getclass(name: str, subclassof: type[T]) -> type[T]:
"""Given a full class name such as foo.bar.MyClass, return the class. """Given a full class name such as foo.bar.MyClass, return the class.
Category: General Utility Functions Category: General Utility Functions
@ -70,7 +69,7 @@ def getclass(name: str, subclassof: Type[T]) -> Type[T]:
modulename = '.'.join(splits[:-1]) modulename = '.'.join(splits[:-1])
classname = splits[-1] classname = splits[-1]
module = importlib.import_module(modulename) module = importlib.import_module(modulename)
cls: Type = getattr(module, classname) cls: type = getattr(module, classname)
if not issubclass(cls, subclassof): if not issubclass(cls, subclassof):
raise TypeError(f'{name} is not a subclass of {subclassof}.') raise TypeError(f'{name} is not a subclass of {subclassof}.')
@ -133,7 +132,7 @@ def print_refs(obj: Any) -> None:
i += 1 i += 1
def get_type_name(cls: Type) -> str: def get_type_name(cls: type) -> str:
"""Return a full type name including module for a class.""" """Return a full type name including module for a class."""
return cls.__module__ + '.' + cls.__name__ return cls.__module__ + '.' + cls.__name__
@ -343,7 +342,7 @@ def print_active_refs(obj: Any) -> None:
f' {ref4}{Clr.RST}') f' {ref4}{Clr.RST}')
def _verify_object_death(wref: ReferenceType) -> None: def _verify_object_death(wref: weakref.ref) -> None:
obj = wref() obj = wref()
if obj is None: if obj is None:
return return

View File

@ -18,7 +18,7 @@ from typing import TYPE_CHECKING
import _ba import _ba
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import List, Sequence, Optional, Dict, Any from typing import Sequence, Optional, Any
import ba import ba
@ -339,7 +339,7 @@ def local_chat_message(msg: str) -> None:
_ba.app.ui.party_window().on_chat_message(msg) _ba.app.ui.party_window().on_chat_message(msg)
def get_player_icon(sessionplayer: ba.SessionPlayer) -> Dict[str, Any]: def get_player_icon(sessionplayer: ba.SessionPlayer) -> dict[str, Any]:
info = sessionplayer.get_icon_info() info = sessionplayer.get_icon_info()
return { return {
'texture': _ba.gettexture(info['texture']), 'texture': _ba.gettexture(info['texture']),

View File

@ -8,7 +8,7 @@ from typing import TYPE_CHECKING
import _ba import _ba
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, Dict, Tuple from typing import Any
import ba import ba
@ -601,14 +601,14 @@ def get_input_map_hash(inputdevice: ba.InputDevice) -> str:
def get_input_device_config(device: ba.InputDevice, def get_input_device_config(device: ba.InputDevice,
default: bool) -> Tuple[Dict, str]: default: bool) -> tuple[dict, str]:
"""Given an input device, return its config dict in the app config. """Given an input device, return its config dict in the app config.
The dict will be created if it does not exist. The dict will be created if it does not exist.
""" """
cfg = _ba.app.config cfg = _ba.app.config
name = device.name name = device.name
ccfgs: Dict[str, Any] = cfg.setdefault('Controllers', {}) ccfgs: dict[str, Any] = cfg.setdefault('Controllers', {})
ccfgs.setdefault(name, {}) ccfgs.setdefault(name, {})
unique_id = device.unique_identifier unique_id = device.unique_identifier
if default: if default:

View File

@ -7,7 +7,7 @@ from __future__ import annotations
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import List, Tuple, Dict pass
class Keyboard: class Keyboard:
@ -30,6 +30,6 @@ class Keyboard:
""" """
name: str name: str
chars: List[Tuple[str, ...]] chars: list[tuple[str, ...]]
pages: Dict[str, Tuple[str, ...]] pages: dict[str, tuple[str, ...]]
nums: Tuple[str, ...] nums: tuple[str, ...]

View File

@ -11,7 +11,7 @@ import _ba
if TYPE_CHECKING: if TYPE_CHECKING:
import ba import ba
from typing import Any, Dict, List, Optional, Tuple, Union, Sequence from typing import Any, Optional, Union, Sequence
class LanguageSubsystem: class LanguageSubsystem:
@ -109,7 +109,7 @@ class LanguageSubsystem:
return _ba.app.config.get('Lang', self.default_language) return _ba.app.config.get('Lang', self.default_language)
@property @property
def available_languages(self) -> List[str]: def available_languages(self) -> list[str]:
"""A list of all available languages. """A list of all available languages.
Note that languages that may be present in game assets but which Note that languages that may be present in game assets but which
@ -402,7 +402,7 @@ class Lstr:
resource: str, resource: str,
fallback_resource: str = '', fallback_resource: str = '',
fallback_value: str = '', fallback_value: str = '',
subs: Sequence[Tuple[str, Union[str, Lstr]]] = []) -> None: subs: Sequence[tuple[str, Union[str, Lstr]]] = []) -> None:
"""Create an Lstr from a string resource.""" """Create an Lstr from a string resource."""
... ...
@ -410,8 +410,8 @@ class Lstr:
@overload @overload
def __init__(self, def __init__(self,
*, *,
translate: Tuple[str, str], translate: tuple[str, str],
subs: Sequence[Tuple[str, Union[str, Lstr]]] = []) -> None: subs: Sequence[tuple[str, Union[str, Lstr]]] = []) -> None:
"""Create an Lstr by translating a string in a category.""" """Create an Lstr by translating a string in a category."""
... ...
@ -420,7 +420,7 @@ class Lstr:
def __init__(self, def __init__(self,
*, *,
value: str, value: str,
subs: Sequence[Tuple[str, Union[str, Lstr]]] = []) -> None: subs: Sequence[tuple[str, Union[str, Lstr]]] = []) -> None:
"""Create an Lstr from a raw string value.""" """Create an Lstr from a raw string value."""
... ...
@ -531,7 +531,7 @@ class Lstr:
return lstr return lstr
def _add_to_attr_dict(dst: AttrDict, src: Dict) -> None: def _add_to_attr_dict(dst: AttrDict, src: dict) -> None:
for key, value in list(src.items()): for key, value in list(src.items()):
if isinstance(value, dict): if isinstance(value, dict):
try: try:

View File

@ -10,8 +10,7 @@ from typing import TYPE_CHECKING
import _ba import _ba
if TYPE_CHECKING: if TYPE_CHECKING:
from weakref import ReferenceType from typing import Any, Optional
from typing import Type, Any, Dict, Optional
import ba import ba
@ -23,7 +22,7 @@ class Level:
def __init__(self, def __init__(self,
name: str, name: str,
gametype: Type[ba.GameActivity], gametype: type[ba.GameActivity],
settings: dict, settings: dict,
preview_texture_name: str, preview_texture_name: str,
displayname: str = None): displayname: str = None):
@ -32,7 +31,7 @@ class Level:
self._settings = settings self._settings = settings
self._preview_texture_name = preview_texture_name self._preview_texture_name = preview_texture_name
self._displayname = displayname self._displayname = displayname
self._campaign: Optional[ReferenceType[ba.Campaign]] = None self._campaign: Optional[weakref.ref[ba.Campaign]] = None
self._index: Optional[int] = None self._index: Optional[int] = None
self._score_version_string: Optional[str] = None self._score_version_string: Optional[str] = None
@ -45,7 +44,7 @@ class Level:
"""The unique name for this Level.""" """The unique name for this Level."""
return self._name return self._name
def get_settings(self) -> Dict[str, Any]: def get_settings(self) -> dict[str, Any]:
"""Returns the settings for this Level.""" """Returns the settings for this Level."""
settings = copy.deepcopy(self._settings) settings = copy.deepcopy(self._settings)
@ -74,7 +73,7 @@ class Level:
self._gametype.get_display_string(self._settings))]) self._gametype.get_display_string(self._settings))])
@property @property
def gametype(self) -> Type[ba.GameActivity]: def gametype(self) -> type[ba.GameActivity]:
"""The type of game used for this Level.""" """The type of game used for this Level."""
return self._gametype return self._gametype
@ -117,7 +116,7 @@ class Level:
return {} return {}
return copy.deepcopy(config[high_scores_key]) return copy.deepcopy(config[high_scores_key])
def set_high_scores(self, high_scores: Dict) -> None: def set_high_scores(self, high_scores: dict) -> None:
"""Set high scores for this level.""" """Set high scores for this level."""
config = self._get_config_dict() config = self._get_config_dict()
high_scores_key = 'High Scores' + self.get_score_version_string() high_scores_key = 'High Scores' + self.get_score_version_string()
@ -148,7 +147,7 @@ class Level:
config = self._get_config_dict() config = self._get_config_dict()
config['Rating'] = max(old_rating, rating) config['Rating'] = max(old_rating, rating)
def _get_config_dict(self) -> Dict[str, Any]: def _get_config_dict(self) -> dict[str, Any]:
"""Return/create the persistent state dict for this level. """Return/create the persistent state dict for this level.
The referenced dict exists under the game's config dict and The referenced dict exists under the game's config dict and
@ -157,7 +156,7 @@ class Level:
if campaign is None: if campaign is None:
raise RuntimeError('Level is not in a campaign.') raise RuntimeError('Level is not in a campaign.')
configdict = campaign.configdict configdict = campaign.configdict
val: Dict[str, Any] = configdict.setdefault(self._name, { val: dict[str, Any] = configdict.setdefault(self._name, {
'Rating': 0.0, 'Rating': 0.0,
'Complete': False 'Complete': False
}) })

View File

@ -16,7 +16,7 @@ from ba._generated.enums import SpecialChar, InputType
from ba._profile import get_player_profile_colors from ba._profile import get_player_profile_colors
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Optional, List, Dict, Any, Sequence, Union from typing import Optional, Any, Sequence, Union
import ba import ba
MAX_QUICK_CHANGE_COUNT = 30 MAX_QUICK_CHANGE_COUNT = 30
@ -152,11 +152,11 @@ class Chooser:
self._dead = False self._dead = False
self._text_node: Optional[ba.Node] = None self._text_node: Optional[ba.Node] = None
self._profilename = '' self._profilename = ''
self._profilenames: List[str] = [] self._profilenames: list[str] = []
self._ready: bool = False self._ready: bool = False
self._character_names: List[str] = [] self._character_names: list[str] = []
self._last_change: Sequence[Union[float, int]] = (0, 0) self._last_change: Sequence[Union[float, int]] = (0, 0)
self._profiles: Dict[str, Dict[str, Any]] = {} self._profiles: dict[str, dict[str, Any]] = {}
app = _ba.app app = _ba.app
@ -835,11 +835,11 @@ class Lobby:
self._dummy_teams = SessionTeam() self._dummy_teams = SessionTeam()
self._sessionteams = [weakref.ref(self._dummy_teams)] self._sessionteams = [weakref.ref(self._dummy_teams)]
v_offset = (-150 if isinstance(session, CoopSession) else -50) v_offset = (-150 if isinstance(session, CoopSession) else -50)
self.choosers: List[Chooser] = [] self.choosers: list[Chooser] = []
self.base_v_offset = v_offset self.base_v_offset = v_offset
self.update_positions() self.update_positions()
self._next_add_team = 0 self._next_add_team = 0
self.character_names_local_unlocked: List[str] = [] self.character_names_local_unlocked: list[str] = []
self._vpos = 0 self._vpos = 0
# Grab available profiles. # Grab available profiles.
@ -861,7 +861,7 @@ class Lobby:
return self._use_team_colors return self._use_team_colors
@property @property
def sessionteams(self) -> List[ba.SessionTeam]: def sessionteams(self) -> list[ba.SessionTeam]:
"""ba.SessionTeams available in this lobby.""" """ba.SessionTeams available in this lobby."""
allteams = [] allteams = []
for tref in self._sessionteams: for tref in self._sessionteams:
@ -870,7 +870,7 @@ class Lobby:
allteams.append(team) allteams.append(team)
return allteams return allteams
def get_choosers(self) -> List[Chooser]: def get_choosers(self) -> list[Chooser]:
"""Return the lobby's current choosers.""" """Return the lobby's current choosers."""
return self.choosers return self.choosers

View File

@ -11,7 +11,7 @@ from ba import _math
from ba._actor import Actor from ba._actor import Actor
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Set, List, Type, Optional, Sequence, Any, Tuple from typing import Optional, Sequence, Any
import ba import ba
@ -52,7 +52,7 @@ def get_map_display_string(name: str) -> ba.Lstr:
return _language.Lstr(translate=('mapsNames', name)) return _language.Lstr(translate=('mapsNames', name))
def getmaps(playtype: str) -> List[str]: def getmaps(playtype: str) -> list[str]:
"""Return a list of ba.Map types supporting a playtype str. """Return a list of ba.Map types supporting a playtype str.
Category: Asset Functions Category: Asset Functions
@ -101,13 +101,13 @@ def getmaps(playtype: str) -> List[str]:
if playtype in val.get_play_types()) if playtype in val.get_play_types())
def get_unowned_maps() -> List[str]: def get_unowned_maps() -> list[str]:
"""Return the list of local maps not owned by the current account. """Return the list of local maps not owned by the current account.
Category: Asset Functions Category: Asset Functions
""" """
from ba import _store from ba import _store
unowned_maps: Set[str] = set() unowned_maps: set[str] = set()
if not _ba.app.headless_mode: if not _ba.app.headless_mode:
for map_section in _store.get_store_layout()['maps']: for map_section in _store.get_store_layout()['maps']:
for mapitem in map_section['items']: for mapitem in map_section['items']:
@ -117,7 +117,7 @@ def get_unowned_maps() -> List[str]:
return sorted(unowned_maps) return sorted(unowned_maps)
def get_map_class(name: str) -> Type[ba.Map]: def get_map_class(name: str) -> type[ba.Map]:
"""Return a map type given a name. """Return a map type given a name.
Category: Asset Functions Category: Asset Functions
@ -140,7 +140,7 @@ class Map(Actor):
""" """
defs: Any = None defs: Any = None
name = 'Map' name = 'Map'
_playtypes: List[str] = [] _playtypes: list[str] = []
@classmethod @classmethod
def preload(cls) -> None: def preload(cls) -> None:
@ -156,7 +156,7 @@ class Map(Actor):
activity.preloads[cls] = cls.on_preload() activity.preloads[cls] = cls.on_preload()
@classmethod @classmethod
def get_play_types(cls) -> List[str]: def get_play_types(cls) -> list[str]:
"""Return valid play types for this map.""" """Return valid play types for this map."""
return [] return []
@ -296,7 +296,7 @@ class Map(Actor):
def get_def_bound_box( def get_def_bound_box(
self, name: str self, name: str
) -> Optional[Tuple[float, float, float, float, float, float]]: ) -> Optional[tuple[float, float, float, float, float, float]]:
"""Return a 6 member bounds tuple or None if it is not defined.""" """Return a 6 member bounds tuple or None if it is not defined."""
try: try:
box = self.defs.boxes[name] box = self.defs.boxes[name]
@ -312,7 +312,7 @@ class Map(Actor):
return (None if val is None else return (None if val is None else
_math.vec3validate(val) if __debug__ else val) _math.vec3validate(val) if __debug__ else val)
def get_def_points(self, name: str) -> List[Sequence[float]]: def get_def_points(self, name: str) -> list[Sequence[float]]:
"""Return a list of named points. """Return a list of named points.
Return as many sequential ones are defined (flag1, flag2, flag3), etc. Return as many sequential ones are defined (flag1, flag2, flag3), etc.
@ -408,7 +408,7 @@ class Map(Actor):
return None return None
def register_map(maptype: Type[Map]) -> None: def register_map(maptype: type[Map]) -> None:
"""Register a map class with the game.""" """Register a map class with the game."""
if maptype.name in _ba.app.maps: if maptype.name in _ba.app.maps:
raise RuntimeError('map "' + maptype.name + '" already registered') raise RuntimeError('map "' + maptype.name + '" already registered')

View File

@ -8,7 +8,7 @@ from collections import abc
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Tuple, Sequence from typing import Sequence
def vec3validate(value: Sequence[float]) -> Sequence[float]: def vec3validate(value: Sequence[float]) -> Sequence[float]:
@ -45,7 +45,7 @@ def is_point_in_box(pnt: Sequence[float], box: Sequence[float]) -> bool:
and (abs(pnt[2] - box[2]) <= box[8] * 0.5)) and (abs(pnt[2] - box[2]) <= box[8] * 0.5))
def normalized_color(color: Sequence[float]) -> Tuple[float, ...]: def normalized_color(color: Sequence[float]) -> tuple[float, ...]:
"""Scale a color so its largest value is 1; useful for coloring lights. """Scale a color so its largest value is 1; useful for coloring lights.
category: General Utility Functions category: General Utility Functions

View File

@ -11,7 +11,7 @@ from enum import Enum
import _ba import _ba
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Sequence, Optional, Type, Any from typing import Sequence, Optional, Any
import ba import ba
@ -105,7 +105,7 @@ class PlayerDiedMessage:
self.how = how self.how = how
def getkillerplayer(self, def getkillerplayer(self,
playertype: Type[PlayerType]) -> Optional[PlayerType]: playertype: type[PlayerType]) -> Optional[PlayerType]:
"""Return the ba.Player responsible for the killing, if any. """Return the ba.Player responsible for the killing, if any.
Pass the Player type being used by the current game. Pass the Player type being used by the current game.
@ -113,7 +113,7 @@ class PlayerDiedMessage:
assert isinstance(self._killerplayer, (playertype, type(None))) assert isinstance(self._killerplayer, (playertype, type(None)))
return self._killerplayer return self._killerplayer
def getplayer(self, playertype: Type[PlayerType]) -> PlayerType: def getplayer(self, playertype: type[PlayerType]) -> PlayerType:
"""Return the ba.Player that died. """Return the ba.Player that died.
The type of player for the current activity should be passed so that The type of player for the current activity should be passed so that
@ -294,7 +294,7 @@ class HitMessage:
if force_direction is not None else velocity) if force_direction is not None else velocity)
def get_source_player( def get_source_player(
self, playertype: Type[PlayerType]) -> Optional[PlayerType]: self, playertype: type[PlayerType]) -> Optional[PlayerType]:
"""Return the source-player if one exists and is the provided type.""" """Return the source-player if one exists and is the provided type."""
player: Any = self._source_player player: Any = self._source_player

View File

@ -14,7 +14,7 @@ from dataclasses import dataclass, field
import _ba import _ba
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Dict, List, Tuple, Union, Optional, Type, Set from typing import Union, Optional
import ba import ba
# The meta api version of this build of the game. # The meta api version of this build of the game.
@ -27,9 +27,9 @@ CURRENT_API_VERSION = 6
@dataclass @dataclass
class ScanResults: class ScanResults:
"""Final results from a metadata scan.""" """Final results from a metadata scan."""
games: List[str] = field(default_factory=list) games: list[str] = field(default_factory=list)
plugins: List[str] = field(default_factory=list) plugins: list[str] = field(default_factory=list)
keyboards: List[str] = field(default_factory=list) keyboards: list[str] = field(default_factory=list)
errors: str = '' errors: str = ''
warnings: str = '' warnings: str = ''
@ -89,7 +89,7 @@ class MetadataSubsystem:
plugs = _ba.app.plugins plugs = _ba.app.plugins
config_changed = False config_changed = False
found_new = False found_new = False
plugstates: Dict[str, Dict] = _ba.app.config.setdefault('Plugins', {}) plugstates: dict[str, dict] = _ba.app.config.setdefault('Plugins', {})
assert isinstance(plugstates, dict) assert isinstance(plugstates, dict)
# Create a potential-plugin for each class we found in the scan. # Create a potential-plugin for each class we found in the scan.
@ -151,7 +151,7 @@ class MetadataSubsystem:
'timeout waiting for meta scan to complete.') 'timeout waiting for meta scan to complete.')
return self.metascan return self.metascan
def get_game_types(self) -> List[Type[ba.GameActivity]]: def get_game_types(self) -> list[type[ba.GameActivity]]:
"""Return available game types.""" """Return available game types."""
from ba._general import getclass from ba._general import getclass
from ba._gameactivity import GameActivity from ba._gameactivity import GameActivity
@ -167,11 +167,11 @@ class MetadataSubsystem:
unowned = self.get_unowned_game_types() unowned = self.get_unowned_game_types()
return [cls for cls in gameclasses if cls not in unowned] return [cls for cls in gameclasses if cls not in unowned]
def get_unowned_game_types(self) -> Set[Type[ba.GameActivity]]: def get_unowned_game_types(self) -> set[type[ba.GameActivity]]:
"""Return present game types not owned by the current account.""" """Return present game types not owned by the current account."""
try: try:
from ba import _store from ba import _store
unowned_games: Set[Type[ba.GameActivity]] = set() unowned_games: set[type[ba.GameActivity]] = set()
if not _ba.app.headless_mode: if not _ba.app.headless_mode:
for section in _store.get_store_layout()['minigames']: for section in _store.get_store_layout()['minigames']:
for mname in section['items']: for mname in section['items']:
@ -188,7 +188,7 @@ class MetadataSubsystem:
class ScanThread(threading.Thread): class ScanThread(threading.Thread):
"""Thread to scan script dirs for metadata.""" """Thread to scan script dirs for metadata."""
def __init__(self, dirs: List[str]): def __init__(self, dirs: list[str]):
super().__init__() super().__init__()
self._dirs = dirs self._dirs = dirs
@ -215,7 +215,7 @@ class ScanThread(threading.Thread):
class DirectoryScan: class DirectoryScan:
"""Handles scanning directories for metadata.""" """Handles scanning directories for metadata."""
def __init__(self, paths: List[str]): def __init__(self, paths: list[str]):
"""Given one or more paths, parses available meta information. """Given one or more paths, parses available meta information.
It is assumed that these paths are also in PYTHONPATH. It is assumed that these paths are also in PYTHONPATH.
@ -228,7 +228,7 @@ class DirectoryScan:
def _get_path_module_entries( def _get_path_module_entries(
self, path: pathlib.Path, subpath: Union[str, pathlib.Path], self, path: pathlib.Path, subpath: Union[str, pathlib.Path],
modules: List[Tuple[pathlib.Path, pathlib.Path]]) -> None: modules: list[tuple[pathlib.Path, pathlib.Path]]) -> None:
"""Scan provided path and add module entries to provided list.""" """Scan provided path and add module entries to provided list."""
try: try:
# Special case: let's save some time and skip the whole 'ba' # Special case: let's save some time and skip the whole 'ba'
@ -254,7 +254,7 @@ class DirectoryScan:
def scan(self) -> None: def scan(self) -> None:
"""Scan provided paths.""" """Scan provided paths."""
modules: List[Tuple[pathlib.Path, pathlib.Path]] = [] modules: list[tuple[pathlib.Path, pathlib.Path]] = []
for path in self.paths: for path in self.paths:
self._get_path_module_entries(path, '', modules) self._get_path_module_entries(path, '', modules)
for moduledir, subpath in modules: for moduledir, subpath in modules:
@ -305,7 +305,7 @@ class DirectoryScan:
# If its a package, recurse into its subpackages. # If its a package, recurse into its subpackages.
if ispackage: if ispackage:
try: try:
submodules: List[Tuple[pathlib.Path, pathlib.Path]] = [] submodules: list[tuple[pathlib.Path, pathlib.Path]] = []
self._get_path_module_entries(moduledir, subpath, submodules) self._get_path_module_entries(moduledir, subpath, submodules)
for submodule in submodules: for submodule in submodules:
if submodule[1].name != '__init__.py': if submodule[1].name != '__init__.py':
@ -316,8 +316,8 @@ class DirectoryScan:
f"Error scanning '{subpath}': {traceback.format_exc()}\n") f"Error scanning '{subpath}': {traceback.format_exc()}\n")
def _process_module_meta_tags(self, subpath: pathlib.Path, def _process_module_meta_tags(self, subpath: pathlib.Path,
flines: List[str], flines: list[str],
meta_lines: Dict[int, List[str]]) -> None: meta_lines: dict[int, list[str]]) -> None:
"""Pull data from a module based on its ba_meta tags.""" """Pull data from a module based on its ba_meta tags."""
for lindex, mline in meta_lines.items(): for lindex, mline in meta_lines.items():
# meta_lines is just anything containing '# ba_meta '; make sure # meta_lines is just anything containing '# ba_meta '; make sure
@ -360,7 +360,7 @@ class DirectoryScan:
': unrecognized export type "' + exporttype + ': unrecognized export type "' + exporttype +
'" on line ' + str(lindex + 1) + '.\n') '" on line ' + str(lindex + 1) + '.\n')
def _get_export_class_name(self, subpath: pathlib.Path, lines: List[str], def _get_export_class_name(self, subpath: pathlib.Path, lines: list[str],
lindex: int) -> Optional[str]: lindex: int) -> Optional[str]:
"""Given line num of an export tag, returns its operand class name.""" """Given line num of an export tag, returns its operand class name."""
lindexorig = lindex lindexorig = lindex
@ -387,7 +387,7 @@ class DirectoryScan:
return classname return classname
def get_api_requirement(self, subpath: pathlib.Path, def get_api_requirement(self, subpath: pathlib.Path,
meta_lines: Dict[int, List[str]], meta_lines: dict[int, list[str]],
toplevel: bool) -> Optional[int]: toplevel: bool) -> Optional[int]:
"""Return an API requirement integer or None if none present. """Return an API requirement integer or None if none present.

View File

@ -12,7 +12,7 @@ from ba._session import Session
from ba._error import NotFoundError, print_error from ba._error import NotFoundError, print_error
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Optional, Any, Dict, List, Type, Sequence from typing import Optional, Any, Sequence
import ba import ba
DEFAULT_TEAM_COLORS = ((0.1, 0.25, 1.0), (1.0, 0.25, 0.2)) DEFAULT_TEAM_COLORS = ((0.1, 0.25, 1.0), (1.0, 0.25, 0.2))
@ -105,9 +105,9 @@ class MultiTeamSession(Session):
shuffle=self._playlist_randomize) shuffle=self._playlist_randomize)
# Get a game on deck ready to go. # Get a game on deck ready to go.
self._current_game_spec: Optional[Dict[str, Any]] = None self._current_game_spec: Optional[dict[str, Any]] = None
self._next_game_spec: Dict[str, Any] = self._playlist.pull_next() self._next_game_spec: dict[str, Any] = self._playlist.pull_next()
self._next_game: Type[ba.GameActivity] = ( self._next_game: type[ba.GameActivity] = (
self._next_game_spec['resolved_type']) self._next_game_spec['resolved_type'])
# Go ahead and instantiate the next game we'll # Go ahead and instantiate the next game we'll
@ -129,7 +129,7 @@ class MultiTeamSession(Session):
"""Returns a description of the next game on deck.""" """Returns a description of the next game on deck."""
# pylint: disable=cyclic-import # pylint: disable=cyclic-import
from ba._gameactivity import GameActivity from ba._gameactivity import GameActivity
gametype: Type[GameActivity] = self._next_game_spec['resolved_type'] gametype: type[GameActivity] = self._next_game_spec['resolved_type']
assert issubclass(gametype, GameActivity) assert issubclass(gametype, GameActivity)
return gametype.get_settings_display_string(self._next_game_spec) return gametype.get_settings_display_string(self._next_game_spec)
@ -274,13 +274,13 @@ class ShuffleList:
(avoids repeats in maps or game types) (avoids repeats in maps or game types)
""" """
def __init__(self, items: List[Dict[str, Any]], shuffle: bool = True): def __init__(self, items: list[dict[str, Any]], shuffle: bool = True):
self.source_list = items self.source_list = items
self.shuffle = shuffle self.shuffle = shuffle
self.shuffle_list: List[Dict[str, Any]] = [] self.shuffle_list: list[dict[str, Any]] = []
self.last_gotten: Optional[Dict[str, Any]] = None self.last_gotten: Optional[dict[str, Any]] = None
def pull_next(self) -> Dict[str, Any]: def pull_next(self) -> dict[str, Any]:
"""Pull and return the next item on the shuffle-list.""" """Pull and return the next item on the shuffle-list."""
# Refill our list if its empty. # Refill our list if its empty.

View File

@ -11,7 +11,7 @@ from enum import Enum
import _ba import _ba
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Callable, Any, Optional, Dict, Union, Type from typing import Callable, Any, Optional, Union
import ba import ba
@ -69,7 +69,7 @@ class AssetSoundtrackEntry:
# What gets played by default for our different music types: # What gets played by default for our different music types:
ASSET_SOUNDTRACK_ENTRIES: Dict[MusicType, AssetSoundtrackEntry] = { ASSET_SOUNDTRACK_ENTRIES: dict[MusicType, AssetSoundtrackEntry] = {
MusicType.MENU: MusicType.MENU:
AssetSoundtrackEntry('menuMusic'), AssetSoundtrackEntry('menuMusic'),
MusicType.VICTORY: MusicType.VICTORY:
@ -130,8 +130,8 @@ class MusicSubsystem:
self._music_node: Optional[_ba.Node] = None self._music_node: Optional[_ba.Node] = None
self._music_mode: MusicPlayMode = MusicPlayMode.REGULAR self._music_mode: MusicPlayMode = MusicPlayMode.REGULAR
self._music_player: Optional[MusicPlayer] = None self._music_player: Optional[MusicPlayer] = None
self._music_player_type: Optional[Type[MusicPlayer]] = None self._music_player_type: Optional[type[MusicPlayer]] = None
self.music_types: Dict[MusicPlayMode, Optional[MusicType]] = { self.music_types: dict[MusicPlayMode, Optional[MusicType]] = {
MusicPlayMode.REGULAR: None, MusicPlayMode.REGULAR: None,
MusicPlayMode.TEST: None MusicPlayMode.TEST: None
} }
@ -273,7 +273,7 @@ class MusicSubsystem:
musictype: Union[MusicType, str, None], musictype: Union[MusicType, str, None],
continuous: bool = False, continuous: bool = False,
mode: MusicPlayMode = MusicPlayMode.REGULAR, mode: MusicPlayMode = MusicPlayMode.REGULAR,
testsoundtrack: Dict[str, Any] = None) -> None: testsoundtrack: dict[str, Any] = None) -> None:
"""Plays the requested music type/mode. """Plays the requested music type/mode.
For most cases, setmusic() is the proper call to use, which itself For most cases, setmusic() is the proper call to use, which itself
@ -329,10 +329,10 @@ class MusicSubsystem:
else: else:
self._play_internal_music(musictype) self._play_internal_music(musictype)
def _get_user_soundtrack(self) -> Dict[str, Any]: def _get_user_soundtrack(self) -> dict[str, Any]:
"""Return current user soundtrack or empty dict otherwise.""" """Return current user soundtrack or empty dict otherwise."""
cfg = _ba.app.config cfg = _ba.app.config
soundtrack: Dict[str, Any] = {} soundtrack: dict[str, Any] = {}
soundtrackname = cfg.get('Soundtrack') soundtrackname = cfg.get('Soundtrack')
if soundtrackname is not None and soundtrackname != '__default__': if soundtrackname is not None and soundtrackname != '__default__':
try: try:

View File

@ -12,10 +12,10 @@ from typing import TYPE_CHECKING
import _ba import _ba
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, Dict, Union, Callable, Optional from typing import Any, Union, Callable, Optional
import socket import socket
import ba import ba
MasterServerCallback = Callable[[Union[None, Dict[str, Any]]], None] MasterServerCallback = Callable[[Union[None, dict[str, Any]]], None]
# Timeout for standard functions talking to the master-server/etc. # Timeout for standard functions talking to the master-server/etc.
DEFAULT_REQUEST_TIMEOUT_SECONDS = 60 DEFAULT_REQUEST_TIMEOUT_SECONDS = 60
@ -25,7 +25,7 @@ class NetworkSubsystem:
"""Network related app subsystem.""" """Network related app subsystem."""
def __init__(self) -> None: def __init__(self) -> None:
self.region_pings: Dict[str, float] = {} self.region_pings: dict[str, float] = {}
def get_ip_address_type(addr: str) -> socket.AddressFamily: def get_ip_address_type(addr: str) -> socket.AddressFamily:
@ -61,7 +61,7 @@ class MasterServerCallThread(threading.Thread):
"""Thread to communicate with the master-server.""" """Thread to communicate with the master-server."""
def __init__(self, request: str, request_type: str, def __init__(self, request: str, request_type: str,
data: Optional[Dict[str, Any]], data: Optional[dict[str, Any]],
callback: Optional[MasterServerCallback], callback: Optional[MasterServerCallback],
response_type: MasterServerResponseType): response_type: MasterServerResponseType):
super().__init__() super().__init__()
@ -79,7 +79,7 @@ class MasterServerCallThread(threading.Thread):
self._activity = weakref.ref( self._activity = weakref.ref(
activity) if activity is not None else None activity) if activity is not None else None
def _run_callback(self, arg: Union[None, Dict[str, Any]]) -> None: def _run_callback(self, arg: Union[None, dict[str, Any]]) -> None:
# If we were created in an activity context and that activity has # If we were created in an activity context and that activity has
# since died, do nothing. # since died, do nothing.
# FIXME: Should we just be using a ContextCall instead of doing # FIXME: Should we just be using a ContextCall instead of doing
@ -170,7 +170,7 @@ class MasterServerCallThread(threading.Thread):
def master_server_get( def master_server_get(
request: str, request: str,
data: Dict[str, Any], data: dict[str, Any],
callback: Optional[MasterServerCallback] = None, callback: Optional[MasterServerCallback] = None,
response_type: MasterServerResponseType = MasterServerResponseType.JSON response_type: MasterServerResponseType = MasterServerResponseType.JSON
) -> None: ) -> None:
@ -181,7 +181,7 @@ def master_server_get(
def master_server_post( def master_server_post(
request: str, request: str,
data: Dict[str, Any], data: dict[str, Any],
callback: Optional[MasterServerCallback] = None, callback: Optional[MasterServerCallback] = None,
response_type: MasterServerResponseType = MasterServerResponseType.JSON response_type: MasterServerResponseType = MasterServerResponseType.JSON
) -> None: ) -> None:

View File

@ -13,8 +13,7 @@ from ba._error import (SessionPlayerNotFoundError, print_exception,
from ba._messages import DeathType, DieMessage from ba._messages import DeathType, DieMessage
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import (Type, Optional, Sequence, Dict, Any, Union, Tuple, from typing import Optional, Sequence, Any, Union, Callable
Callable)
import ba import ba
PlayerType = TypeVar('PlayerType', bound='ba.Player') PlayerType = TypeVar('PlayerType', bound='ba.Player')
@ -245,8 +244,8 @@ class Player(Generic[TeamType]):
assert not self._expired assert not self._expired
return self.actor is not None and self.actor.is_alive() return self.actor is not None and self.actor.is_alive()
def get_icon(self) -> Dict[str, Any]: def get_icon(self) -> dict[str, Any]:
"""get_icon() -> Dict[str, Any] """get_icon() -> dict[str, Any]
Returns the character's icon (images, colors, etc contained in a dict) Returns the character's icon (images, colors, etc contained in a dict)
""" """
@ -254,7 +253,7 @@ class Player(Generic[TeamType]):
assert not self._expired assert not self._expired
return self._sessionplayer.get_icon() return self._sessionplayer.get_icon()
def assigninput(self, inputtype: Union[ba.InputType, Tuple[ba.InputType, def assigninput(self, inputtype: Union[ba.InputType, tuple[ba.InputType,
...]], ...]],
call: Callable) -> None: call: Callable) -> None:
"""assigninput(type: Union[ba.InputType, Tuple[ba.InputType, ...]], """assigninput(type: Union[ba.InputType, Tuple[ba.InputType, ...]],
@ -302,7 +301,7 @@ class EmptyPlayer(Player['ba.EmptyTeam']):
# instead of requiring extra work by them. # instead of requiring extra work by them.
def playercast(totype: Type[PlayerType], player: ba.Player) -> PlayerType: def playercast(totype: type[PlayerType], player: ba.Player) -> PlayerType:
"""Cast a ba.Player to a specific ba.Player subclass. """Cast a ba.Player to a specific ba.Player subclass.
Category: Gameplay Functions Category: Gameplay Functions
@ -320,7 +319,7 @@ def playercast(totype: Type[PlayerType], player: ba.Player) -> PlayerType:
# NOTE: ideally we should have a single playercast() call and use overloads # NOTE: ideally we should have a single playercast() call and use overloads
# for the optional variety, but that currently seems to not be working. # for the optional variety, but that currently seems to not be working.
# See: https://github.com/python/mypy/issues/8800 # See: https://github.com/python/mypy/issues/8800
def playercast_o(totype: Type[PlayerType], def playercast_o(totype: type[PlayerType],
player: Optional[ba.Player]) -> Optional[PlayerType]: player: Optional[ba.Player]) -> Optional[PlayerType]:
"""A variant of ba.playercast() for use with optional ba.Player values. """A variant of ba.playercast() for use with optional ba.Player values.

View File

@ -5,17 +5,17 @@
from __future__ import annotations from __future__ import annotations
import copy import copy
from typing import Any, TYPE_CHECKING, Dict, List from typing import Any, TYPE_CHECKING
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Type, Sequence from typing import Sequence
from ba import _session from ba import _session
PlaylistType = List[Dict[str, Any]] PlaylistType = list[dict[str, Any]]
def filter_playlist(playlist: PlaylistType, def filter_playlist(playlist: PlaylistType,
sessiontype: Type[_session.Session], sessiontype: type[_session.Session],
add_resolved_type: bool = False, add_resolved_type: bool = False,
remove_unowned: bool = True, remove_unowned: bool = True,
mark_unowned: bool = False) -> PlaylistType: mark_unowned: bool = False) -> PlaylistType:
@ -32,7 +32,7 @@ def filter_playlist(playlist: PlaylistType,
from ba import _map from ba import _map
from ba import _general from ba import _general
from ba import _gameactivity from ba import _gameactivity
goodlist: List[Dict] = [] goodlist: list[dict] = []
unowned_maps: Sequence[str] unowned_maps: Sequence[str]
if remove_unowned or mark_unowned: if remove_unowned or mark_unowned:
unowned_maps = _map.get_unowned_maps() unowned_maps = _map.get_unowned_maps()

View File

@ -10,7 +10,6 @@ from dataclasses import dataclass
import _ba import _ba
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import List, Dict
import ba import ba
@ -23,8 +22,8 @@ class PluginSubsystem:
""" """
def __init__(self) -> None: def __init__(self) -> None:
self.potential_plugins: List[ba.PotentialPlugin] = [] self.potential_plugins: list[ba.PotentialPlugin] = []
self.active_plugins: Dict[str, ba.Plugin] = {} self.active_plugins: dict[str, ba.Plugin] = {}
def on_app_launch(self) -> None: def on_app_launch(self) -> None:
"""Should be called at app launch time.""" """Should be called at app launch time."""
@ -73,9 +72,9 @@ class PluginSubsystem:
# plugins, but that is only used to give the user a list of plugins # plugins, but that is only used to give the user a list of plugins
# that they can enable. (we wouldn't want to look at meta-scan here # that they can enable. (we wouldn't want to look at meta-scan here
# anyway because it may not be done yet at this point in the launch) # anyway because it may not be done yet at this point in the launch)
plugstates: Dict[str, Dict] = _ba.app.config.get('Plugins', {}) plugstates: dict[str, dict] = _ba.app.config.get('Plugins', {})
assert isinstance(plugstates, dict) assert isinstance(plugstates, dict)
plugkeys: List[str] = sorted(key for key, val in plugstates.items() plugkeys: list[str] = sorted(key for key, val in plugstates.items()
if val.get('enabled', False)) if val.get('enabled', False))
for plugkey in plugkeys: for plugkey in plugkeys:
try: try:

View File

@ -8,7 +8,7 @@ from typing import TYPE_CHECKING
from dataclasses import dataclass from dataclasses import dataclass
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Sequence, Tuple, Optional from typing import Sequence, Optional
import ba import ba
@ -47,7 +47,7 @@ class PowerupAcceptMessage:
""" """
def get_default_powerup_distribution() -> Sequence[Tuple[str, int]]: def get_default_powerup_distribution() -> Sequence[tuple[str, int]]:
"""Standard set of powerups.""" """Standard set of powerups."""
return (('triple_bombs', 3), ('ice_bombs', 3), ('punch', 3), return (('triple_bombs', 3), ('ice_bombs', 3), ('punch', 3),
('impact_bombs', 3), ('land_mines', 2), ('sticky_bombs', 3), ('impact_bombs', 3), ('land_mines', 2), ('sticky_bombs', 3),

View File

@ -9,7 +9,7 @@ from typing import TYPE_CHECKING
import _ba import _ba
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import List, Tuple, Any, Dict, Optional from typing import Any, Optional
# NOTE: player color options are enforced server-side for non-pro accounts # NOTE: player color options are enforced server-side for non-pro accounts
# so don't change these or they won't stick... # so don't change these or they won't stick...
@ -20,7 +20,7 @@ PLAYER_COLORS = [(1, 0.15, 0.15), (0.2, 1, 0.2), (0.1, 0.1, 1), (0.2, 1, 1),
(0.5, 0.5, 0.5), (1, 1, 1)] (0.5, 0.5, 0.5), (1, 1, 1)]
def get_player_colors() -> List[Tuple[float, float, float]]: def get_player_colors() -> list[tuple[float, float, float]]:
"""Return user-selectable player colors.""" """Return user-selectable player colors."""
return PLAYER_COLORS return PLAYER_COLORS
@ -50,8 +50,8 @@ def get_player_profile_icon(profilename: str) -> str:
def get_player_profile_colors( def get_player_profile_colors(
profilename: Optional[str], profilename: Optional[str],
profiles: Dict[str, Dict[str, Any]] = None profiles: dict[str, dict[str, Any]] = None
) -> Tuple[Tuple[float, float, float], Tuple[float, float, float]]: ) -> tuple[tuple[float, float, float], tuple[float, float, float]]:
"""Given a profile, return colors for them.""" """Given a profile, return colors for them."""
appconfig = _ba.app.config appconfig = _ba.app.config
if profiles is None: if profiles is None:

View File

@ -19,7 +19,7 @@ from ba._dualteamsession import DualTeamSession
from ba._coopsession import CoopSession from ba._coopsession import CoopSession
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Optional, Dict, Any, Type from typing import Optional, Any
import ba import ba
from bacommon.servermanager import ServerConfig from bacommon.servermanager import ServerConfig
@ -198,7 +198,7 @@ class ServerController:
callback=self._access_check_response, callback=self._access_check_response,
) )
def _access_check_response(self, data: Optional[Dict[str, Any]]) -> None: def _access_check_response(self, data: Optional[dict[str, Any]]) -> None:
import os import os
if data is None: if data is None:
print('error on UDP port access check (internet down?)') print('error on UDP port access check (internet down?)')
@ -267,7 +267,7 @@ class ServerController:
def _on_playlist_fetch_response( def _on_playlist_fetch_response(
self, self,
result: Optional[Dict[str, Any]], result: Optional[dict[str, Any]],
) -> None: ) -> None:
if result is None: if result is None:
print('Error fetching playlist; aborting.') print('Error fetching playlist; aborting.')
@ -283,7 +283,7 @@ class ServerController:
self._config.session_type = typename self._config.session_type = typename
self._playlist_name = (result['playlistName']) self._playlist_name = (result['playlistName'])
def _get_session_type(self) -> Type[ba.Session]: def _get_session_type(self) -> type[ba.Session]:
# Convert string session type to the class. # Convert string session type to the class.
# Hmm should we just keep this as a string? # Hmm should we just keep this as a string?
if self._config.session_type == 'ffa': if self._config.session_type == 'ffa':

View File

@ -12,7 +12,7 @@ from ba._language import Lstr
from ba._player import Player from ba._player import Player
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Sequence, List, Dict, Any, Optional, Set from typing import Sequence, Any, Optional
import ba import ba
@ -76,9 +76,9 @@ class Session:
lobby: ba.Lobby lobby: ba.Lobby
max_players: int max_players: int
min_players: int min_players: int
sessionplayers: List[ba.SessionPlayer] sessionplayers: list[ba.SessionPlayer]
customdata: dict customdata: dict
sessionteams: List[ba.SessionTeam] sessionteams: list[ba.SessionTeam]
def __init__(self, def __init__(self,
depsets: Sequence[ba.DependencySet], depsets: Sequence[ba.DependencySet],
@ -108,7 +108,7 @@ class Session:
# If things are missing, we'll try to gather them into a single # If things are missing, we'll try to gather them into a single
# missing-deps exception if possible to give the caller a clean # missing-deps exception if possible to give the caller a clean
# path to download missing stuff and try again. # path to download missing stuff and try again.
missing_asset_packages: Set[str] = set() missing_asset_packages: set[str] = set()
for depset in depsets: for depset in depsets:
try: try:
depset.resolve() depset.resolve()
@ -133,7 +133,7 @@ class Session:
# Ok; looks like our dependencies check out. # Ok; looks like our dependencies check out.
# Now give the engine a list of asset-set-ids to pass along to clients. # Now give the engine a list of asset-set-ids to pass along to clients.
required_asset_packages: Set[str] = set() required_asset_packages: set[str] = set()
for depset in depsets: for depset in depsets:
required_asset_packages.update(depset.get_asset_package_ids()) required_asset_packages.update(depset.get_asset_package_ids())
@ -495,7 +495,7 @@ class Session:
"""Return the current foreground activity for this session.""" """Return the current foreground activity for this session."""
return self._activity_weak() return self._activity_weak()
def get_custom_menu_entries(self) -> List[Dict[str, Any]]: def get_custom_menu_entries(self) -> list[dict[str, Any]]:
"""Subclasses can override this to provide custom menu entries. """Subclasses can override this to provide custom menu entries.
The returned value should be a list of dicts, each containing The returned value should be a list of dicts, each containing

View File

@ -8,7 +8,7 @@ from typing import TYPE_CHECKING
from dataclasses import dataclass from dataclasses import dataclass
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, List, Tuple from typing import Any
@dataclass @dataclass
@ -61,7 +61,7 @@ class ChoiceSetting(Setting):
Category: Settings Classes Category: Settings Classes
""" """
choices: List[Tuple[str, Any]] choices: list[tuple[str, Any]]
@dataclass @dataclass
@ -71,7 +71,7 @@ class IntChoiceSetting(ChoiceSetting):
Category: Settings Classes Category: Settings Classes
""" """
default: int default: int
choices: List[Tuple[str, int]] choices: list[tuple[str, int]]
@dataclass @dataclass
@ -81,4 +81,4 @@ class FloatChoiceSetting(ChoiceSetting):
Category: Settings Classes Category: Settings Classes
""" """
default: float default: float
choices: List[Tuple[str, float]] choices: list[tuple[str, float]]

View File

@ -14,8 +14,7 @@ from ba._error import (print_exception, print_error, SessionTeamNotFoundError,
if TYPE_CHECKING: if TYPE_CHECKING:
import ba import ba
from weakref import ReferenceType from typing import Any, Optional, Sequence, Union
from typing import Any, Dict, Optional, Sequence, Union, Tuple
@dataclass @dataclass
@ -58,7 +57,7 @@ class PlayerRecord:
self._stats = weakref.ref(stats) self._stats = weakref.ref(stats)
self._last_sessionplayer: Optional[ba.SessionPlayer] = None self._last_sessionplayer: Optional[ba.SessionPlayer] = None
self._sessionplayer: Optional[ba.SessionPlayer] = None self._sessionplayer: Optional[ba.SessionPlayer] = None
self._sessionteam: Optional[ReferenceType[ba.SessionTeam]] = None self._sessionteam: Optional[weakref.ref[ba.SessionTeam]] = None
self.streak = 0 self.streak = 0
self.associate_with_sessionplayer(sessionplayer) self.associate_with_sessionplayer(sessionplayer)
@ -90,7 +89,7 @@ class PlayerRecord:
"""Return the player entry's name.""" """Return the player entry's name."""
return self.name_full if full else self.name return self.name_full if full else self.name
def get_icon(self) -> Dict[str, Any]: def get_icon(self) -> dict[str, Any]:
"""Get the icon for this instance's player.""" """Get the icon for this instance's player."""
player = self._last_sessionplayer player = self._last_sessionplayer
assert player is not None assert player is not None
@ -181,7 +180,7 @@ class PlayerRecord:
sound = stats.orchestrahitsound4 sound = stats.orchestrahitsound4
def _apply(name2: Lstr, score2: int, showpoints2: bool, def _apply(name2: Lstr, score2: int, showpoints2: bool,
color2: Tuple[float, float, float, float], scale2: float, color2: tuple[float, float, float, float], scale2: float,
sound2: Optional[ba.Sound]) -> None: sound2: Optional[ba.Sound]) -> None:
from bastd.actor.popuptext import PopupText from bastd.actor.popuptext import PopupText
@ -237,8 +236,8 @@ class Stats:
""" """
def __init__(self) -> None: def __init__(self) -> None:
self._activity: Optional[ReferenceType[ba.Activity]] = None self._activity: Optional[weakref.ref[ba.Activity]] = None
self._player_records: Dict[str, PlayerRecord] = {} self._player_records: dict[str, PlayerRecord] = {}
self.orchestrahitsound1: Optional[ba.Sound] = None self.orchestrahitsound1: Optional[ba.Sound] = None
self.orchestrahitsound2: Optional[ba.Sound] = None self.orchestrahitsound2: Optional[ba.Sound] = None
self.orchestrahitsound3: Optional[ba.Sound] = None self.orchestrahitsound3: Optional[ba.Sound] = None
@ -303,7 +302,7 @@ class Stats:
self._player_records[name] = PlayerRecord(name, name_full, player, self._player_records[name] = PlayerRecord(name, name_full, player,
self) self)
def get_records(self) -> Dict[str, ba.PlayerRecord]: def get_records(self) -> dict[str, ba.PlayerRecord]:
"""Get PlayerRecord corresponding to still-existing players.""" """Get PlayerRecord corresponding to still-existing players."""
records = {} records = {}

View File

@ -9,11 +9,11 @@ from typing import TYPE_CHECKING
import _ba import _ba
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Type, List, Dict, Tuple, Optional, Any from typing import Optional, Any
import ba import ba
def get_store_item(item: str) -> Dict[str, Any]: def get_store_item(item: str) -> dict[str, Any]:
"""(internal)""" """(internal)"""
return get_store_items()[item] return get_store_items()[item]
@ -32,17 +32,17 @@ def get_store_item_name_translated(item_name: str) -> ba.Lstr:
subs=[('${APP_NAME}', subs=[('${APP_NAME}',
_language.Lstr(resource='titleText'))]) _language.Lstr(resource='titleText'))])
if item_name.startswith('maps.'): if item_name.startswith('maps.'):
map_type: Type[ba.Map] = item_info['map_type'] map_type: type[ba.Map] = item_info['map_type']
return _map.get_map_display_string(map_type.name) return _map.get_map_display_string(map_type.name)
if item_name.startswith('games.'): if item_name.startswith('games.'):
gametype: Type[ba.GameActivity] = item_info['gametype'] gametype: type[ba.GameActivity] = item_info['gametype']
return gametype.get_display_string() return gametype.get_display_string()
if item_name.startswith('icons.'): if item_name.startswith('icons.'):
return _language.Lstr(resource='editProfileWindow.iconText') return _language.Lstr(resource='editProfileWindow.iconText')
raise ValueError('unrecognized item: ' + item_name) raise ValueError('unrecognized item: ' + item_name)
def get_store_item_display_size(item_name: str) -> Tuple[float, float]: def get_store_item_display_size(item_name: str) -> tuple[float, float]:
"""(internal)""" """(internal)"""
if item_name.startswith('characters.'): if item_name.startswith('characters.'):
return 340 * 0.6, 430 * 0.6 return 340 * 0.6, 430 * 0.6
@ -55,7 +55,7 @@ def get_store_item_display_size(item_name: str) -> Tuple[float, float]:
return 450 * 0.6, 450 * 0.6 return 450 * 0.6, 450 * 0.6
def get_store_items() -> Dict[str, Dict]: def get_store_items() -> dict[str, dict]:
"""Returns info about purchasable items. """Returns info about purchasable items.
(internal) (internal)
@ -285,7 +285,7 @@ def get_store_items() -> Dict[str, Dict]:
return store_items return store_items
def get_store_layout() -> Dict[str, List[Dict[str, Any]]]: def get_store_layout() -> dict[str, list[dict[str, Any]]]:
"""Return what's available in the store at a given time. """Return what's available in the store at a given time.
Categorized by tab and by section.""" Categorized by tab and by section."""
@ -421,7 +421,7 @@ def get_available_purchase_count(tab: str = None) -> int:
return 0 return 0
def _calc_count_for_tab(tabval: List[Dict[str, Any]], our_tickets: int, def _calc_count_for_tab(tabval: list[dict[str, Any]], our_tickets: int,
count: int) -> int: count: int) -> int:
for section in tabval: for section in tabval:
for item in section['items']: for item in section['items']:
@ -442,7 +442,7 @@ def get_available_sale_time(tab: str) -> Optional[int]:
import datetime import datetime
from ba._generated.enums import TimeType, TimeFormat from ba._generated.enums import TimeType, TimeFormat
app = _ba.app app = _ba.app
sale_times: List[Optional[int]] = [] sale_times: list[Optional[int]] = []
# Calc time for our pro sale (old special case). # Calc time for our pro sale (old special case).
if tab == 'extras': if tab == 'extras':

View File

@ -10,8 +10,7 @@ from typing import TYPE_CHECKING, TypeVar, Generic
from ba._error import print_exception from ba._error import print_exception
if TYPE_CHECKING: if TYPE_CHECKING:
from weakref import ReferenceType from typing import Sequence, Union, Optional
from typing import Dict, List, Sequence, Tuple, Union, Optional
import ba import ba
@ -47,8 +46,8 @@ class SessionTeam:
# Annotate our attr types at the class level so they're introspectable. # Annotate our attr types at the class level so they're introspectable.
name: Union[ba.Lstr, str] name: Union[ba.Lstr, str]
color: Tuple[float, ...] # FIXME: can't we make this fixed len? color: tuple[float, ...] # FIXME: can't we make this fixed len?
players: List[ba.SessionPlayer] players: list[ba.SessionPlayer]
customdata: dict customdata: dict
id: int id: int
@ -88,11 +87,11 @@ class Team(Generic[PlayerType]):
# Defining these types at the class level instead of in __init__ so # Defining these types at the class level instead of in __init__ so
# that types are introspectable (these are still instance attrs). # that types are introspectable (these are still instance attrs).
players: List[PlayerType] players: list[PlayerType]
id: int id: int
name: Union[ba.Lstr, str] name: Union[ba.Lstr, str]
color: Tuple[float, ...] # FIXME: can't we make this fixed length? color: tuple[float, ...] # FIXME: can't we make this fixed length?
_sessionteam: ReferenceType[SessionTeam] _sessionteam: weakref.ref[SessionTeam]
_expired: bool _expired: bool
_postinited: bool _postinited: bool
_customdata: dict _customdata: dict
@ -127,7 +126,7 @@ class Team(Generic[PlayerType]):
self._postinited = True self._postinited = True
def manual_init(self, team_id: int, name: Union[ba.Lstr, str], def manual_init(self, team_id: int, name: Union[ba.Lstr, str],
color: Tuple[float, ...]) -> None: color: tuple[float, ...]) -> None:
"""Manually init a team for uses such as bots.""" """Manually init a team for uses such as bots."""
self.id = team_id self.id = team_id
self.name = name self.name = name

View File

@ -13,7 +13,7 @@ from ba._gameresults import GameResults
from ba._dualteamsession import DualTeamSession from ba._dualteamsession import DualTeamSession
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, Dict, Type, Sequence from typing import Any, Sequence
from bastd.actor.playerspaz import PlayerSpaz from bastd.actor.playerspaz import PlayerSpaz
import ba import ba
@ -31,7 +31,7 @@ class TeamGameActivity(GameActivity[PlayerType, TeamType]):
""" """
@classmethod @classmethod
def supports_session_type(cls, sessiontype: Type[ba.Session]) -> bool: def supports_session_type(cls, sessiontype: type[ba.Session]) -> bool:
""" """
Class method override; Class method override;
returns True for ba.DualTeamSessions and ba.FreeForAllSessions; returns True for ba.DualTeamSessions and ba.FreeForAllSessions;

View File

@ -3,12 +3,16 @@
"""Functionality related to game tips. """Functionality related to game tips.
These can be shown at opportune times such as between rounds.""" These can be shown at opportune times such as between rounds."""
from __future__ import annotations
from typing import TYPE_CHECKING
import random import random
from typing import List
import _ba import _ba
if TYPE_CHECKING:
pass
def get_next_tip() -> str: def get_next_tip() -> str:
"""Returns the next tip to be displayed.""" """Returns the next tip to be displayed."""
@ -20,7 +24,7 @@ def get_next_tip() -> str:
return tip return tip
def get_all_tips() -> List[str]: def get_all_tips() -> list[str]:
"""Return the complete list of tips.""" """Return the complete list of tips."""
tips = [ tips = [
('If you are short on controllers, install the \'${REMOTE_APP_NAME}\' ' ('If you are short on controllers, install the \'${REMOTE_APP_NAME}\' '

View File

@ -9,10 +9,10 @@ from typing import TYPE_CHECKING
import _ba import _ba
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Dict, List, Any from typing import Any
def get_tournament_prize_strings(entry: Dict[str, Any]) -> List[str]: def get_tournament_prize_strings(entry: dict[str, Any]) -> list[str]:
"""Given a tournament entry, return strings for its prize levels.""" """Given a tournament entry, return strings for its prize levels."""
# pylint: disable=too-many-locals # pylint: disable=too-many-locals
from ba._generated.enums import SpecialChar from ba._generated.enums import SpecialChar

View File

@ -10,7 +10,7 @@ import _ba
from ba._generated.enums import UIScale from ba._generated.enums import UIScale
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Optional, Dict, Any, Callable, List, Type from typing import Optional, Any, Callable
from ba.ui import UICleanupCheck from ba.ui import UICleanupCheck
import ba import ba
@ -43,13 +43,13 @@ class UISubsystem:
else: else:
raise RuntimeError(f'Invalid UIScale value: {interfacetype}') raise RuntimeError(f'Invalid UIScale value: {interfacetype}')
self.window_states: Dict[Type, Any] = {} # FIXME: Kill this. self.window_states: dict[type, Any] = {} # FIXME: Kill this.
self.main_menu_selection: Optional[str] = None # FIXME: Kill this. self.main_menu_selection: Optional[str] = None # FIXME: Kill this.
self.have_party_queue_window = False self.have_party_queue_window = False
self.quit_window: Any = None self.quit_window: Any = None
self.dismiss_wii_remotes_window_call: (Optional[Callable[[], self.dismiss_wii_remotes_window_call: (Optional[Callable[[],
Any]]) = None Any]]) = None
self.cleanupchecks: List[UICleanupCheck] = [] self.cleanupchecks: list[UICleanupCheck] = []
self.upkeeptimer: Optional[ba.Timer] = None self.upkeeptimer: Optional[ba.Timer] = None
self.use_toolbars = env.get('toolbar_test', True) self.use_toolbars = env.get('toolbar_test', True)
self.party_window: Any = None # FIXME: Don't use Any. self.party_window: Any = None # FIXME: Don't use Any.

View File

@ -10,7 +10,7 @@ import _ba
from ba._music import MusicPlayer from ba._music import MusicPlayer
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import List, Optional, Callable, Any from typing import Optional, Callable, Any
class MacMusicAppMusicPlayer(MusicPlayer): class MacMusicAppMusicPlayer(MusicPlayer):
@ -60,7 +60,7 @@ class _MacMusicAppThread(threading.Thread):
def __init__(self) -> None: def __init__(self) -> None:
super().__init__() super().__init__()
self._commands_available = threading.Event() self._commands_available = threading.Event()
self._commands: List[List] = [] self._commands: list[list] = []
self._volume = 1.0 self._volume = 1.0
self._current_playlist: Optional[str] = None self._current_playlist: Optional[str] = None
self._orig_volume: Optional[int] = None self._orig_volume: Optional[int] = None
@ -153,7 +153,7 @@ class _MacMusicAppThread(threading.Thread):
self._commands_available.set() self._commands_available.set()
def _handle_get_playlists_command( def _handle_get_playlists_command(
self, target: Callable[[List[str]], None]) -> None: self, target: Callable[[list[str]], None]) -> None:
from ba._general import Call from ba._general import Call
try: try:
playlists = _ba.mac_music_app_get_playlists() playlists = _ba.mac_music_app_get_playlists()

View File

@ -9,7 +9,7 @@ import os
import _ba import _ba
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Optional, List, Sequence from typing import Optional, Sequence
def get_human_readable_user_scripts_path() -> str: def get_human_readable_user_scripts_path() -> str:

View File

@ -12,7 +12,7 @@ import _ba
from ba._music import MusicPlayer from ba._music import MusicPlayer
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Callable, Any, Union, List, Optional from typing import Callable, Any, Union, Optional
class OSMusicPlayer(MusicPlayer): class OSMusicPlayer(MusicPlayer):
@ -26,7 +26,7 @@ class OSMusicPlayer(MusicPlayer):
self._actually_playing = False self._actually_playing = False
@classmethod @classmethod
def get_valid_music_file_extensions(cls) -> List[str]: def get_valid_music_file_extensions(cls) -> list[str]:
"""Return file extensions for types playable on this device.""" """Return file extensions for types playable on this device."""
# FIXME: should ask the C++ layer for these; just hard-coding for now. # FIXME: should ask the C++ layer for these; just hard-coding for now.
return ['mp3', 'ogg', 'm4a', 'wav', 'flac', 'mid'] return ['mp3', 'ogg', 'm4a', 'wav', 'flac', 'mid']
@ -60,7 +60,7 @@ class OSMusicPlayer(MusicPlayer):
self._on_play_folder_cb).start() self._on_play_folder_cb).start()
def _on_play_folder_cb(self, def _on_play_folder_cb(self,
result: Union[str, List[str]], result: Union[str, list[str]],
error: Optional[str] = None) -> None: error: Optional[str] = None) -> None:
from ba import _language from ba import _language
if error is not None: if error is not None:
@ -94,8 +94,8 @@ class OSMusicPlayer(MusicPlayer):
class _PickFolderSongThread(threading.Thread): class _PickFolderSongThread(threading.Thread):
def __init__(self, path: str, valid_extensions: List[str], def __init__(self, path: str, valid_extensions: list[str],
callback: Callable[[Union[str, List[str]], Optional[str]], callback: Callable[[Union[str, list[str]], Optional[str]],
None]): None]):
super().__init__() super().__init__()
self._valid_extensions = valid_extensions self._valid_extensions = valid_extensions
@ -108,7 +108,7 @@ class _PickFolderSongThread(threading.Thread):
do_print_error = True do_print_error = True
try: try:
_ba.set_thread_name('BA_PickFolderSongThread') _ba.set_thread_name('BA_PickFolderSongThread')
all_files: List[str] = [] all_files: list[str] = []
valid_extensions = ['.' + x for x in self._valid_extensions] valid_extensions = ['.' + x for x in self._valid_extensions]
for root, _subdirs, filenames in os.walk(self._path): for root, _subdirs, filenames in os.walk(self._path):
for fname in filenames: for fname in filenames:

View File

@ -14,8 +14,7 @@ from ba._generated.enums import TimeType
from ba._general import print_active_refs from ba._general import print_active_refs
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Optional, List, Any from typing import Optional, Any
from weakref import ReferenceType
import ba import ba
@ -45,7 +44,7 @@ class Window:
@dataclass @dataclass
class UICleanupCheck: class UICleanupCheck:
"""Holds info about a uicleanupcheck target.""" """Holds info about a uicleanupcheck target."""
obj: ReferenceType obj: weakref.ref
widget: ba.Widget widget: ba.Widget
widget_death_time: Optional[float] widget_death_time: Optional[float]
@ -126,15 +125,15 @@ class UIController:
def __init__(self) -> None: def __init__(self) -> None:
# FIXME: document why we have separate stacks for game and menu... # FIXME: document why we have separate stacks for game and menu...
self._main_stack_game: List[UIEntry] = [] self._main_stack_game: list[UIEntry] = []
self._main_stack_menu: List[UIEntry] = [] self._main_stack_menu: list[UIEntry] = []
# This points at either the game or menu stack. # This points at either the game or menu stack.
self._main_stack: Optional[List[UIEntry]] = None self._main_stack: Optional[list[UIEntry]] = None
# There's only one of these since we don't need to preserve its state # There's only one of these since we don't need to preserve its state
# between sessions. # between sessions.
self._dialog_stack: List[UIEntry] = [] self._dialog_stack: list[UIEntry] = []
def show_main_menu(self, in_game: bool = True) -> None: def show_main_menu(self, in_game: bool = True) -> None:
"""Show the main menu, clearing other UIs from location stacks.""" """Show the main menu, clearing other UIs from location stacks."""

View File

@ -11,7 +11,7 @@ import ba
from ba.internal import JoinActivity from ba.internal import JoinActivity
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, Dict, List, Optional, Sequence, Union from typing import Any, Optional, Sequence, Union
class CoopJoinActivity(JoinActivity): class CoopJoinActivity(JoinActivity):
@ -54,7 +54,7 @@ class CoopJoinActivity(JoinActivity):
ControlsGuide(delay=1.0).autoretain() ControlsGuide(delay=1.0).autoretain()
def _on_got_scores_to_beat(self, def _on_got_scores_to_beat(self,
scores: Optional[List[Dict[str, Any]]]) -> None: scores: Optional[list[dict[str, Any]]]) -> None:
# pylint: disable=too-many-locals # pylint: disable=too-many-locals
# pylint: disable=too-many-statements # pylint: disable=too-many-statements
from efro.util import asserttype from efro.util import asserttype

View File

@ -14,7 +14,7 @@ from bastd.actor.text import Text
from bastd.actor.zoomtext import ZoomText from bastd.actor.zoomtext import ZoomText
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Optional, Tuple, List, Dict, Any, Sequence from typing import Optional, Any, Sequence
from bastd.ui.store.button import StoreButton from bastd.ui.store.button import StoreButton
from bastd.ui.league.rankbutton import LeagueRankButton from bastd.ui.league.rankbutton import LeagueRankButton
@ -96,7 +96,7 @@ class CoopScoreScreen(ba.Activity[ba.Player, ba.Team]):
self._game_config_str: Optional[str] = None self._game_config_str: Optional[str] = None
# Ui bits. # Ui bits.
self._corner_button_offs: Optional[Tuple[float, float]] = None self._corner_button_offs: Optional[tuple[float, float]] = None
self._league_rank_button: Optional[LeagueRankButton] = None self._league_rank_button: Optional[LeagueRankButton] = None
self._store_button_instance: Optional[StoreButton] = None self._store_button_instance: Optional[StoreButton] = None
self._restart_button: Optional[ba.Widget] = None self._restart_button: Optional[ba.Widget] = None
@ -110,7 +110,7 @@ class CoopScoreScreen(ba.Activity[ba.Player, ba.Team]):
self._is_more_levels: Optional[bool] = None self._is_more_levels: Optional[bool] = None
self._next_level_name: Optional[str] = None self._next_level_name: Optional[str] = None
self._show_friend_scores: Optional[bool] = None self._show_friend_scores: Optional[bool] = None
self._show_info: Optional[Dict[str, Any]] = None self._show_info: Optional[dict[str, Any]] = None
self._name_str: Optional[str] = None self._name_str: Optional[str] = None
self._friends_loading_status: Optional[ba.Actor] = None self._friends_loading_status: Optional[ba.Actor] = None
self._score_loading_status: Optional[ba.Actor] = None self._score_loading_status: Optional[ba.Actor] = None
@ -124,7 +124,7 @@ class CoopScoreScreen(ba.Activity[ba.Player, ba.Team]):
self._allow_server_transition = False self._allow_server_transition = False
self._server_transitioning: Optional[bool] = None self._server_transitioning: Optional[bool] = None
self._playerinfos: List[ba.PlayerInfo] = settings['playerinfos'] self._playerinfos: list[ba.PlayerInfo] = settings['playerinfos']
assert isinstance(self._playerinfos, list) assert isinstance(self._playerinfos, list)
assert (isinstance(i, ba.PlayerInfo) for i in self._playerinfos) assert (isinstance(i, ba.PlayerInfo) for i in self._playerinfos)
@ -831,7 +831,7 @@ class CoopScoreScreen(ba.Activity[ba.Player, ba.Team]):
scale = 0.65 scale = 0.65
elif p_count == 4: elif p_count == 4:
scale = 0.5 scale = 0.5
times: List[Tuple[float, float]] = [] times: list[tuple[float, float]] = []
for i in range(display_count): for i in range(display_count):
times.insert(random.randrange(0, times.insert(random.randrange(0,
len(times) + 1), len(times) + 1),
@ -929,7 +929,7 @@ class CoopScoreScreen(ba.Activity[ba.Player, ba.Team]):
'loop': False 'loop': False
})).autoretain() })).autoretain()
def _got_friend_score_results(self, results: Optional[List[Any]]) -> None: def _got_friend_score_results(self, results: Optional[list[Any]]) -> None:
# FIXME: tidy this up # FIXME: tidy this up
# pylint: disable=too-many-locals # pylint: disable=too-many-locals
@ -990,7 +990,7 @@ class CoopScoreScreen(ba.Activity[ba.Player, ba.Team]):
while len(results) < 5: while len(results) < 5:
results.append([0, '-', False]) results.append([0, '-', False])
results = results[:5] results = results[:5]
times: List[Tuple[float, float]] = [] times: list[tuple[float, float]] = []
for i in range(len(results)): for i in range(len(results)):
times.insert(random.randrange(0, times.insert(random.randrange(0,
len(times) + 1), len(times) + 1),
@ -1044,7 +1044,7 @@ class CoopScoreScreen(ba.Activity[ba.Player, ba.Team]):
transition=Text.Transition.IN_RIGHT, transition=Text.Transition.IN_RIGHT,
transition_delay=tdelay2).autoretain() transition_delay=tdelay2).autoretain()
def _got_score_results(self, results: Optional[Dict[str, Any]]) -> None: def _got_score_results(self, results: Optional[dict[str, Any]]) -> None:
# FIXME: tidy this up # FIXME: tidy this up
# pylint: disable=too-many-locals # pylint: disable=too-many-locals
@ -1142,7 +1142,7 @@ class CoopScoreScreen(ba.Activity[ba.Player, ba.Team]):
while len(self._show_info['tops']) < 10: while len(self._show_info['tops']) < 10:
self._show_info['tops'].append([0, '-']) self._show_info['tops'].append([0, '-'])
times: List[Tuple[float, float]] = [] times: list[tuple[float, float]] = []
for i in range(len(self._show_info['tops'])): for i in range(len(self._show_info['tops'])):
times.insert( times.insert(
random.randrange(0, random.randrange(0,

View File

@ -11,7 +11,7 @@ from bastd.activity.multiteamscore import MultiTeamScoreScreenActivity
from bastd.actor.zoomtext import ZoomText from bastd.actor.zoomtext import ZoomText
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, Dict pass
class DrawScoreScreenActivity(MultiTeamScoreScreenActivity): class DrawScoreScreenActivity(MultiTeamScoreScreenActivity):

View File

@ -11,7 +11,7 @@ from bastd.activity.multiteamscore import MultiTeamScoreScreenActivity
from bastd.actor.zoomtext import ZoomText from bastd.actor.zoomtext import ZoomText
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, Dict pass
class TeamVictoryScoreScreenActivity(MultiTeamScoreScreenActivity): class TeamVictoryScoreScreenActivity(MultiTeamScoreScreenActivity):

View File

@ -10,7 +10,7 @@ import ba
from bastd.activity.multiteamscore import MultiTeamScoreScreenActivity from bastd.activity.multiteamscore import MultiTeamScoreScreenActivity
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, Dict, Optional, Set, Tuple from typing import Any, Optional
class FreeForAllVictoryScoreScreenActivity(MultiTeamScoreScreenActivity): class FreeForAllVictoryScoreScreenActivity(MultiTeamScoreScreenActivity):
@ -71,7 +71,7 @@ class FreeForAllVictoryScoreScreenActivity(MultiTeamScoreScreenActivity):
scale=1.2, scale=1.2,
x_offset=-110.0) x_offset=-110.0)
sound_times: Set[float] = set() sound_times: set[float] = set()
def _scoretxt(text: str, def _scoretxt(text: str,
x_offs: float, x_offs: float,
@ -260,7 +260,7 @@ class FreeForAllVictoryScoreScreenActivity(MultiTeamScoreScreenActivity):
v_offs -= spacing v_offs -= spacing
def _safe_animate(self, node: Optional[ba.Node], attr: str, def _safe_animate(self, node: Optional[ba.Node], attr: str,
keys: Dict[float, float]) -> None: keys: dict[float, float]) -> None:
"""Run an animation on a node if the node still exists.""" """Run an animation on a node if the node still exists."""
if node: if node:
ba.animate(node, attr, keys) ba.animate(node, attr, keys)

View File

@ -11,7 +11,7 @@ from ba.internal import JoinActivity
from bastd.actor.text import Text from bastd.actor.text import Text
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, Dict, Optional from typing import Optional
class MultiTeamJoinActivity(JoinActivity): class MultiTeamJoinActivity(JoinActivity):

View File

@ -11,7 +11,7 @@ from bastd.actor.text import Text
from bastd.actor.image import Image from bastd.actor.image import Image
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, Dict, Optional, Union from typing import Optional, Union
class MultiTeamScoreScreenActivity(ScoreScreenActivity): class MultiTeamScoreScreenActivity(ScoreScreenActivity):

View File

@ -10,7 +10,7 @@ import ba
from bastd.activity.multiteamscore import MultiTeamScoreScreenActivity from bastd.activity.multiteamscore import MultiTeamScoreScreenActivity
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, Dict, List, Tuple, Optional from typing import Optional
class TeamSeriesVictoryScoreScreenActivity(MultiTeamScoreScreenActivity): class TeamSeriesVictoryScoreScreenActivity(MultiTeamScoreScreenActivity):
@ -51,7 +51,7 @@ class TeamSeriesVictoryScoreScreenActivity(MultiTeamScoreScreenActivity):
ba.timer(4.6, ba.Call(ba.playsound, self._score_display_sound)) ba.timer(4.6, ba.Call(ba.playsound, self._score_display_sound))
# Score / Name / Player-record. # Score / Name / Player-record.
player_entries: List[Tuple[int, str, ba.PlayerRecord]] = [] player_entries: list[tuple[int, str, ba.PlayerRecord]] = []
# Note: for ffa, exclude players who haven't entered the game yet. # Note: for ffa, exclude players who haven't entered the game yet.
if self._is_ffa: if self._is_ffa:

View File

@ -14,7 +14,7 @@ import ba
from bastd.gameutils import SharedObjects from bastd.gameutils import SharedObjects
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, Sequence, Optional, Callable, List, Tuple, Type from typing import Any, Sequence, Optional, Callable
PlayerType = TypeVar('PlayerType', bound='ba.Player') PlayerType = TypeVar('PlayerType', bound='ba.Player')
@ -693,7 +693,7 @@ class Bomb(ba.Actor):
elif self.bomb_type == 'tnt': elif self.bomb_type == 'tnt':
self.blast_radius *= 1.45 self.blast_radius *= 1.45
self._explode_callbacks: List[Callable[[Bomb, Blast], Any]] = [] self._explode_callbacks: list[Callable[[Bomb, Blast], Any]] = []
# The player this came from. # The player this came from.
self._source_player = source_player self._source_player = source_player
@ -716,7 +716,7 @@ class Bomb(ba.Actor):
# since players carrying those things and thus touching footing # since players carrying those things and thus touching footing
# objects will think they're on solid ground.. perhaps we don't # objects will think they're on solid ground.. perhaps we don't
# wanna add this even in the tnt case? # wanna add this even in the tnt case?
materials: Tuple[ba.Material, ...] materials: tuple[ba.Material, ...]
if self.bomb_type == 'tnt': if self.bomb_type == 'tnt':
materials = (factory.bomb_material, shared.footing_material, materials = (factory.bomb_material, shared.footing_material,
shared.object_material) shared.object_material)
@ -847,7 +847,7 @@ class Bomb(ba.Actor):
}) })
def get_source_player( def get_source_player(
self, playertype: Type[PlayerType]) -> Optional[PlayerType]: self, playertype: type[PlayerType]) -> Optional[PlayerType]:
"""Return the source-player if one exists and is the provided type.""" """Return the source-player if one exists and is the provided type."""
player: Any = self._source_player player: Any = self._source_player
return (player if isinstance(player, playertype) and player.exists() return (player if isinstance(player, playertype) and player.exists()

View File

@ -10,7 +10,7 @@ import _ba
import ba import ba
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, Tuple, Optional, Sequence, Union from typing import Any, Optional, Sequence, Union
class ControlsGuide(ba.Actor): class ControlsGuide(ba.Actor):
@ -24,7 +24,7 @@ class ControlsGuide(ba.Actor):
""" """
def __init__(self, def __init__(self,
position: Tuple[float, float] = (390.0, 120.0), position: tuple[float, float] = (390.0, 120.0),
scale: float = 1.0, scale: float = 1.0,
delay: float = 0.0, delay: float = 0.0,
lifespan: float = None, lifespan: float = None,
@ -57,8 +57,8 @@ class ControlsGuide(ba.Actor):
self._update_timer: Optional[ba.Timer] = None self._update_timer: Optional[ba.Timer] = None
self._title_text: Optional[ba.Node] self._title_text: Optional[ba.Node]
clr: Sequence[float] clr: Sequence[float]
extra_pos_1: Optional[Tuple[float, float]] extra_pos_1: Optional[tuple[float, float]]
extra_pos_2: Optional[Tuple[float, float]] extra_pos_2: Optional[tuple[float, float]]
if ba.app.iircade_mode: if ba.app.iircade_mode:
xtweak = 0.2 xtweak = 0.2
ytweak = 0.2 ytweak = 0.2

View File

@ -10,7 +10,7 @@ from typing import TYPE_CHECKING
import ba import ba
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, Tuple, Sequence, Union, Dict, Optional from typing import Any, Sequence, Union, Optional
class Image(ba.Actor): class Image(ba.Actor):
@ -33,13 +33,13 @@ class Image(ba.Actor):
BOTTOM_CENTER = 'bottomCenter' BOTTOM_CENTER = 'bottomCenter'
def __init__(self, def __init__(self,
texture: Union[ba.Texture, Dict[str, Any]], texture: Union[ba.Texture, dict[str, Any]],
position: Tuple[float, float] = (0, 0), position: tuple[float, float] = (0, 0),
transition: Optional[Transition] = None, transition: Optional[Transition] = None,
transition_delay: float = 0.0, transition_delay: float = 0.0,
attach: Attach = Attach.CENTER, attach: Attach = Attach.CENTER,
color: Sequence[float] = (1.0, 1.0, 1.0, 1.0), color: Sequence[float] = (1.0, 1.0, 1.0, 1.0),
scale: Tuple[float, float] = (100.0, 100.0), scale: tuple[float, float] = (100.0, 100.0),
transition_out_delay: float = None, transition_out_delay: float = None,
model_opaque: ba.Model = None, model_opaque: ba.Model = None,
model_transparent: ba.Model = None, model_transparent: ba.Model = None,

View File

@ -10,7 +10,7 @@ import ba
from bastd.actor.spaz import Spaz from bastd.actor.spaz import Spaz
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, Sequence, Tuple, Optional, Type, Literal from typing import Any, Sequence, Optional, Literal
PlayerType = TypeVar('PlayerType', bound=ba.Player) PlayerType = TypeVar('PlayerType', bound=ba.Player)
TeamType = TypeVar('TeamType', bound=ba.Team) TeamType = TypeVar('TeamType', bound=ba.Team)
@ -65,7 +65,7 @@ class PlayerSpaz(Spaz):
powerups_expire=powerups_expire) powerups_expire=powerups_expire)
self.last_player_attacked_by: Optional[ba.Player] = None self.last_player_attacked_by: Optional[ba.Player] = None
self.last_attacked_time = 0.0 self.last_attacked_time = 0.0
self.last_attacked_type: Optional[Tuple[str, str]] = None self.last_attacked_type: Optional[tuple[str, str]] = None
self.held_count = 0 self.held_count = 0
self.last_player_held_by: Optional[ba.Player] = None self.last_player_held_by: Optional[ba.Player] = None
self._player = player self._player = player
@ -75,17 +75,17 @@ class PlayerSpaz(Spaz):
@overload @overload
def getplayer(self, def getplayer(self,
playertype: Type[PlayerType], playertype: type[PlayerType],
doraise: Literal[False] = False) -> Optional[PlayerType]: doraise: Literal[False] = False) -> Optional[PlayerType]:
... ...
@overload @overload
def getplayer(self, playertype: Type[PlayerType], def getplayer(self, playertype: type[PlayerType],
doraise: Literal[True]) -> PlayerType: doraise: Literal[True]) -> PlayerType:
... ...
def getplayer(self, def getplayer(self,
playertype: Type[PlayerType], playertype: type[PlayerType],
doraise: bool = False) -> Optional[PlayerType]: doraise: bool = False) -> Optional[PlayerType]:
"""Get the ba.Player associated with this Spaz. """Get the ba.Player associated with this Spaz.

View File

@ -11,7 +11,7 @@ import ba
from bastd.gameutils import SharedObjects from bastd.gameutils import SharedObjects
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import List, Any, Optional, Sequence from typing import Any, Optional, Sequence
DEFAULT_POWERUP_INTERVAL = 8.0 DEFAULT_POWERUP_INTERVAL = 8.0
@ -133,14 +133,14 @@ class PowerupBoxFactory:
actions=('impact_sound', self.drop_sound, 0.5, 0.1), actions=('impact_sound', self.drop_sound, 0.5, 0.1),
) )
self._powerupdist: List[str] = [] self._powerupdist: list[str] = []
for powerup, freq in get_default_powerup_distribution(): for powerup, freq in get_default_powerup_distribution():
for _i in range(int(freq)): for _i in range(int(freq)):
self._powerupdist.append(powerup) self._powerupdist.append(powerup)
def get_random_powerup_type(self, def get_random_powerup_type(self,
forcetype: str = None, forcetype: str = None,
excludetypes: List[str] = None) -> str: excludetypes: list[str] = None) -> str:
"""Returns a random powerup type (string). """Returns a random powerup type (string).
See ba.Powerup.poweruptype for available type values. See ba.Powerup.poweruptype for available type values.

View File

@ -10,7 +10,7 @@ from typing import TYPE_CHECKING
import ba import ba
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Optional, Dict, Tuple from typing import Optional
class RespawnIcon: class RespawnIcon:
@ -116,7 +116,7 @@ class RespawnIcon:
"""Is this icon still visible?""" """Is this icon still visible?"""
return self._visible return self._visible
def _get_context(self, player: ba.Player) -> Tuple[bool, float, Dict]: def _get_context(self, player: ba.Player) -> tuple[bool, float, dict]:
"""Return info on where we should be shown and stored.""" """Return info on where we should be shown and stored."""
activity = ba.getactivity() activity = ba.getactivity()

View File

@ -10,7 +10,7 @@ from typing import TYPE_CHECKING
import ba import ba
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, Optional, Sequence, Dict, Union from typing import Any, Optional, Sequence, Union
class _Entry: class _Entry:
@ -334,7 +334,7 @@ class Scoreboard:
show up on boards if provided. show up on boards if provided.
""" """
self._flat_tex = ba.gettexture('null') self._flat_tex = ba.gettexture('null')
self._entries: Dict[int, _Entry] = {} self._entries: dict[int, _Entry] = {}
self._label = label self._label = label
self.score_split = score_split self.score_split = score_split

View File

@ -15,8 +15,7 @@ from bastd.actor.spazfactory import SpazFactory
from bastd.gameutils import SharedObjects from bastd.gameutils import SharedObjects
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import (Any, Sequence, Optional, Dict, List, Union, Callable, from typing import Any, Sequence, Optional, Union, Callable
Tuple, Set)
from bastd.actor.spazfactory import SpazFactory from bastd.actor.spazfactory import SpazFactory
POWERUP_WEAR_OFF_TIME = 20000 POWERUP_WEAR_OFF_TIME = 20000
@ -104,7 +103,7 @@ class Spaz(ba.Actor):
self._hockey = activity.map.is_hockey self._hockey = activity.map.is_hockey
else: else:
self._hockey = False self._hockey = False
self._punched_nodes: Set[ba.Node] = set() self._punched_nodes: set[ba.Node] = set()
self._cursed = False self._cursed = False
self._connected_to_player: Optional[ba.Player] = None self._connected_to_player: Optional[ba.Player] = None
materials = [ materials = [
@ -203,9 +202,9 @@ class Spaz(ba.Actor):
self.last_run_time_ms = -9999 self.last_run_time_ms = -9999
self._last_run_value = 0.0 self._last_run_value = 0.0
self.last_bomb_time_ms = -9999 self.last_bomb_time_ms = -9999
self._turbo_filter_times: Dict[str, int] = {} self._turbo_filter_times: dict[str, int] = {}
self._turbo_filter_time_bucket = 0 self._turbo_filter_time_bucket = 0
self._turbo_filter_counts: Dict[str, int] = {} self._turbo_filter_counts: dict[str, int] = {}
self.frozen = False self.frozen = False
self.shattered = False self.shattered = False
self._last_hit_time: Optional[int] = None self._last_hit_time: Optional[int] = None
@ -213,7 +212,7 @@ class Spaz(ba.Actor):
self._bomb_held = False self._bomb_held = False
if self.default_shields: if self.default_shields:
self.equip_shields() self.equip_shields()
self._dropped_bomb_callbacks: List[Callable[[Spaz, ba.Actor], self._dropped_bomb_callbacks: list[Callable[[Spaz, ba.Actor],
Any]] = [] Any]] = []
self._score_text: Optional[ba.Node] = None self._score_text: Optional[ba.Node] = None
@ -561,7 +560,7 @@ class Spaz(ba.Actor):
def on_punched(self, damage: int) -> None: def on_punched(self, damage: int) -> None:
"""Called when this spaz gets punched.""" """Called when this spaz gets punched."""
def get_death_points(self, how: ba.DeathType) -> Tuple[int, int]: def get_death_points(self, how: ba.DeathType) -> tuple[int, int]:
"""Get the points awarded for killing this spaz.""" """Get the points awarded for killing this spaz."""
del how # Unused. del how # Unused.
num_hits = float(max(1, self._num_times_hit)) num_hits = float(max(1, self._num_times_hit))

View File

@ -9,10 +9,10 @@ import _ba
import ba import ba
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import List, Optional, Tuple from typing import Optional
def get_appearances(include_locked: bool = False) -> List[str]: def get_appearances(include_locked: bool = False) -> list[str]:
"""Get the list of available spaz appearances.""" """Get the list of available spaz appearances."""
# pylint: disable=too-many-statements # pylint: disable=too-many-statements
# pylint: disable=too-many-branches # pylint: disable=too-many-branches
@ -104,15 +104,15 @@ class Appearance:
self.upper_leg_model = '' self.upper_leg_model = ''
self.lower_leg_model = '' self.lower_leg_model = ''
self.toes_model = '' self.toes_model = ''
self.jump_sounds: List[str] = [] self.jump_sounds: list[str] = []
self.attack_sounds: List[str] = [] self.attack_sounds: list[str] = []
self.impact_sounds: List[str] = [] self.impact_sounds: list[str] = []
self.death_sounds: List[str] = [] self.death_sounds: list[str] = []
self.pickup_sounds: List[str] = [] self.pickup_sounds: list[str] = []
self.fall_sounds: List[str] = [] self.fall_sounds: list[str] = []
self.style = 'spaz' self.style = 'spaz'
self.default_color: Optional[Tuple[float, float, float]] = None self.default_color: Optional[tuple[float, float, float]] = None
self.default_highlight: Optional[Tuple[float, float, float]] = None self.default_highlight: Optional[tuple[float, float, float]] = None
def register_appearances() -> None: def register_appearances() -> None:

View File

@ -13,7 +13,7 @@ import ba
from bastd.actor.spaz import Spaz from bastd.actor.spaz import Spaz
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, Optional, List, Tuple, Sequence, Type, Callable from typing import Any, Optional, Sequence, Callable
from bastd.actor.flag import Flag from bastd.actor.flag import Flag
LITE_BOT_COLOR = (1.2, 0.9, 0.2) LITE_BOT_COLOR = (1.2, 0.9, 0.2)
@ -125,7 +125,7 @@ class SpazBot(Spaz):
self._map = weakref.ref(activity.map) self._map = weakref.ref(activity.map)
self.last_player_attacked_by: Optional[ba.Player] = None self.last_player_attacked_by: Optional[ba.Player] = None
self.last_attacked_time = 0.0 self.last_attacked_time = 0.0
self.last_attacked_type: Optional[Tuple[str, str]] = None self.last_attacked_type: Optional[tuple[str, str]] = None
self.target_point_default: Optional[ba.Vec3] = None self.target_point_default: Optional[ba.Vec3] = None
self.held_count = 0 self.held_count = 0
self.last_player_held_by: Optional[ba.Player] = None self.last_player_held_by: Optional[ba.Player] = None
@ -141,7 +141,7 @@ class SpazBot(Spaz):
self._throw_release_time: Optional[float] = None self._throw_release_time: Optional[float] = None
self._have_dropped_throw_bomb: Optional[bool] = None self._have_dropped_throw_bomb: Optional[bool] = None
self._player_pts: Optional[List[Tuple[ba.Vec3, ba.Vec3]]] = None self._player_pts: Optional[list[tuple[ba.Vec3, ba.Vec3]]] = None
# These cooldowns didn't exist when these bots were calibrated, # These cooldowns didn't exist when these bots were calibrated,
# so take them out of the equation. # so take them out of the equation.
@ -161,7 +161,7 @@ class SpazBot(Spaz):
return mval return mval
def _get_target_player_pt( def _get_target_player_pt(
self) -> Tuple[Optional[ba.Vec3], Optional[ba.Vec3]]: self) -> tuple[Optional[ba.Vec3], Optional[ba.Vec3]]:
"""Returns the position and velocity of our target. """Returns the position and velocity of our target.
Both values will be None in the case of no target. Both values will be None in the case of no target.
@ -189,7 +189,7 @@ class SpazBot(Spaz):
ba.Vec3(closest_vel[0], closest_vel[1], closest_vel[2])) ba.Vec3(closest_vel[0], closest_vel[1], closest_vel[2]))
return None, None return None, None
def set_player_points(self, pts: List[Tuple[ba.Vec3, ba.Vec3]]) -> None: def set_player_points(self, pts: list[tuple[ba.Vec3, ba.Vec3]]) -> None:
"""Provide the spaz-bot with the locations of its enemies.""" """Provide the spaz-bot with the locations of its enemies."""
self._player_pts = pts self._player_pts = pts
@ -882,7 +882,7 @@ class SpazBotSet:
self._bot_list_count = 5 self._bot_list_count = 5
self._bot_add_list = 0 self._bot_add_list = 0
self._bot_update_list = 0 self._bot_update_list = 0
self._bot_lists: List[List[SpazBot]] = [ self._bot_lists: list[list[SpazBot]] = [
[] for _ in range(self._bot_list_count) [] for _ in range(self._bot_list_count)
] ]
self._spawn_sound = ba.getsound('spawn') self._spawn_sound = ba.getsound('spawn')
@ -894,7 +894,7 @@ class SpazBotSet:
self.clear() self.clear()
def spawn_bot(self, def spawn_bot(self,
bot_type: Type[SpazBot], bot_type: type[SpazBot],
pos: Sequence[float], pos: Sequence[float],
spawn_time: float = 3.0, spawn_time: float = 3.0,
on_spawn_call: Callable[[SpazBot], Any] = None) -> None: on_spawn_call: Callable[[SpazBot], Any] = None) -> None:
@ -907,7 +907,7 @@ class SpazBotSet:
on_spawn_call)) on_spawn_call))
self._spawning_count += 1 self._spawning_count += 1
def _spawn_bot(self, bot_type: Type[SpazBot], pos: Sequence[float], def _spawn_bot(self, bot_type: type[SpazBot], pos: Sequence[float],
on_spawn_call: Optional[Callable[[SpazBot], Any]]) -> None: on_spawn_call: Optional[Callable[[SpazBot], Any]]) -> None:
spaz = bot_type() spaz = bot_type()
ba.playsound(self._spawn_sound, position=pos) ba.playsound(self._spawn_sound, position=pos)
@ -925,9 +925,9 @@ class SpazBotSet:
return (self._spawning_count > 0 return (self._spawning_count > 0
or any(any(b.is_alive() for b in l) for l in self._bot_lists)) or any(any(b.is_alive() for b in l) for l in self._bot_lists))
def get_living_bots(self) -> List[SpazBot]: def get_living_bots(self) -> list[SpazBot]:
"""Get the living bots in the set.""" """Get the living bots in the set."""
bots: List[SpazBot] = [] bots: list[SpazBot] = []
for botlist in self._bot_lists: for botlist in self._bot_lists:
for bot in botlist: for bot in botlist:
if bot.is_alive(): if bot.is_alive():

View File

@ -11,7 +11,7 @@ from bastd.gameutils import SharedObjects
import _ba import _ba
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, Dict from typing import Any
class SpazFactory: class SpazFactory:
@ -206,7 +206,7 @@ class SpazFactory:
actions=('modify_node_collision', 'collide', False), actions=('modify_node_collision', 'collide', False),
) )
self.spaz_media: Dict[str, Any] = {} self.spaz_media: dict[str, Any] = {}
# Lets load some basic rules. # Lets load some basic rules.
# (allows them to be tweaked from the master server) # (allows them to be tweaked from the master server)
@ -227,7 +227,7 @@ class SpazFactory:
""" """
return ba.app.spaz_appearances[character].style return ba.app.spaz_appearances[character].style
def get_media(self, character: str) -> Dict[str, Any]: def get_media(self, character: str) -> dict[str, Any]:
"""Return the set of media used by this variant of spaz.""" """Return the set of media used by this variant of spaz."""
char = ba.app.spaz_appearances[character] char = ba.app.spaz_appearances[character]
if character not in self.spaz_media: if character not in self.spaz_media:

View File

@ -10,7 +10,7 @@ from typing import TYPE_CHECKING
import ba import ba
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, Union, Tuple, Sequence, Optional from typing import Any, Union, Sequence, Optional
class Text(ba.Actor): class Text(ba.Actor):
@ -50,7 +50,7 @@ class Text(ba.Actor):
def __init__(self, def __init__(self,
text: Union[str, ba.Lstr], text: Union[str, ba.Lstr],
position: Tuple[float, float] = (0.0, 0.0), position: tuple[float, float] = (0.0, 0.0),
h_align: HAlign = HAlign.LEFT, h_align: HAlign = HAlign.LEFT,
v_align: VAlign = VAlign.NONE, v_align: VAlign = VAlign.NONE,
color: Sequence[float] = (1.0, 1.0, 1.0, 1.0), color: Sequence[float] = (1.0, 1.0, 1.0, 1.0),

View File

@ -10,7 +10,7 @@ from typing import TYPE_CHECKING
import ba import ba
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, Union, Tuple, Sequence from typing import Any, Union, Sequence
class ZoomText(ba.Actor): class ZoomText(ba.Actor):
@ -23,8 +23,8 @@ class ZoomText(ba.Actor):
def __init__(self, def __init__(self,
text: Union[str, ba.Lstr], text: Union[str, ba.Lstr],
position: Tuple[float, float] = (0.0, 0.0), position: tuple[float, float] = (0.0, 0.0),
shiftposition: Tuple[float, float] = None, shiftposition: tuple[float, float] = None,
shiftdelay: float = None, shiftdelay: float = None,
lifespan: float = None, lifespan: float = None,
flash: bool = True, flash: bool = True,
@ -171,7 +171,7 @@ class ZoomText(ba.Actor):
return None return None
return super().handlemessage(msg) return super().handlemessage(msg)
def _jitter(self, position: Tuple[float, float], def _jitter(self, position: tuple[float, float],
jitter_amount: float) -> None: jitter_amount: float) -> None:
if not self.node: if not self.node:
return return
@ -187,8 +187,8 @@ class ZoomText(ba.Actor):
ba.animate(cmb, attr, keys, loop=True) ba.animate(cmb, attr, keys, loop=True)
cmb.connectattr('output', self.node, 'position') cmb.connectattr('output', self.node, 'position')
def _shift(self, position1: Tuple[float, float], def _shift(self, position1: tuple[float, float],
position2: Tuple[float, float]) -> None: position2: tuple[float, float]) -> None:
if not self.node: if not self.node:
return return
cmb = ba.newnode('combine', owner=self.node, attrs={'size': 2}) cmb = ba.newnode('combine', owner=self.node, attrs={'size': 2})

View File

@ -8,15 +8,15 @@ from typing import TYPE_CHECKING
import ba import ba
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Type, Any, Dict, Callable, Optional from typing import Any, Callable, Optional
class AppDelegate(ba.AppDelegate): class AppDelegate(ba.AppDelegate):
"""Defines handlers for high level app functionality.""" """Defines handlers for high level app functionality."""
def create_default_game_settings_ui( def create_default_game_settings_ui(
self, gameclass: Type[ba.GameActivity], self, gameclass: type[ba.GameActivity],
sessiontype: Type[ba.Session], settings: Optional[dict], sessiontype: type[ba.Session], settings: Optional[dict],
completion_call: Callable[[Optional[dict]], Any]) -> None: completion_call: Callable[[Optional[dict]], Any]) -> None:
"""(internal)""" """(internal)"""

View File

@ -17,7 +17,7 @@ from bastd.actor.scoreboard import Scoreboard
from bastd.gameutils import SharedObjects from bastd.gameutils import SharedObjects
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, Type, List, Dict, Sequence, Union from typing import Any, Sequence, Union
class Player(ba.Player['Team']): class Player(ba.Player['Team']):
@ -72,11 +72,11 @@ class AssaultGame(ba.TeamGameActivity[Player, Team]):
] ]
@classmethod @classmethod
def supports_session_type(cls, sessiontype: Type[ba.Session]) -> bool: def supports_session_type(cls, sessiontype: type[ba.Session]) -> bool:
return issubclass(sessiontype, ba.DualTeamSession) return issubclass(sessiontype, ba.DualTeamSession)
@classmethod @classmethod
def get_supported_maps(cls, sessiontype: Type[ba.Session]) -> List[str]: def get_supported_maps(cls, sessiontype: type[ba.Session]) -> list[str]:
return ba.getmaps('team_flag') return ba.getmaps('team_flag')
def __init__(self, settings: dict): def __init__(self, settings: dict):
@ -84,7 +84,7 @@ class AssaultGame(ba.TeamGameActivity[Player, Team]):
self._scoreboard = Scoreboard() self._scoreboard = Scoreboard()
self._last_score_time = 0.0 self._last_score_time = 0.0
self._score_sound = ba.getsound('score') self._score_sound = ba.getsound('score')
self._base_region_materials: Dict[int, ba.Material] = {} self._base_region_materials: dict[int, ba.Material] = {}
self._epic_mode = bool(settings['Epic Mode']) self._epic_mode = bool(settings['Epic Mode'])
self._score_to_win = int(settings['Score to Win']) self._score_to_win = int(settings['Score to Win'])
self._time_limit = float(settings['Time Limit']) self._time_limit = float(settings['Time Limit'])

View File

@ -16,7 +16,7 @@ from bastd.actor.flag import (FlagFactory, Flag, FlagPickedUpMessage,
FlagDroppedMessage, FlagDiedMessage) FlagDroppedMessage, FlagDiedMessage)
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, Type, List, Dict, Sequence, Union, Optional from typing import Any, Sequence, Union, Optional
class CTFFlag(Flag): class CTFFlag(Flag):
@ -132,11 +132,11 @@ class CaptureTheFlagGame(ba.TeamGameActivity[Player, Team]):
] ]
@classmethod @classmethod
def supports_session_type(cls, sessiontype: Type[ba.Session]) -> bool: def supports_session_type(cls, sessiontype: type[ba.Session]) -> bool:
return issubclass(sessiontype, ba.DualTeamSession) return issubclass(sessiontype, ba.DualTeamSession)
@classmethod @classmethod
def get_supported_maps(cls, sessiontype: Type[ba.Session]) -> List[str]: def get_supported_maps(cls, sessiontype: type[ba.Session]) -> list[str]:
return ba.getmaps('team_flag') return ba.getmaps('team_flag')
def __init__(self, settings: dict): def __init__(self, settings: dict):
@ -491,10 +491,10 @@ class CaptureTheFlagGame(ba.TeamGameActivity[Player, Team]):
player = spaz.getplayer(Player, True) player = spaz.getplayer(Player, True)
team: Team = player.team team: Team = player.team
player.touching_own_flag = 0 player.touching_own_flag = 0
no_physical_mats: List[ba.Material] = [ no_physical_mats: list[ba.Material] = [
team.spaz_material_no_flag_physical team.spaz_material_no_flag_physical
] ]
no_collide_mats: List[ba.Material] = [ no_collide_mats: list[ba.Material] = [
team.spaz_material_no_flag_collide team.spaz_material_no_flag_collide
] ]

View File

@ -16,7 +16,7 @@ from bastd.actor.scoreboard import Scoreboard
from bastd.gameutils import SharedObjects from bastd.gameutils import SharedObjects
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, Type, List, Dict, Optional, Sequence, Union from typing import Any, Optional, Sequence, Union
class Player(ba.Player['Team']): class Player(ba.Player['Team']):
@ -81,7 +81,7 @@ class ChosenOneGame(ba.TeamGameActivity[Player, Team]):
scoreconfig = ba.ScoreConfig(label='Time Held') scoreconfig = ba.ScoreConfig(label='Time Held')
@classmethod @classmethod
def get_supported_maps(cls, sessiontype: Type[ba.Session]) -> List[str]: def get_supported_maps(cls, sessiontype: type[ba.Session]) -> list[str]:
return ba.getmaps('keep_away') return ba.getmaps('keep_away')
def __init__(self, settings: dict): def __init__(self, settings: dict):
@ -89,7 +89,7 @@ class ChosenOneGame(ba.TeamGameActivity[Player, Team]):
self._scoreboard = Scoreboard() self._scoreboard = Scoreboard()
self._chosen_one_player: Optional[Player] = None self._chosen_one_player: Optional[Player] = None
self._swipsound = ba.getsound('swip') self._swipsound = ba.getsound('swip')
self._countdownsounds: Dict[int, ba.Sound] = { self._countdownsounds: dict[int, ba.Sound] = {
10: ba.getsound('announceTen'), 10: ba.getsound('announceTen'),
9: ba.getsound('announceNine'), 9: ba.getsound('announceNine'),
8: ba.getsound('announceEight'), 8: ba.getsound('announceEight'),

View File

@ -17,7 +17,7 @@ from bastd.actor.playerspaz import PlayerSpaz
from bastd.gameutils import SharedObjects from bastd.gameutils import SharedObjects
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, Optional, Type, List, Dict, Sequence, Union from typing import Any, Optional, Sequence, Union
from bastd.actor.respawnicon import RespawnIcon from bastd.actor.respawnicon import RespawnIcon
@ -105,11 +105,11 @@ class ConquestGame(ba.TeamGameActivity[Player, Team]):
] ]
@classmethod @classmethod
def supports_session_type(cls, sessiontype: Type[ba.Session]) -> bool: def supports_session_type(cls, sessiontype: type[ba.Session]) -> bool:
return issubclass(sessiontype, ba.DualTeamSession) return issubclass(sessiontype, ba.DualTeamSession)
@classmethod @classmethod
def get_supported_maps(cls, sessiontype: Type[ba.Session]) -> List[str]: def get_supported_maps(cls, sessiontype: type[ba.Session]) -> list[str]:
return ba.getmaps('conquest') return ba.getmaps('conquest')
def __init__(self, settings: dict): def __init__(self, settings: dict):
@ -119,7 +119,7 @@ class ConquestGame(ba.TeamGameActivity[Player, Team]):
self._score_sound = ba.getsound('score') self._score_sound = ba.getsound('score')
self._swipsound = ba.getsound('swip') self._swipsound = ba.getsound('swip')
self._extraflagmat = ba.Material() self._extraflagmat = ba.Material()
self._flags: List[ConquestFlag] = [] self._flags: list[ConquestFlag] = []
self._epic_mode = bool(settings['Epic Mode']) self._epic_mode = bool(settings['Epic Mode'])
self._time_limit = float(settings['Time Limit']) self._time_limit = float(settings['Time Limit'])

View File

@ -14,7 +14,7 @@ from bastd.actor.playerspaz import PlayerSpaz
from bastd.actor.scoreboard import Scoreboard from bastd.actor.scoreboard import Scoreboard
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, Type, List, Dict, Tuple, Union, Sequence, Optional from typing import Any, Union, Sequence, Optional
class Player(ba.Player['Team']): class Player(ba.Player['Team']):
@ -40,7 +40,7 @@ class DeathMatchGame(ba.TeamGameActivity[Player, Team]):
@classmethod @classmethod
def get_available_settings( def get_available_settings(
cls, sessiontype: Type[ba.Session]) -> List[ba.Setting]: cls, sessiontype: type[ba.Session]) -> list[ba.Setting]:
settings = [ settings = [
ba.IntSetting( ba.IntSetting(
'Kills to Win Per Player', 'Kills to Win Per Player',
@ -86,12 +86,12 @@ class DeathMatchGame(ba.TeamGameActivity[Player, Team]):
return settings return settings
@classmethod @classmethod
def supports_session_type(cls, sessiontype: Type[ba.Session]) -> bool: def supports_session_type(cls, sessiontype: type[ba.Session]) -> bool:
return (issubclass(sessiontype, ba.DualTeamSession) return (issubclass(sessiontype, ba.DualTeamSession)
or issubclass(sessiontype, ba.FreeForAllSession)) or issubclass(sessiontype, ba.FreeForAllSession))
@classmethod @classmethod
def get_supported_maps(cls, sessiontype: Type[ba.Session]) -> List[str]: def get_supported_maps(cls, sessiontype: type[ba.Session]) -> list[str]:
return ba.getmaps('melee') return ba.getmaps('melee')
def __init__(self, settings: dict): def __init__(self, settings: dict):

View File

@ -20,7 +20,7 @@ from bastd.actor.respawnicon import RespawnIcon
from bastd.gameutils import SharedObjects from bastd.gameutils import SharedObjects
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, Type, Dict, List, Tuple, Optional from typing import Any, Optional
class Player(ba.Player['Team']): class Player(ba.Player['Team']):
@ -49,12 +49,12 @@ class EasterEggHuntGame(ba.TeamGameActivity[Player, Team]):
# We're currently hard-coded for one map. # We're currently hard-coded for one map.
@classmethod @classmethod
def get_supported_maps(cls, sessiontype: Type[ba.Session]) -> List[str]: def get_supported_maps(cls, sessiontype: type[ba.Session]) -> list[str]:
return ['Tower D'] return ['Tower D']
# We support teams, free-for-all, and co-op sessions. # We support teams, free-for-all, and co-op sessions.
@classmethod @classmethod
def supports_session_type(cls, sessiontype: Type[ba.Session]) -> bool: def supports_session_type(cls, sessiontype: type[ba.Session]) -> bool:
return (issubclass(sessiontype, ba.CoopSession) return (issubclass(sessiontype, ba.CoopSession)
or issubclass(sessiontype, ba.DualTeamSession) or issubclass(sessiontype, ba.DualTeamSession)
or issubclass(sessiontype, ba.FreeForAllSession)) or issubclass(sessiontype, ba.FreeForAllSession))
@ -75,7 +75,7 @@ class EasterEggHuntGame(ba.TeamGameActivity[Player, Team]):
self.egg_material.add_actions( self.egg_material.add_actions(
conditions=('they_have_material', shared.player_material), conditions=('they_have_material', shared.player_material),
actions=(('call', 'at_connect', self._on_egg_player_collide), )) actions=(('call', 'at_connect', self._on_egg_player_collide), ))
self._eggs: List[Egg] = [] self._eggs: list[Egg] = []
self._update_timer: Optional[ba.Timer] = None self._update_timer: Optional[ba.Timer] = None
self._countdown: Optional[OnScreenCountdown] = None self._countdown: Optional[OnScreenCountdown] = None
self._bots: Optional[SpazBotSet] = None self._bots: Optional[SpazBotSet] = None
@ -224,7 +224,7 @@ class EasterEggHuntGame(ba.TeamGameActivity[Player, Team]):
class Egg(ba.Actor): class Egg(ba.Actor):
"""A lovely egg that can be picked up for points.""" """A lovely egg that can be picked up for points."""
def __init__(self, position: Tuple[float, float, float] = (0.0, 1.0, 0.0)): def __init__(self, position: tuple[float, float, float] = (0.0, 1.0, 0.0)):
super().__init__() super().__init__()
activity = self.activity activity = self.activity
assert isinstance(activity, EasterEggHuntGame) assert isinstance(activity, EasterEggHuntGame)

View File

@ -14,8 +14,7 @@ from bastd.actor.spazfactory import SpazFactory
from bastd.actor.scoreboard import Scoreboard from bastd.actor.scoreboard import Scoreboard
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import (Any, Tuple, Dict, Type, List, Sequence, Optional, from typing import Any, Sequence, Optional, Union
Union)
class Icon(ba.Actor): class Icon(ba.Actor):
@ -23,7 +22,7 @@ class Icon(ba.Actor):
def __init__(self, def __init__(self,
player: Player, player: Player,
position: Tuple[float, float], position: tuple[float, float],
scale: float, scale: float,
show_lives: bool = True, show_lives: bool = True,
show_death: bool = True, show_death: bool = True,
@ -83,7 +82,7 @@ class Icon(ba.Actor):
}) })
self.set_position_and_scale(position, scale) self.set_position_and_scale(position, scale)
def set_position_and_scale(self, position: Tuple[float, float], def set_position_and_scale(self, position: tuple[float, float],
scale: float) -> None: scale: float) -> None:
"""(Re)position the icon.""" """(Re)position the icon."""
assert self.node assert self.node
@ -156,7 +155,7 @@ class Player(ba.Player['Team']):
def __init__(self) -> None: def __init__(self) -> None:
self.lives = 0 self.lives = 0
self.icons: List[Icon] = [] self.icons: list[Icon] = []
class Team(ba.Team[Player]): class Team(ba.Team[Player]):
@ -164,7 +163,7 @@ class Team(ba.Team[Player]):
def __init__(self) -> None: def __init__(self) -> None:
self.survival_seconds: Optional[int] = None self.survival_seconds: Optional[int] = None
self.spawn_order: List[Player] = [] self.spawn_order: list[Player] = []
# ba_meta export game # ba_meta export game
@ -183,7 +182,7 @@ class EliminationGame(ba.TeamGameActivity[Player, Team]):
@classmethod @classmethod
def get_available_settings( def get_available_settings(
cls, sessiontype: Type[ba.Session]) -> List[ba.Setting]: cls, sessiontype: type[ba.Session]) -> list[ba.Setting]:
settings = [ settings = [
ba.IntSetting( ba.IntSetting(
'Lives Per Player', 'Lives Per Player',
@ -224,12 +223,12 @@ class EliminationGame(ba.TeamGameActivity[Player, Team]):
return settings return settings
@classmethod @classmethod
def supports_session_type(cls, sessiontype: Type[ba.Session]) -> bool: def supports_session_type(cls, sessiontype: type[ba.Session]) -> bool:
return (issubclass(sessiontype, ba.DualTeamSession) return (issubclass(sessiontype, ba.DualTeamSession)
or issubclass(sessiontype, ba.FreeForAllSession)) or issubclass(sessiontype, ba.FreeForAllSession))
@classmethod @classmethod
def get_supported_maps(cls, sessiontype: Type[ba.Session]) -> List[str]: def get_supported_maps(cls, sessiontype: type[ba.Session]) -> list[str]:
return ba.getmaps('melee') return ba.getmaps('melee')
def __init__(self, settings: dict): def __init__(self, settings: dict):
@ -421,7 +420,7 @@ class EliminationGame(ba.TeamGameActivity[Player, Team]):
if living_player: if living_player:
assert living_player_pos is not None assert living_player_pos is not None
player_pos = ba.Vec3(living_player_pos) player_pos = ba.Vec3(living_player_pos)
points: List[Tuple[float, ba.Vec3]] = [] points: list[tuple[float, ba.Vec3]] = []
for team in self.teams: for team in self.teams:
start_pos = ba.Vec3(self.map.get_start_position(team.id)) start_pos = ba.Vec3(self.map.get_start_position(team.id))
points.append( points.append(
@ -539,7 +538,7 @@ class EliminationGame(ba.TeamGameActivity[Player, Team]):
if len(self._get_living_teams()) < 2: if len(self._get_living_teams()) < 2:
self._round_end_timer = ba.Timer(0.5, self.end_game) self._round_end_timer = ba.Timer(0.5, self.end_game)
def _get_living_teams(self) -> List[Team]: def _get_living_teams(self) -> list[Team]:
return [ return [
team for team in self.teams team for team in self.teams
if len(team.players) > 0 and any(player.lives > 0 if len(team.players) > 0 and any(player.lives > 0

View File

@ -26,7 +26,7 @@ from bastd.actor.spazbot import (SpazBotDiedMessage, SpazBotPunchedMessage,
StickyBot, ExplodeyBot) StickyBot, ExplodeyBot)
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, List, Type, Dict, Sequence, Optional, Union from typing import Any, Sequence, Optional, Union
from bastd.actor.spaz import Spaz from bastd.actor.spaz import Spaz
from bastd.actor.spazbot import SpazBot from bastd.actor.spazbot import SpazBot
@ -110,12 +110,12 @@ class FootballTeamGame(ba.TeamGameActivity[Player, Team]):
default_music = ba.MusicType.FOOTBALL default_music = ba.MusicType.FOOTBALL
@classmethod @classmethod
def supports_session_type(cls, sessiontype: Type[ba.Session]) -> bool: def supports_session_type(cls, sessiontype: type[ba.Session]) -> bool:
# We only support two-team play. # We only support two-team play.
return issubclass(sessiontype, ba.DualTeamSession) return issubclass(sessiontype, ba.DualTeamSession)
@classmethod @classmethod
def get_supported_maps(cls, sessiontype: Type[ba.Session]) -> List[str]: def get_supported_maps(cls, sessiontype: type[ba.Session]) -> list[str]:
return ba.getmaps('football') return ba.getmaps('football')
def __init__(self, settings: dict): def __init__(self, settings: dict):
@ -137,7 +137,7 @@ class FootballTeamGame(ba.TeamGameActivity[Player, Team]):
('call', 'at_connect', self._handle_score), ('call', 'at_connect', self._handle_score),
)) ))
self._flag_spawn_pos: Optional[Sequence[float]] = None self._flag_spawn_pos: Optional[Sequence[float]] = None
self._score_regions: List[ba.NodeActor] = [] self._score_regions: list[ba.NodeActor] = []
self._flag: Optional[FootballFlag] = None self._flag: Optional[FootballFlag] = None
self._flag_respawn_timer: Optional[ba.Timer] = None self._flag_respawn_timer: Optional[ba.Timer] = None
self._flag_respawn_light: Optional[ba.NodeActor] = None self._flag_respawn_light: Optional[ba.NodeActor] = None
@ -377,12 +377,12 @@ class FootballCoopGame(ba.CoopGameActivity[Player, Team]):
self._player_has_punched = False self._player_has_punched = False
self._scoreboard: Optional[Scoreboard] = None self._scoreboard: Optional[Scoreboard] = None
self._flag_spawn_pos: Optional[Sequence[float]] = None self._flag_spawn_pos: Optional[Sequence[float]] = None
self._score_regions: List[ba.NodeActor] = [] self._score_regions: list[ba.NodeActor] = []
self._exclude_powerups: List[str] = [] self._exclude_powerups: list[str] = []
self._have_tnt = False self._have_tnt = False
self._bot_types_initial: Optional[List[Type[SpazBot]]] = None self._bot_types_initial: Optional[list[type[SpazBot]]] = None
self._bot_types_7: Optional[List[Type[SpazBot]]] = None self._bot_types_7: Optional[list[type[SpazBot]]] = None
self._bot_types_14: Optional[List[Type[SpazBot]]] = None self._bot_types_14: Optional[list[type[SpazBot]]] = None
self._bot_team: Optional[Team] = None self._bot_team: Optional[Team] = None
self._starttime_ms: Optional[int] = None self._starttime_ms: Optional[int] = None
self._time_text: Optional[ba.NodeActor] = None self._time_text: Optional[ba.NodeActor] = None
@ -436,9 +436,9 @@ class FootballCoopGame(ba.CoopGameActivity[Player, Team]):
controlsguide.ControlsGuide(delay=3.0, lifespan=10.0, controlsguide.ControlsGuide(delay=3.0, lifespan=10.0,
bright=True).autoretain() bright=True).autoretain()
assert self.initialplayerinfos is not None assert self.initialplayerinfos is not None
abot: Type[SpazBot] abot: type[SpazBot]
bbot: Type[SpazBot] bbot: type[SpazBot]
cbot: Type[SpazBot] cbot: type[SpazBot]
if self._preset in ['rookie', 'rookie_easy']: if self._preset in ['rookie', 'rookie_easy']:
self._exclude_powerups = ['curse'] self._exclude_powerups = ['curse']
self._have_tnt = False self._have_tnt = False
@ -467,7 +467,7 @@ class FootballCoopGame(ba.CoopGameActivity[Player, Team]):
self._bot_types_initial = [ChargerBot] * len( self._bot_types_initial = [ChargerBot] * len(
self.initialplayerinfos) self.initialplayerinfos)
abot = (BrawlerBot if self._preset == 'pro' else BrawlerBotLite) abot = (BrawlerBot if self._preset == 'pro' else BrawlerBotLite)
typed_bot_list: List[Type[SpazBot]] = [] typed_bot_list: list[type[SpazBot]] = []
self._bot_types_7 = ( self._bot_types_7 = (
typed_bot_list + [abot] + [BomberBot] * typed_bot_list + [abot] + [BomberBot] *
(1 if len(self.initialplayerinfos) < 3 else 2)) (1 if len(self.initialplayerinfos) < 3 else 2))
@ -479,7 +479,7 @@ class FootballCoopGame(ba.CoopGameActivity[Player, Team]):
self._have_tnt = True self._have_tnt = True
abot = (BrawlerBotPro if self._preset == 'uber' else BrawlerBot) abot = (BrawlerBotPro if self._preset == 'uber' else BrawlerBot)
bbot = (TriggerBotPro if self._preset == 'uber' else TriggerBot) bbot = (TriggerBotPro if self._preset == 'uber' else TriggerBot)
typed_bot_list_2: List[Type[SpazBot]] = [] typed_bot_list_2: list[type[SpazBot]] = []
self._bot_types_initial = (typed_bot_list_2 + [StickyBot] + self._bot_types_initial = (typed_bot_list_2 + [StickyBot] +
[abot] * len(self.initialplayerinfos)) [abot] * len(self.initialplayerinfos))
self._bot_types_7 = ( self._bot_types_7 = (
@ -542,7 +542,7 @@ class FootballCoopGame(ba.CoopGameActivity[Player, Team]):
for bottype in self._bot_types_initial: for bottype in self._bot_types_initial:
self._spawn_bot(bottype) self._spawn_bot(bottype)
def _on_got_scores_to_beat(self, scores: List[Dict[str, Any]]) -> None: def _on_got_scores_to_beat(self, scores: list[dict[str, Any]]) -> None:
self._show_standard_scores_to_beat_ui(scores) self._show_standard_scores_to_beat_ui(scores)
def _on_bot_spawn(self, spaz: SpazBot) -> None: def _on_bot_spawn(self, spaz: SpazBot) -> None:
@ -550,7 +550,7 @@ class FootballCoopGame(ba.CoopGameActivity[Player, Team]):
spaz.target_point_default = ba.Vec3(0, 0, 0) spaz.target_point_default = ba.Vec3(0, 0, 0)
def _spawn_bot(self, def _spawn_bot(self,
spaz_type: Type[SpazBot], spaz_type: type[SpazBot],
immediate: bool = False) -> None: immediate: bool = False) -> None:
assert self._bot_team is not None assert self._bot_team is not None
pos = self.map.get_start_position(self._bot_team.id) pos = self.map.get_start_position(self._bot_team.id)

View File

@ -16,7 +16,7 @@ from bastd.actor.powerupbox import PowerupBoxFactory
from bastd.gameutils import SharedObjects from bastd.gameutils import SharedObjects
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, Sequence, Dict, Type, List, Optional, Union from typing import Any, Sequence, Optional, Union
class PuckDiedMessage: class PuckDiedMessage:
@ -36,7 +36,7 @@ class Puck(ba.Actor):
# Spawn just above the provided point. # Spawn just above the provided point.
self._spawn_pos = (position[0], position[1] + 1.0, position[2]) self._spawn_pos = (position[0], position[1] + 1.0, position[2])
self.last_players_to_touch: Dict[int, Player] = {} self.last_players_to_touch: dict[int, Player] = {}
self.scored = False self.scored = False
assert activity is not None assert activity is not None
assert isinstance(activity, HockeyGame) assert isinstance(activity, HockeyGame)
@ -141,11 +141,11 @@ class HockeyGame(ba.TeamGameActivity[Player, Team]):
default_music = ba.MusicType.HOCKEY default_music = ba.MusicType.HOCKEY
@classmethod @classmethod
def supports_session_type(cls, sessiontype: Type[ba.Session]) -> bool: def supports_session_type(cls, sessiontype: type[ba.Session]) -> bool:
return issubclass(sessiontype, ba.DualTeamSession) return issubclass(sessiontype, ba.DualTeamSession)
@classmethod @classmethod
def get_supported_maps(cls, sessiontype: Type[ba.Session]) -> List[str]: def get_supported_maps(cls, sessiontype: type[ba.Session]) -> list[str]:
return ba.getmaps('hockey') return ba.getmaps('hockey')
def __init__(self, settings: dict): def __init__(self, settings: dict):
@ -199,7 +199,7 @@ class HockeyGame(ba.TeamGameActivity[Player, Team]):
True), ('modify_part_collision', 'physical', False), True), ('modify_part_collision', 'physical', False),
('call', 'at_connect', self._handle_score))) ('call', 'at_connect', self._handle_score)))
self._puck_spawn_pos: Optional[Sequence[float]] = None self._puck_spawn_pos: Optional[Sequence[float]] = None
self._score_regions: Optional[List[ba.NodeActor]] = None self._score_regions: Optional[list[ba.NodeActor]] = None
self._puck: Optional[Puck] = None self._puck: Optional[Puck] = None
self._score_to_win = int(settings['Score to Win']) self._score_to_win = int(settings['Score to Win'])
self._time_limit = float(settings['Time Limit']) self._time_limit = float(settings['Time Limit'])

View File

@ -17,7 +17,7 @@ from bastd.actor.flag import (Flag, FlagDroppedMessage, FlagDiedMessage,
FlagPickedUpMessage) FlagPickedUpMessage)
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, Type, List, Dict, Optional, Sequence, Union from typing import Any, Optional, Sequence, Union
class FlagState(Enum): class FlagState(Enum):
@ -81,12 +81,12 @@ class KeepAwayGame(ba.TeamGameActivity[Player, Team]):
default_music = ba.MusicType.KEEP_AWAY default_music = ba.MusicType.KEEP_AWAY
@classmethod @classmethod
def supports_session_type(cls, sessiontype: Type[ba.Session]) -> bool: def supports_session_type(cls, sessiontype: type[ba.Session]) -> bool:
return (issubclass(sessiontype, ba.DualTeamSession) return (issubclass(sessiontype, ba.DualTeamSession)
or issubclass(sessiontype, ba.FreeForAllSession)) or issubclass(sessiontype, ba.FreeForAllSession))
@classmethod @classmethod
def get_supported_maps(cls, sessiontype: Type[ba.Session]) -> List[str]: def get_supported_maps(cls, sessiontype: type[ba.Session]) -> list[str]:
return ba.getmaps('keep_away') return ba.getmaps('keep_away')
def __init__(self, settings: dict): def __init__(self, settings: dict):
@ -108,7 +108,7 @@ class KeepAwayGame(ba.TeamGameActivity[Player, Team]):
} }
self._flag_spawn_pos: Optional[Sequence[float]] = None self._flag_spawn_pos: Optional[Sequence[float]] = None
self._update_timer: Optional[ba.Timer] = None self._update_timer: Optional[ba.Timer] = None
self._holding_players: List[Player] = [] self._holding_players: list[Player] = []
self._flag_state: Optional[FlagState] = None self._flag_state: Optional[FlagState] = None
self._flag_light: Optional[ba.Node] = None self._flag_light: Optional[ba.Node] = None
self._scoring_team: Optional[Team] = None self._scoring_team: Optional[Team] = None

View File

@ -18,8 +18,7 @@ from bastd.actor.scoreboard import Scoreboard
from bastd.gameutils import SharedObjects from bastd.gameutils import SharedObjects
if TYPE_CHECKING: if TYPE_CHECKING:
from weakref import ReferenceType from typing import Any, Optional, Sequence, Union
from typing import Any, Type, List, Dict, Optional, Sequence, Union
class FlagState(Enum): class FlagState(Enum):
@ -84,11 +83,11 @@ class KingOfTheHillGame(ba.TeamGameActivity[Player, Team]):
scoreconfig = ba.ScoreConfig(label='Time Held') scoreconfig = ba.ScoreConfig(label='Time Held')
@classmethod @classmethod
def supports_session_type(cls, sessiontype: Type[ba.Session]) -> bool: def supports_session_type(cls, sessiontype: type[ba.Session]) -> bool:
return issubclass(sessiontype, ba.MultiTeamSession) return issubclass(sessiontype, ba.MultiTeamSession)
@classmethod @classmethod
def get_supported_maps(cls, sessiontype: Type[ba.Session]) -> List[str]: def get_supported_maps(cls, sessiontype: type[ba.Session]) -> list[str]:
return ba.getmaps('king_of_the_hill') return ba.getmaps('king_of_the_hill')
def __init__(self, settings: dict): def __init__(self, settings: dict):
@ -113,7 +112,7 @@ class KingOfTheHillGame(ba.TeamGameActivity[Player, Team]):
self._flag_state: Optional[FlagState] = None self._flag_state: Optional[FlagState] = None
self._flag: Optional[Flag] = None self._flag: Optional[Flag] = None
self._flag_light: Optional[ba.Node] = None self._flag_light: Optional[ba.Node] = None
self._scoring_team: Optional[ReferenceType[Team]] = None self._scoring_team: Optional[weakref.ref[Team]] = None
self._hold_time = int(settings['Hold Time']) self._hold_time = int(settings['Hold Time'])
self._time_limit = float(settings['Time Limit']) self._time_limit = float(settings['Time Limit'])
self._flag_region_material = ba.Material() self._flag_region_material = ba.Material()

View File

@ -15,7 +15,7 @@ from bastd.actor.bomb import Bomb
from bastd.actor.onscreentimer import OnScreenTimer from bastd.actor.onscreentimer import OnScreenTimer
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, Sequence, Optional, List, Dict, Type, Type from typing import Any, Sequence, Optional
class Player(ba.Player['Team']): class Player(ba.Player['Team']):
@ -50,12 +50,12 @@ class MeteorShowerGame(ba.TeamGameActivity[Player, Team]):
# We're currently hard-coded for one map. # We're currently hard-coded for one map.
@classmethod @classmethod
def get_supported_maps(cls, sessiontype: Type[ba.Session]) -> List[str]: def get_supported_maps(cls, sessiontype: type[ba.Session]) -> list[str]:
return ['Rampage'] return ['Rampage']
# We support teams, free-for-all, and co-op sessions. # We support teams, free-for-all, and co-op sessions.
@classmethod @classmethod
def supports_session_type(cls, sessiontype: Type[ba.Session]) -> bool: def supports_session_type(cls, sessiontype: type[ba.Session]) -> bool:
return (issubclass(sessiontype, ba.DualTeamSession) return (issubclass(sessiontype, ba.DualTeamSession)
or issubclass(sessiontype, ba.FreeForAllSession) or issubclass(sessiontype, ba.FreeForAllSession)
or issubclass(sessiontype, ba.CoopSession)) or issubclass(sessiontype, ba.CoopSession))

View File

@ -15,7 +15,7 @@ from bastd.actor.spazbot import SpazBotSet, ChargerBot, SpazBotDiedMessage
from bastd.actor.onscreentimer import OnScreenTimer from bastd.actor.onscreentimer import OnScreenTimer
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, Type, Dict, List, Optional from typing import Any, Optional
class Player(ba.Player['Team']): class Player(ba.Player['Team']):
@ -41,14 +41,14 @@ class NinjaFightGame(ba.TeamGameActivity[Player, Team]):
default_music = ba.MusicType.TO_THE_DEATH default_music = ba.MusicType.TO_THE_DEATH
@classmethod @classmethod
def get_supported_maps(cls, sessiontype: Type[ba.Session]) -> List[str]: def get_supported_maps(cls, sessiontype: type[ba.Session]) -> list[str]:
# For now we're hard-coding spawn positions and whatnot # For now we're hard-coding spawn positions and whatnot
# so we need to be sure to specify that we only support # so we need to be sure to specify that we only support
# a specific map. # a specific map.
return ['Courtyard'] return ['Courtyard']
@classmethod @classmethod
def supports_session_type(cls, sessiontype: Type[ba.Session]) -> bool: def supports_session_type(cls, sessiontype: type[ba.Session]) -> bool:
# We currently support Co-Op only. # We currently support Co-Op only.
return issubclass(sessiontype, ba.CoopSession) return issubclass(sessiontype, ba.CoopSession)

View File

@ -28,21 +28,21 @@ from bastd.actor.spazbot import (
TriggerBotProShielded, BrawlerBotPro, BomberBotProShielded) TriggerBotProShielded, BrawlerBotPro, BomberBotProShielded)
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any, Type, Dict, Optional, List, Tuple, Union, Sequence from typing import Any, Optional, Union, Sequence
from bastd.actor.spazbot import SpazBot from bastd.actor.spazbot import SpazBot
@dataclass @dataclass
class Wave: class Wave:
"""A wave of enemies.""" """A wave of enemies."""
entries: List[Union[Spawn, Spacing, Delay, None]] entries: list[Union[Spawn, Spacing, Delay, None]]
base_angle: float = 0.0 base_angle: float = 0.0
@dataclass @dataclass
class Spawn: class Spawn:
"""A bot spawn event in a wave.""" """A bot spawn event in a wave."""
bottype: Union[Type[SpazBot], str] bottype: Union[type[SpazBot], str]
point: Optional[Point] = None point: Optional[Point] = None
spacing: float = 5.0 spacing: float = 5.0
@ -123,7 +123,7 @@ class OnslaughtGame(ba.CoopGameActivity[Player, Team]):
name = 'Onslaught' name = 'Onslaught'
description = 'Defeat all enemies.' description = 'Defeat all enemies.'
tips: List[Union[str, ba.GameTip]] = [ tips: list[Union[str, ba.GameTip]] = [
'Hold any button to run.' 'Hold any button to run.'
' (Trigger buttons work well if you have them)', ' (Trigger buttons work well if you have them)',
'Try tricking enemies into killing eachother or running off cliffs.', 'Try tricking enemies into killing eachother or running off cliffs.',
@ -179,8 +179,8 @@ class OnslaughtGame(ba.CoopGameActivity[Player, Team]):
self._dingsound = ba.getsound('dingSmall') self._dingsound = ba.getsound('dingSmall')
self._dingsoundhigh = ba.getsound('dingSmallHigh') self._dingsoundhigh = ba.getsound('dingSmallHigh')
self._have_tnt = False self._have_tnt = False
self._excluded_powerups: Optional[List[str]] = None self._excluded_powerups: Optional[list[str]] = None
self._waves: List[Wave] = [] self._waves: list[Wave] = []
self._tntspawner: Optional[TNTSpawner] = None self._tntspawner: Optional[TNTSpawner] = None
self._bots: Optional[SpazBotSet] = None self._bots: Optional[SpazBotSet] = None
self._powerup_drop_timer: Optional[ba.Timer] = None self._powerup_drop_timer: Optional[ba.Timer] = None
@ -538,10 +538,10 @@ class OnslaughtGame(ba.CoopGameActivity[Player, Team]):
self._bots = SpazBotSet() self._bots = SpazBotSet()
ba.timer(4.0, self._start_updating_waves) ba.timer(4.0, self._start_updating_waves)
def _on_got_scores_to_beat(self, scores: List[Dict[str, Any]]) -> None: def _on_got_scores_to_beat(self, scores: list[dict[str, Any]]) -> None:
self._show_standard_scores_to_beat_ui(scores) self._show_standard_scores_to_beat_ui(scores)
def _get_dist_grp_totals(self, grps: List[Any]) -> Tuple[int, int]: def _get_dist_grp_totals(self, grps: list[Any]) -> tuple[int, int]:
totalpts = 0 totalpts = 0
totaldudes = 0 totaldudes = 0
for grp in grps: for grp in grps:
@ -553,11 +553,11 @@ class OnslaughtGame(ba.CoopGameActivity[Player, Team]):
def _get_distribution(self, target_points: int, min_dudes: int, def _get_distribution(self, target_points: int, min_dudes: int,
max_dudes: int, group_count: int, max_dudes: int, group_count: int,
max_level: int) -> List[List[Tuple[int, int]]]: max_level: int) -> list[list[tuple[int, int]]]:
"""Calculate a distribution of bad guys given some params.""" """Calculate a distribution of bad guys given some params."""
max_iterations = 10 + max_dudes * 2 max_iterations = 10 + max_dudes * 2
groups: List[List[Tuple[int, int]]] = [] groups: list[list[tuple[int, int]]] = []
for _g in range(group_count): for _g in range(group_count):
groups.append([]) groups.append([])
types = [1] types = [1]
@ -599,9 +599,9 @@ class OnslaughtGame(ba.CoopGameActivity[Player, Team]):
return groups return groups
def _add_dist_entry_if_possible(self, groups: List[List[Tuple[int, int]]], def _add_dist_entry_if_possible(self, groups: list[list[tuple[int, int]]],
max_dudes: int, target_points: int, max_dudes: int, target_points: int,
types: List[int]) -> int: types: list[int]) -> int:
# See how much we're off our target by. # See how much we're off our target by.
total_points, total_dudes = self._get_dist_grp_totals(groups) total_points, total_dudes = self._get_dist_grp_totals(groups)
diff = target_points - total_points diff = target_points - total_points
@ -624,7 +624,7 @@ class OnslaughtGame(ba.CoopGameActivity[Player, Team]):
return diff return diff
def _delete_smallest_dist_entry( def _delete_smallest_dist_entry(
self, groups: List[List[Tuple[int, int]]]) -> None: self, groups: list[list[tuple[int, int]]]) -> None:
smallest_value = 9999 smallest_value = 9999
smallest_entry = None smallest_entry = None
smallest_entry_group = None smallest_entry_group = None
@ -639,7 +639,7 @@ class OnslaughtGame(ba.CoopGameActivity[Player, Team]):
smallest_entry_group.remove(smallest_entry) smallest_entry_group.remove(smallest_entry)
def _delete_biggest_dist_entry( def _delete_biggest_dist_entry(
self, groups: List[List[Tuple[int, int]]]) -> None: self, groups: list[list[tuple[int, int]]]) -> None:
biggest_value = 9999 biggest_value = 9999
biggest_entry = None biggest_entry = None
biggest_entry_group = None biggest_entry_group = None
@ -654,7 +654,7 @@ class OnslaughtGame(ba.CoopGameActivity[Player, Team]):
biggest_entry_group.remove(biggest_entry) biggest_entry_group.remove(biggest_entry)
def _delete_random_dist_entry(self, def _delete_random_dist_entry(self,
groups: List[List[Tuple[int, int]]]) -> None: groups: list[list[tuple[int, int]]]) -> None:
entry_count = 0 entry_count = 0
for group in groups: for group in groups:
for _ in group: for _ in group:
@ -1025,7 +1025,7 @@ class OnslaughtGame(ba.CoopGameActivity[Player, Team]):
'text': wttxt 'text': wttxt
})) }))
def _bot_levels_for_wave(self) -> List[List[Type[SpazBot]]]: def _bot_levels_for_wave(self) -> list[list[type[SpazBot]]]:
level = self._wavenum level = self._wavenum
bot_types = [ bot_types = [
BomberBot, BrawlerBot, TriggerBot, ChargerBot, BomberBotPro, BomberBot, BrawlerBot, TriggerBot, ChargerBot, BomberBotPro,
@ -1068,10 +1068,10 @@ class OnslaughtGame(ba.CoopGameActivity[Player, Team]):
return bot_levels return bot_levels
def _add_entries_for_distribution_group( def _add_entries_for_distribution_group(
self, group: List[Tuple[int, int]], self, group: list[tuple[int, int]],
bot_levels: List[List[Type[SpazBot]]], bot_levels: list[list[type[SpazBot]]],
all_entries: List[Union[Spawn, Spacing, Delay, None]]) -> None: all_entries: list[Union[Spawn, Spacing, Delay, None]]) -> None:
entries: List[Union[Spawn, Spacing, Delay, None]] = [] entries: list[Union[Spawn, Spacing, Delay, None]] = []
for entry in group: for entry in group:
bot_level = bot_levels[entry[0] - 1] bot_level = bot_levels[entry[0] - 1]
bot_type = bot_level[random.randrange(len(bot_level))] bot_type = bot_level[random.randrange(len(bot_level))]
@ -1106,7 +1106,7 @@ class OnslaughtGame(ba.CoopGameActivity[Player, Team]):
distribution = self._get_distribution(target_points, min_dudes, distribution = self._get_distribution(target_points, min_dudes,
max_dudes, group_count, max_dudes, group_count,
max_level) max_level)
all_entries: List[Union[Spawn, Spacing, Delay, None]] = [] all_entries: list[Union[Spawn, Spacing, Delay, None]] = []
for group in distribution: for group in distribution:
self._add_entries_for_distribution_group(group, bot_levels, self._add_entries_for_distribution_group(group, bot_levels,
all_entries) all_entries)
@ -1125,7 +1125,7 @@ class OnslaughtGame(ba.CoopGameActivity[Player, Team]):
def add_bot_at_point(self, def add_bot_at_point(self,
point: Point, point: Point,
spaz_type: Type[SpazBot], spaz_type: type[SpazBot],
spawn_time: float = 1.0) -> None: spawn_time: float = 1.0) -> None:
"""Add a new bot at a specified named point.""" """Add a new bot at a specified named point."""
if self._game_over: if self._game_over:
@ -1137,7 +1137,7 @@ class OnslaughtGame(ba.CoopGameActivity[Player, Team]):
def add_bot_at_angle(self, def add_bot_at_angle(self,
angle: float, angle: float,
spaz_type: Type[SpazBot], spaz_type: type[SpazBot],
spawn_time: float = 1.0) -> None: spawn_time: float = 1.0) -> None:
"""Add a new bot at a specified angle (for circular maps).""" """Add a new bot at a specified angle (for circular maps)."""
if self._game_over: if self._game_over:

View File

@ -18,8 +18,7 @@ from bastd.actor.scoreboard import Scoreboard
from bastd.gameutils import SharedObjects from bastd.gameutils import SharedObjects
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import (Any, Type, Tuple, List, Sequence, Optional, Dict, from typing import Any, Sequence, Optional, Union
Union)
from bastd.actor.onscreentimer import OnScreenTimer from bastd.actor.onscreentimer import OnScreenTimer
@ -83,7 +82,7 @@ class RaceGame(ba.TeamGameActivity[Player, Team]):
@classmethod @classmethod
def get_available_settings( def get_available_settings(
cls, sessiontype: Type[ba.Session]) -> List[ba.Setting]: cls, sessiontype: type[ba.Session]) -> list[ba.Setting]:
settings = [ settings = [
ba.IntSetting('Laps', min_value=1, default=3, increment=1), ba.IntSetting('Laps', min_value=1, default=3, increment=1),
ba.IntChoiceSetting( ba.IntChoiceSetting(
@ -129,11 +128,11 @@ class RaceGame(ba.TeamGameActivity[Player, Team]):
return settings return settings
@classmethod @classmethod
def supports_session_type(cls, sessiontype: Type[ba.Session]) -> bool: def supports_session_type(cls, sessiontype: type[ba.Session]) -> bool:
return issubclass(sessiontype, ba.MultiTeamSession) return issubclass(sessiontype, ba.MultiTeamSession)
@classmethod @classmethod
def get_supported_maps(cls, sessiontype: Type[ba.Session]) -> List[str]: def get_supported_maps(cls, sessiontype: type[ba.Session]) -> list[str]:
return ba.getmaps('race') return ba.getmaps('race')
def __init__(self, settings: dict): def __init__(self, settings: dict):
@ -148,15 +147,15 @@ class RaceGame(ba.TeamGameActivity[Player, Team]):
self._beep_1_sound = ba.getsound('raceBeep1') self._beep_1_sound = ba.getsound('raceBeep1')
self._beep_2_sound = ba.getsound('raceBeep2') self._beep_2_sound = ba.getsound('raceBeep2')
self.race_region_material: Optional[ba.Material] = None self.race_region_material: Optional[ba.Material] = None
self._regions: List[RaceRegion] = [] self._regions: list[RaceRegion] = []
self._team_finish_pts: Optional[int] = None self._team_finish_pts: Optional[int] = None
self._time_text: Optional[ba.Actor] = None self._time_text: Optional[ba.Actor] = None
self._timer: Optional[OnScreenTimer] = None self._timer: Optional[OnScreenTimer] = None
self._race_mines: Optional[List[RaceMine]] = None self._race_mines: Optional[list[RaceMine]] = None
self._race_mine_timer: Optional[ba.Timer] = None self._race_mine_timer: Optional[ba.Timer] = None
self._scoreboard_timer: Optional[ba.Timer] = None self._scoreboard_timer: Optional[ba.Timer] = None
self._player_order_update_timer: Optional[ba.Timer] = None self._player_order_update_timer: Optional[ba.Timer] = None
self._start_lights: Optional[List[ba.Node]] = None self._start_lights: Optional[list[ba.Node]] = None
self._bomb_spawn_timer: Optional[ba.Timer] = None self._bomb_spawn_timer: Optional[ba.Timer] = None
self._laps = int(settings['Laps']) self._laps = int(settings['Laps'])
self._entire_team_must_finish = bool( self._entire_team_must_finish = bool(

Some files were not shown because too many files have changed in this diff Show More