Release v0.2.10: Update package-lock.json and CI config
This commit is contained in:
@@ -4,14 +4,14 @@ Loads game data from JSON files without bot dependencies.
|
||||
"""
|
||||
import json
|
||||
from pathlib import Path
|
||||
from typing import Dict, List, Any, Optional
|
||||
from typing import Dict, List, Any, Optional, Union
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
|
||||
@dataclass
|
||||
class Outcome:
|
||||
"""Represents an outcome of an action"""
|
||||
text: str
|
||||
text: Union[str, Dict[str, str]]
|
||||
items_reward: Dict[str, int] = field(default_factory=dict)
|
||||
damage_taken: int = 0
|
||||
|
||||
@@ -20,7 +20,7 @@ class Outcome:
|
||||
class Action:
|
||||
"""Represents an action that can be performed on an interactable"""
|
||||
id: str
|
||||
label: str
|
||||
label: Union[str, Dict[str, str]]
|
||||
stamina_cost: int = 2
|
||||
outcomes: Dict[str, Outcome] = field(default_factory=dict)
|
||||
|
||||
@@ -32,7 +32,7 @@ class Action:
|
||||
class Interactable:
|
||||
"""Represents an interactable object"""
|
||||
id: str
|
||||
name: str
|
||||
name: Union[str, Dict[str, str]]
|
||||
image_path: str = ""
|
||||
actions: List[Action] = field(default_factory=list)
|
||||
|
||||
@@ -52,8 +52,8 @@ class Exit:
|
||||
class Location:
|
||||
"""Represents a location in the game world"""
|
||||
id: str
|
||||
name: str
|
||||
description: str
|
||||
name: Union[str, Dict[str, str]]
|
||||
description: Union[str, Dict[str, str]]
|
||||
image_path: str = ""
|
||||
exits: Dict[str, str] = field(default_factory=dict) # direction -> destination_id
|
||||
exit_stamina: Dict[str, int] = field(default_factory=dict) # direction -> stamina_cost
|
||||
|
||||
Reference in New Issue
Block a user