Перейти к содержанию

игровые правила

Игровые правила.

В зависимости от выбранных правил изменяться поведение игры.

GameRules

Python
GameRules()

битовые флаги игровых правил.

auto_choose_color instance-attribute

Python
auto_choose_color = Rule(self, 7, '🌷 самоцвет')

auto_skip instance-attribute

Python
auto_skip = Rule(self, 3, '💸 Авто пропуск')

deferred_take instance-attribute

Python
deferred_take = Rule(self, 6, '⏳ Отложенное взятие')

intervention instance-attribute

Python
intervention = Rule(self, 12, '😈 Вмешательство 🔧')

one_winner instance-attribute

Python
one_winner = Rule(self, 2, '👑 Один победитель')

random_cards instance-attribute

Python
random_cards = Rule(self, 11, '🎰 Случайные карты')

random_color instance-attribute

Python
random_color = Rule(self, 8, '🎲 Какой цвет')

rotate_cards instance-attribute

Python
rotate_cards = Rule(self, 1, '🌀 Круговой обмен')

rule_flags instance-attribute

Python
rule_flags = 0

rules instance-attribute

Python
rules: list[Rule] = []

shotgun instance-attribute

Python
shotgun = Rule(self, 5, '🔫 Револьвер')

side_effect instance-attribute

Python
side_effect = Rule(self, 9, '💎 Побочный выброс')

special_wild instance-attribute

Python
special_wild = Rule(self, 13, '❤️ Особая дикость')

take_until_cover instance-attribute

Python
take_until_cover = Rule(self, 4, '🍷 Беру до последнего')

twist_hand instance-attribute

Python
twist_hand = Rule(self, 0, '🤝 Обмен картами')

twist_hand_pass instance-attribute

Python
twist_hand_pass = Rule(self, 10, '👋 Без обмена')

iter_rules

Python
iter_rules() -> Iterator[tuple[str, bool]]

Возвращает итератор правил.

toggle

Python
toggle(rule: int) -> None

Переключает состояние битового флага.

Rule

Python
Rule(rules: GameRules, index: int, name: str)

Игровое правило.

index instance-attribute

Python
index = 1 << index

name instance-attribute

Python
name = name

rules instance-attribute

Python
rules = rules

status property

Python
status: bool

Проверяет, установлен ли битовый флаг.