mirror of
https://github.com/DavidGailleton/42-Piscine_Python.git
synced 2026-03-14 05:06:55 +01:00
module 7 ex1 + 0
This commit is contained in:
16
07/ex1/ArtifactCard.py
Normal file
16
07/ex1/ArtifactCard.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from ex0.Card import Card
|
||||
|
||||
|
||||
class ArtifactCard(Card):
|
||||
def __init__(
|
||||
self, name: str, cost: int, rarity: str, durability: int, effect: str
|
||||
) -> None:
|
||||
super().__init__(name, cost, rarity)
|
||||
self.durability = durability
|
||||
self.effect = effect
|
||||
|
||||
def play(self, game_state: dict) -> dict:
|
||||
return super().play(game_state)
|
||||
|
||||
def activate_ability(self) -> dict:
|
||||
pass
|
||||
6
07/ex1/Deck.py
Normal file
6
07/ex1/Deck.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from ex0.Card import Card
|
||||
|
||||
|
||||
class Deck():
|
||||
def __init__(self) -> None:
|
||||
self:
|
||||
15
07/ex1/SpellCard.py
Normal file
15
07/ex1/SpellCard.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from ex0.Card import Card
|
||||
|
||||
|
||||
class SpellCard(Card):
|
||||
def __init__(
|
||||
self, name: str, cost: int, rarity: str, effect_type: str
|
||||
) -> None:
|
||||
super().__init__(name, cost, rarity)
|
||||
self.effect_type = effect_type
|
||||
|
||||
def play(self, game_state: dict) -> dict:
|
||||
return super().play(game_state)
|
||||
|
||||
def resolve_effect(self, targets: list) -> dict:
|
||||
pass
|
||||
0
07/ex1/__init__.py
Normal file
0
07/ex1/__init__.py
Normal file
0
07/ex1/main.py
Normal file
0
07/ex1/main.py
Normal file
Reference in New Issue
Block a user