load cards from json

This commit is contained in:
2024-03-29 13:59:57 +01:00
parent a0ab6a051f
commit cc7e2ad93e
10 changed files with 167 additions and 99 deletions
+1 -34
View File
@@ -1,34 +1,4 @@
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"
from model import Serializable, CardRole, CardType, CardFaction
class Card(Serializable):
@@ -37,7 +7,6 @@ class Card(Serializable):
object_type = "card"
sprite: str
name: str
text: str
cost: int
role: CardRole
card_type: CardType
@@ -47,7 +16,6 @@ class Card(Serializable):
self,
sprite: str,
name: str,
text: str,
cost: int,
card_type: CardType,
faction: CardFaction,
@@ -55,7 +23,6 @@ class Card(Serializable):
super().__init__()
self.sprite = sprite
self.name = name
self.text = text
self.cost = cost
self.card_type = card_type
self.faction = faction