Bombsquad-Ballistica-Modded.../dist/ba_data/python/bacommon/app.py

147 lines
4.6 KiB
Python
Raw Normal View History

2023-09-30 17:21:33 +05:30
# Released under the MIT License. See LICENSE for details.
#
2025-04-06 17:17:13 +05:30
"""Common high level values/functionality related to Ballistica apps."""
2023-09-30 17:21:33 +05:30
from __future__ import annotations
from enum import Enum
2025-05-26 01:11:57 +05:30
from typing import TYPE_CHECKING
2025-04-06 17:17:13 +05:30
2023-09-30 17:21:33 +05:30
if TYPE_CHECKING:
pass
2025-05-26 01:11:57 +05:30
# NOTE TO SELF - These are used on various server components, so be sure
# to update ALL servers before running any clients that might be using
# newly defined values. Alterntely we could set up fallback values but I
# don't think that will be necessary and could mask problems.
2023-09-30 17:21:33 +05:30
2023-12-21 15:55:50 +05:30
class AppInterfaceIdiom(Enum):
2024-05-19 18:25:43 +05:30
"""A general form-factor or method of experiencing a Ballistica app.
2023-12-21 15:55:50 +05:30
2025-04-06 17:17:13 +05:30
Note that it may be possible for a running app to switch idioms (for
2023-12-21 15:55:50 +05:30
instance if a mobile device or computer is connected to a TV).
"""
2025-04-06 17:17:13 +05:30
#: Small screen; assumed to have touch as primary input.
2025-05-26 01:11:57 +05:30
PHONE = 'phone'
2025-04-06 17:17:13 +05:30
#: Medium size screen; assumed to have touch as primary input.
2025-05-26 01:11:57 +05:30
TABLET = 'tablet'
2025-04-06 17:17:13 +05:30
2025-05-26 01:11:57 +05:30
#: Screen with medium amount of detail visible; assumed to have game
#: controller(s) as primary input. Note that this covers handheld or
#: arcade cabinet scenarios in addition to tv-connected consoles.
CONSOLE = 'console'
2025-04-06 17:17:13 +05:30
2025-05-26 01:11:57 +05:30
#: Screen with high amount of detail visible; assumed to have
2025-04-06 17:17:13 +05:30
#: keyboard/mouse as primary input.
2025-05-26 01:11:57 +05:30
DESKTOP = 'desktop'
2025-04-06 17:17:13 +05:30
#: Displayed over or in place of of the real world on a headset;
2025-05-26 01:11:57 +05:30
#: assumed to have hand tracking or spatial controllers as primary
2025-04-06 17:17:13 +05:30
#: input.
2025-05-26 01:11:57 +05:30
XR_HEADSET = 'xr_headset'
#: Displayed over or instead of the real world on a small screen;
#: assumed to have device movement augmented by physical or
#: touchscreen controls as primary input.
XR_PHONE = 'xr_phone'
#: Displayed over or instead of the real world on a medium size
#: screen; assumed to have device movement augmented by physical or
#: touchscreen controls as primary input.
XR_TABLET = 'xr_tablet'
#: The app has no interface (generally is acting as a server).
HEADLESS = 'headless'
# UPDATE: Don't think this will be necessary. Will keep it around for a
# moment in case I change my mind. Current plan is to just have AppModes
# check for compatible AppInterfaceIdioms or whatever else as part of
# their can_handle_intent() call.
# class AppExperience(Enum):
# """A type of experience provided by a Ballistica app.
# This metric is used to ensure that an :class:`~babase.AppMode` can
# be properly presented by a running app. Requirements for supporting
# an experience can include things like running in a particular
# :class:`AppInterfaceIdiom` or having particular features or input
# device(s) present.
# """
2023-09-30 17:21:33 +05:30
2025-05-26 01:11:57 +05:30
# #: A special experience that is supported everywhere. Used for the
# #: default empty AppMode when starting the app, etc.
# EMPTY = 'empty'
2023-09-30 17:21:33 +05:30
2025-05-26 01:11:57 +05:30
# #: The traditional BombSquad experience - multiple players using
# #: game controllers (or touch screen equivalents) in a single arena
# #: small enough for all action to be viewed on a single screen.
# MELEE = 'melee'
2023-09-30 17:21:33 +05:30
2025-05-26 01:11:57 +05:30
# #: The traditional BombSquad Remote experience; buttons on a
# #: touch-screen allowing a mobile device to be used as a game
# #: controller.
# REMOTE = 'remote'
2023-12-21 15:55:50 +05:30
class AppArchitecture(Enum):
2025-04-06 17:17:13 +05:30
"""Processor architecture an app can be running on."""
2023-12-21 15:55:50 +05:30
2025-05-26 01:11:57 +05:30
UNKNOWN = 'unknown'
2023-12-21 15:55:50 +05:30
ARM = 'arm'
ARM64 = 'arm64'
X86 = 'x86'
2025-05-26 01:11:57 +05:30
X86_64 = 'x86_64'
2023-12-21 15:55:50 +05:30
class AppPlatform(Enum):
2025-04-06 17:17:13 +05:30
"""Overall platform a build can target.
2023-12-21 15:55:50 +05:30
2025-02-09 00:17:58 +05:30
Each distinct flavor of an app has a unique combination of
AppPlatform and AppVariant. Generally platform describes a set of
hardware, while variant describes a destination or purpose for the
build.
2023-12-21 15:55:50 +05:30
"""
2025-05-26 01:11:57 +05:30
UNKNOWN = 'unknown'
MACOS = 'macos'
WINDOWS = 'windows'
LINUX = 'linux'
ANDROID = 'android'
2023-12-21 15:55:50 +05:30
IOS = 'ios'
TVOS = 'tvos'
class AppVariant(Enum):
2025-09-07 18:34:55 +05:30
"""A unique Ballistica build variation within a single platform.
2023-12-21 15:55:50 +05:30
2025-09-07 18:34:55 +05:30
Each distinct permutation of an app has a unique combination of
:class:`AppPlatform` and ``AppVariant``. Generally platform
describes a set of hardware, while variant describes a destination
or purpose for the build.
2023-12-21 15:55:50 +05:30
"""
2025-04-06 17:17:13 +05:30
#: Default builds.
2025-05-26 01:11:57 +05:30
GENERIC = 'generic'
2023-12-21 15:55:50 +05:30
2025-05-26 01:11:57 +05:30
#: Particular builds intended for public testing (may have some extra
#: checks or logging enabled).
TEST_BUILD = 'test_build'
2023-12-21 15:55:50 +05:30
# Various stores.
2025-05-26 01:11:57 +05:30
AMAZON_APPSTORE = 'amazon_appstore'
GOOGLE_PLAY = 'google_play'
APPLE_APP_STORE = 'apple_app_store'
WINDOWS_STORE = 'windows_store'
STEAM = 'steam'
2023-12-21 15:55:50 +05:30
META = 'meta'
2025-05-26 01:11:57 +05:30
EPIC_GAMES_STORE = 'epic_games_store'
2023-12-21 15:55:50 +05:30
# Other.
2025-05-26 01:11:57 +05:30
ARCADE = 'arcade'
2023-12-21 15:55:50 +05:30
DEMO = 'demo'
2025-05-26 01:11:57 +05:30
CARDBOARD = 'cardboard'