-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhero.py
39 lines (32 loc) · 1.29 KB
/
hero.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from enum import StrEnum
import random
class HeroName(StrEnum):
MELYIVO_FRED = "Melyivo Fred"
LOTTYINTOS = "Lottyintos"
KUV_EVI = "Kuv Evi"
POHARNOK = "Poharnok"
RECYCLE_BELA = "Recycle Bela"
SARKI_JEZUS = "Sarki Jezus"
SOMMELIER_PITYU = "Sommelier Pityu"
VIZKOPO_KARESZ = "Vizkopo Karesz"
BOSKE_A_RETTENTO = "Boske, a Rettento"
HOLLOSI_ELVTARS = "Hollosi elvtars"
BUZGOMOCSING = "Buzgomocsing"
ICUKA = "Icuka"
class HeroManager:
_selected_heroes: list[HeroName]
_available_heroes: list[HeroName]
def __init__(self, player_count: int) -> None:
self._selected_heroes = []
self._available_heroes = list(HeroName.__members__.values())
if player_count == 2:
# When there are only 2 players, these heroes are unavailable.
self._available_heroes.remove(HeroName.BUZGOMOCSING)
self._available_heroes.remove(HeroName.ICUKA)
self._available_heroes.remove(HeroName.HOLLOSI_ELVTARS)
self._available_heroes.remove(HeroName.BOSKE_A_RETTENTO)
def select_random_hero(self) -> HeroName:
selected_hero = random.choice(self._available_heroes)
self._selected_heroes.append(selected_hero)
self._available_heroes.remove(selected_hero)
return selected_hero