module 7 ex1 + 0

This commit is contained in:
2026-02-17 15:27:05 +01:00
parent 222b212162
commit ddb56264ae
9 changed files with 117 additions and 0 deletions

22
07/ex0/Card.py Normal file
View File

@@ -0,0 +1,22 @@
from abc import ABC, abstractmethod
from typing import Union
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