# Released under the MIT License. See LICENSE for details.#"""Functionality for user-controllable settings."""from__future__importannotationsfromtypingimportTYPE_CHECKINGfromdataclassesimportdataclassifTYPE_CHECKING:fromtypingimportAny
[docs]@dataclassclassSetting:"""Defines a user-controllable setting for a game or other entity."""name:strdefault:Any
[docs]@dataclassclassBoolSetting(Setting):"""A boolean game setting."""default:bool
[docs]@dataclassclassIntSetting(Setting):"""An integer game setting."""default:intmin_value:int=0max_value:int=9999increment:int=1
[docs]@dataclassclassFloatSetting(Setting):"""A floating point game setting."""default:floatmin_value:float=0.0max_value:float=9999.0increment:float=1.0
[docs]@dataclassclassChoiceSetting(Setting):"""A setting with multiple choices."""choices:list[tuple[str,Any]]
[docs]@dataclassclassIntChoiceSetting(ChoiceSetting):"""An int setting with multiple choices."""default:intchoices:list[tuple[str,int]]
[docs]@dataclassclassFloatChoiceSetting(ChoiceSetting):"""A float setting with multiple choices."""default:floatchoices:list[tuple[str,float]]
# Docs-generation hack; import some stuff that we likely only forward-declared# in our actual source code so that docs tools can find it.fromtypingimport(Coroutine,Any,Literal,Callable,Generator,Awaitable,Sequence,Self)importasynciofromconcurrent.futuresimportFuture