warchron_app/src/warchron/model/war_event.py

31 lines
1,001 B
Python
Raw Normal View History

from datetime import datetime
from uuid import uuid4
class WarEvent:
def __init__(self, participant_id: str):
self.id: str = str(uuid4())
self.participant_id: str = participant_id
self.timestamp: datetime = datetime.now()
class TieResolved(WarEvent):
def __init__(self, participant_id: str, context_type: str, context_id: str):
super().__init__(participant_id)
self.context_type = context_type # battle, round, campaign, war
self.context_id = context_id
class InfluenceGained(WarEvent):
def __init__(self, participant_id: str, amount: int, source: str):
super().__init__(participant_id)
self.amount = amount
self.source = source # "battle", "tie_resolution", etc.
class InfluenceSpent(WarEvent):
def __init__(self, participant_id: str, amount: int, context: str):
super().__init__(participant_id)
self.amount = amount
self.context = context # "battle_tie", "campaign_tie", etc.