gatelogue_aggregator.types.node.town.Town

class gatelogue_aggregator.types.node.town.Town(coordinates: ~gatelogue_types.Sourced[tuple[float, float]] | None = None, world: ~gatelogue_types.Sourced[~gatelogue_types.World] | None = None, proximity: dict[~gatelogue_types.ID, ~gatelogue_types.Sourced[~gatelogue_types.Proximity]] = <factory>, shared_facility: list[~gatelogue_types.Sourced[~gatelogue_types.ID]] = <factory>, *, i: ~gatelogue_types.ID = None, source: set[str] = <factory>, name: str, rank: ~gatelogue_types.Sourced[~gatelogue_types.Rank], mayor: ~gatelogue_types.Sourced[str], deputy_mayor: ~gatelogue_types.Sourced[str | None])

Bases: Town, LocatedNode

__init__()

Methods

__init__()

acceptable_list_node_types()

acceptable_single_node_types()

connect(src, node[, value, source])

connect_one(src, node[, value, source])

disconnect(src, node)

equivalent(src, other)

export(src)

get_all(src, ty[, conn_ty])

get_all_id(src, ty[, conn_ty])

get_edge(src, node[, ty])

get_edges(src, node[, ty])

get_one(src, ty[, conn_ty])

get_one_id(src, ty[, conn_ty])

merge(src, other)

merge_attrs(src, other)

merge_if_equivalent(src, other)

merge_key(src)

merge_lists(src, self, other)

new(src, *, name, rank, mayor, deputy_mayor)

print_report(src, level, msg)

process_code(s)

ref(src)

report(src)

sanitise_strings()

str_src(src)

Attributes

coordinates

Coordinates of the object

deputy_mayor

Deputy Mayor of the town

i

The ID of the node

mayor

Mayor of the town

name

Name of the town

proximity

References all objects that are near (within walking distance of) this object.

rank

Rank of the town

shared_facility

References all objects that this object shares the same facility with (same building, station, hub etc)

source

All sources that prove the node's existence

world

Whether the object is in the New or Old world

acceptable_list_node_types()
acceptable_single_node_types()
connect(src: Source, node: Node, value: Any | None = None, source: set[str] | None = None)
connect_one(src: Source, node: Node, value: Any | None = None, source: set[str] | None = None)
coordinates: Sourced[tuple[float, float]] | None

Coordinates of the object

deputy_mayor: Sourced[str | None]

Deputy Mayor of the town

disconnect(src: Source, node: Node)
equivalent(src: TownSource, other: Self) bool
export(src: TownSource) Town
get_all(src: Source, ty: type[T], conn_ty: type | None = None) Iterator[T]
get_all_id(src: Source, ty: type[Node], conn_ty: type | None = None) list[Sourced[int]]
get_edge(src: Source, node: Node, ty: type[T] | None = None) Sourced[T] | None
get_edges(src: Source, node: Node, ty: type[T] | None = None) Iterator[Sourced[T]]
get_one(src: Source, ty: type[T], conn_ty: type | None = None) T | None
get_one_id(src: Source, ty: type[Node], conn_ty: type | None = None) Sourced[int] | None
i: ID

The ID of the node

mayor: Sourced[str]

Mayor of the town

merge(src: Source, other: Self)
merge_attrs(src: TownSource, other: Self)
merge_if_equivalent(src: Source, other: Self) bool
merge_key(src: TownSource) str
static merge_lists(src: Source, self: list[T], other: list[T])
name: str

Name of the town

classmethod new(src: TownSource, *, name: str, rank: Rank, mayor: str, deputy_mayor: str | None, world: World | None = None, coordinates: tuple[float, float] | None = None)
print_report(src: Source, level: str, msg: str)
static process_code(s: T) T
proximity: dict[ID, Sourced[Proximity]]

References all objects that are near (within walking distance of) this object. It is represented as an inner mapping of object IDs to proximity data (Proximity). For example, {1234: <proximity>} means that there is an object with ID 1234 near this object, and <proximity> is a Proximity object.

rank: Sourced[Rank]

Rank of the town

ref(src: TownSource) NodeRef[Self]
report(src: Source)
sanitise_strings()
shared_facility: list[Sourced[ID]]

References all objects that this object shares the same facility with (same building, station, hub etc)

source: set[str]

All sources that prove the node’s existence

str_src(src: TownSource) str
world: Sourced[World] | None

Whether the object is in the New or Old world