bec_widgets.widgets.games ========================= .. py:module:: bec_widgets.widgets.games Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/bec_widgets/widgets/games/minesweeper/index /autoapi/bec_widgets/widgets/games/minesweeper_plugin/index /autoapi/bec_widgets/widgets/games/register_minesweeper/index Classes ------- .. autoapisummary:: bec_widgets.widgets.games.Minesweeper Package Contents ---------------- .. py:class:: Minesweeper(parent=None, *args, **kwargs) Bases: :py:obj:`bec_widgets.utils.bec_widget.BECWidget`, :py:obj:`qtpy.QtWidgets.QWidget` Mixin class for all BEC widgets, to handle cleanup Base class for all BEC widgets. This class should be used as a mixin class for all BEC widgets, e.g.: >>> class MyWidget(BECWidget, QWidget): >>> def __init__(self, parent=None, client=None, config=None, gui_id=None): >>> super().__init__(parent=parent, client=client, config=config, gui_id=gui_id) :param client: The BEC client. :type client: BECClient, optional :param config: The connection configuration. :type config: ConnectionConfig, optional :param gui_id: The GUI ID. :type gui_id: str, optional :param theme_update: Whether to subscribe to theme updates. Defaults to False. When set to True, the widget's apply_theme method will be called when the theme changes. :type theme_update: bool, optional .. py:method:: _init_map() Redraw the grid of mines .. py:method:: _init_ui() .. py:method:: _set_level_params(level: tuple[int, int]) .. py:method:: change_level(level: str) .. py:method:: check_win() Check if the game is won. .. py:method:: cleanup() Cleanup the widget. .. py:method:: expand_reveal(x, y) Expand the reveal to the surrounding :param x: The x position. :type x: int :param y: The y position. :type y: int .. py:method:: game_over() Cause the game to end early .. py:method:: get_num_hidden() -> int Get the number of hidden positions. .. py:method:: get_num_remaining_flags() -> int Get the number of remaining flags. .. py:method:: get_surrounding(x, y) .. py:method:: on_click() Handle the click event. If the game is not started, start the game. .. py:method:: reset_button_pressed() .. py:method:: reset_map() Reset the map and add new mines. .. py:method:: reveal_map() .. py:method:: update_available_flags() Update the number of available flags. .. py:method:: update_status(status: GameStatus) Update the status of the game. :param status: The status of the game. :type status: GameStatus .. py:method:: update_timer() Update the timer. .. py:attribute:: ICON_NAME :value: 'videogame_asset' .. py:attribute:: PLUGIN :value: True .. py:attribute:: RPC :value: True .. py:attribute:: USER_ACCESS :value: []