Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /randovania_randovania /randovania /game_description /db /node.py
| from __future__ import annotations | |
| import dataclasses | |
| import typing | |
| from frozendict import frozendict | |
| from randovania.lib import frozen_lib | |
| if typing.TYPE_CHECKING: | |
| from randovania.game_description.db.node_identifier import NodeIdentifier | |
| NodeIndex = int | |
| class NodeLocation: | |
| x: float | |
| y: float | |
| z: float | |
| def __post_init__(self) -> None: | |
| assert isinstance(self.x, float) | |
| assert isinstance(self.y, float) | |
| assert isinstance(self.z, float) | |
| class Node: | |
| identifier: NodeIdentifier | |
| node_index: NodeIndex = dataclasses.field(hash=False, compare=False) | |
| heal: bool | |
| location: NodeLocation | None | |
| description: str | |
| layers: tuple[str, ...] | |
| extra: dict[str, typing.Any] | |
| valid_starting_location: bool | |
| def __lt__(self, other: object) -> bool: | |
| assert isinstance(other, Node) | |
| return self.identifier < other.identifier | |
| def __hash__(self) -> int: | |
| return hash(self.identifier) | |
| def name(self) -> str: | |
| return self.identifier.node | |
| def full_name(self, with_region: bool = True, separator: str = "/") -> str: | |
| """The name of this node, including the area and optionally region.""" | |
| return self.identifier.display_name(with_region, separator) | |
| def __post_init__(self) -> None: | |
| if not self.layers: | |
| raise ValueError("Expected at least one layer") | |
| if not isinstance(self.extra, frozendict): | |
| if not isinstance(self.extra, dict): | |
| raise TypeError(f"Expected dict for extra, got {type(self.extra)}") | |
| object.__setattr__(self, "extra", frozen_lib.wrap(self.extra)) | |
| def is_resource_node(self) -> bool: | |
| return False | |
| def is_derived_node(self) -> bool: | |
| """If True, this node was created dynamically from other nodes.""" | |
| return False | |
| class GenericNode(Node): | |
| pass | |
Xet Storage Details
- Size:
- 2.06 kB
- Xet hash:
- b1e14393be6dc6a51ab0d971f87f20ad4bcf826c5ee1989f46aa618e1b0cca5d
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.