utils module¶
Utils package.
A bunch of useful (or completely useless) methods.
utils.exceptions¶
Module name: exceptions
Defines certain specific exceptions that may be raised during or before the game. This module may disappear in the future.
- exception game.utils.exceptions.InvalidGamePropertyValue(message)¶
Bases:
ExceptionClass for creating the exception caused by an invalid game property value.
- add_note(object, /)¶
Exception.add_note(note) – add a note to the exception
- args¶
- with_traceback(object, /)¶
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception game.utils.exceptions.InvalidMapData(message='Invalid map data, have you initialise the map with initialise()?')¶
Bases:
ExceptionClass for creating the exception caused by invalid map data.
- add_note(object, /)¶
Exception.add_note(note) – add a note to the exception
- args¶
- with_traceback(object, /)¶
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception game.utils.exceptions.InvalidTextureAtlas(message='Invalid texture atlas, have you loaded one with set_atlas()?')¶
Bases:
ExceptionClass for creating the exception caused by loading an invalid texture atlas.
- add_note(object, /)¶
Exception.add_note(note) – add a note to the exception
- args¶
- with_traceback(object, /)¶
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception game.utils.exceptions.MaxPlayersReached(message='The player number limit has been reached, please come back later.')¶
Bases:
ExceptionClass for creating the exception caused by reaching the maximum player count of a server.
- add_note(object, /)¶
Exception.add_note(note) – add a note to the exception
- args¶
- with_traceback(object, /)¶
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception game.utils.exceptions.OutOfMapBounds(message='Out of map boundaries, make sure to stay within them!')¶
Bases:
ExceptionClass for creating the exception caused by overflowing the map data array.
- add_note(object, /)¶
Exception.add_note(note) – add a note to the exception
- args¶
- with_traceback(object, /)¶
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception game.utils.exceptions.PlayerNameAlreadyExists(message='Your current player name is already taken, please change it.')¶
Bases:
ExceptionClass for creating the exception caused by joining a server with an in-game name that is already taken.
- add_note(object, /)¶
Exception.add_note(note) – add a note to the exception
- args¶
- with_traceback(object, /)¶
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception game.utils.exceptions.ZeroOrLessSpawnPlayerAttempts(message='Number of attempts to choose player spawn point must be at least 1.')¶
Bases:
ExceptionClass for creating the exception caused by setting the number of attempts to zero or less when finding an ideal spawn point for the player.
- add_note(object, /)¶
Exception.add_note(note) – add a note to the exception
- args¶
- with_traceback(object, /)¶
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
utils.logger¶
Module name: logger
This module defines the logger.
utils.tools¶
Module name: logger
This module defines the logger.
- game.utils.tools.c_log2(x: SupportsFloat | SupportsIndex, /) int¶
Return cast int ceiling log2 of the given value.
utils.translator¶
Module name: translator
This module configures the translator.