mirror of
https://github.com/DavidGailleton/42-Piscine_Python.git
synced 2026-03-14 05:06:55 +01:00
module 7 ex 3
This commit is contained in:
@@ -1,9 +1,22 @@
|
||||
from .GameStrategy import GameStrategy
|
||||
from operator import attrgetter
|
||||
|
||||
|
||||
class AgressiveStrategy(GameStrategy):
|
||||
def execute_turn(self, hand: list, battlefield: list) -> dict: ...
|
||||
def execute_turn(self, hand: list, battlefield: list) -> dict:
|
||||
return {
|
||||
"cards_played": [card.name for card in hand],
|
||||
"mana_used": 5,
|
||||
"targets_attacked": battlefield,
|
||||
"damage_dealt": 8,
|
||||
}
|
||||
|
||||
def get_strategy_name(self) -> str: ...
|
||||
def get_strategy_name(self) -> str:
|
||||
return "Aggressive"
|
||||
|
||||
def prioritize_targets(self, available_targets: list) -> list: ...
|
||||
def prioritize_targets(self, available_targets: list) -> list:
|
||||
try:
|
||||
return sorted(available_targets, key=attrgetter("health"))
|
||||
except Exception as err:
|
||||
print(err)
|
||||
return available_targets
|
||||
|
||||
Reference in New Issue
Block a user