mirror of
https://github.com/DavidGailleton/42-Piscine_Python.git
synced 2026-03-14 05:06:55 +01:00
22 lines
505 B
Python
22 lines
505 B
Python
from abc import ABC, abstractmethod
|
|
|
|
|
|
class Card(ABC):
|
|
def __init__(self, name: str, cost: int, rarity: str) -> None:
|
|
self.name = name
|
|
self.cost = cost
|
|
self.rarity = rarity
|
|
|
|
@abstractmethod
|
|
def play(self, game_state: dict) -> dict:
|
|
pass
|
|
|
|
def get_card_info(self) -> dict:
|
|
res = dict(self.__dict__)
|
|
return res
|
|
|
|
def is_playable(self, available_mana: int) -> bool:
|
|
if available_mana > 5:
|
|
return True
|
|
return False
|