This repository has been archived on 2024-07-31. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
back-python/src/model/card.py
T
2024-03-29 11:08:12 +01:00

69 lines
1.2 KiB
Python

from enum import Enum
from model import Serializable
class CardRole(str, Enum):
PERSONAL = "personal"
MARKET = "market"
FIRE_GEM = "fire_gem"
class CardType(str, Enum):
"""Playable card types"""
HERO = "hero"
HERO_ABILITY = "hero_ability"
CURRENCY = "currency"
WEAPON = "weapon"
CHAMPION = "champion"
ACTION = "action"
ITEM = "item"
class CardFaction(str, Enum):
"""Playable card factions"""
BASE = "base"
BLUE = "blue"
RED = "red"
GREEN = "green"
YELLOW = "yellow"
class Card(Serializable):
"""Represents any playable card"""
object_type = "card"
sprite: str
name: str
text: str
cost: int
role: CardRole
card_type: CardType
faction: CardFaction
def __init__(
self,
sprite: str,
name: str,
text: str,
cost: int,
card_type: CardType,
faction: CardFaction,
):
super().__init__()
self.sprite = sprite
self.name = name
self.text = text
self.cost = cost
self.card_type = card_type
self.faction = faction
class CardChampion(Card):
"""Represents any champion card"""
defense: int
guard: bool