Skip to content

five-on-it / apps/client/src/ui/studio/StudioMap / StudioMapProps

Interface: StudioMapProps ​

Defined in: apps/client/src/ui/studio/StudioMap.tsx:75

What the map is given.

Properties ​

drawing ​

drawing: Pt[]

Defined in: apps/client/src/ui/studio/StudioMap.tsx:92

The points of a road or river being drawn.


focus? ​

optional focus?: object

Defined in: apps/client/src/ui/studio/StudioMap.tsx:88

The issue in focus: where, and the stretch of road it is about.

at ​

at: Pt

line? ​

optional line?: Pt[]


handles ​

handles: Handle[]

Defined in: apps/client/src/ui/studio/StudioMap.tsx:81


hidden? ​

optional hidden?: ReadonlySet<string>

Defined in: apps/client/src/ui/studio/StudioMap.tsx:90

The keys of what the layers hide.


picking ​

picking: boolean

Defined in: apps/client/src/ui/studio/StudioMap.tsx:94

Whether a click on an element selects it (the select tool); else it is the tool's, as on the ground.


pins ​

pins: Pin[]

Defined in: apps/client/src/ui/studio/StudioMap.tsx:86


plan ​

plan: CityPlan | undefined

Defined in: apps/client/src/ui/studio/StudioMap.tsx:77


point? ​

optional point?: PointPath

Defined in: apps/client/src/ui/studio/StudioMap.tsx:83

The selected handle's path.


segments? ​

optional segments?: Segment[]

Defined in: apps/client/src/ui/studio/StudioMap.tsx:85

The segments of the selected element between its points, a midpoint handle on each.


selection ​

selection: Selection | undefined

Defined in: apps/client/src/ui/studio/StudioMap.tsx:80


sketch? ​

optional sketch?: boolean

Defined in: apps/client/src/ui/studio/StudioMap.tsx:79

Whether the plan is the solver's sketch of a city with issues.


spec ​

spec: object

Defined in: apps/client/src/ui/studio/StudioMap.tsx:76

climate? ​

optional climate?: "none" | "temperate" | "meadow" | "forest" | "alpine" | "farmland" | "steppe" | "desert" | "autumn" | "coast"

clock? ​

optional clock?: object

clock.pace? ​

optional pace?: number

clock.start? ​

optional start?: string

districts ​

districts: object[]

grids? ​

optional grids?: object[]

hills? ​

optional hills?: object[]

lakes? ​

optional lakes?: object[]

name ​

name: string

parks? ​

optional parks?: object[]

places? ​

optional places?: object[]

relief? ​

optional relief?: ({ at: [number, number] | { at: [number, number]; grid: string; } | { arm: number; roundabout: string; } | { at: number | "start" | "end"; road: string; } | { hill: string; }; height: number; kind: "rise"; reach: number; } | { from: [number, number] | { at: [number, number]; grid: string; } | { arm: number; roundabout: string; } | { at: number | "start" | "end"; road: string; } | { hill: string; }; height: number; kind: "slope"; to: [number, number] | { at: [number, number]; grid: string; } | { arm: number; roundabout: string; } | { at: number | "start" | "end"; road: string; } | { hill: string; }; })[]

roads? ​

optional roads?: object[]

roundabouts? ​

optional roundabouts?: object[]

seed? ​

optional seed?: number

size? ​

optional size?: number

spawn ​

spawn: object

spawn.near? ​

optional near?: [number, number] | { at: [number, number]; grid: string; } | { arm: number; roundabout: string; } | { at: number | "start" | "end"; road: string; } | { hill: string; }

spawn.road ​

road: string

template ​

template: "city"

water? ​

optional water?: object[]


zone ​

zone: string | undefined

Defined in: apps/client/src/ui/studio/StudioMap.tsx:97


zones ​

zones: object[]

Defined in: apps/client/src/ui/studio/StudioMap.tsx:96

The game's zones (a mission's places to reach: a circle, or a polygon's points), and the one selected.

at ​

at: Pt

id ​

id: string

polygon? ​

optional polygon?: Pt[]

radius ​

radius: number

Methods ​

onContext()? ​

optional onContext(target, at, client): void

Defined in: apps/client/src/ui/studio/StudioMap.tsx:115

A right click: what it was on, where in the game's frame, where in the map's frame (px).

Parameters ​

target ​

MapTarget

at ​

Pt

client ​

Pt

Returns ​

void


onDrag() ​

onDrag(path, to, done): void

Defined in: apps/client/src/ui/studio/StudioMap.tsx:113

A handle dragged to a point; done once it is let go.

Parameters ​

path ​

PointPath

to ​

Pt

done ​

boolean

Returns ​

void


onGround() ​

onGround(at): void

Defined in: apps/client/src/ui/studio/StudioMap.tsx:105

A click on the ground (the tool's), in the game's frame.

Parameters ​

at ​

Pt

Returns ​

void


onHover() ​

onHover(at): void

Defined in: apps/client/src/ui/studio/StudioMap.tsx:117

The pointer over the map, in the game's frame (the coordinates shown).

Parameters ​

at ​

Pt | undefined

Returns ​

void


onMid()? ​

optional onMid(index, at): void

Defined in: apps/client/src/ui/studio/StudioMap.tsx:111

A midpoint handle clicked: a point inserted there.

Parameters ​

index ​

number

at ​

Pt

Returns ​

void


onPoint()? ​

optional onPoint(path): void

Defined in: apps/client/src/ui/studio/StudioMap.tsx:109

A handle pressed: its point is selected.

Parameters ​

path ​

PointPath

Returns ​

void


onSelect() ​

onSelect(selection): void

Defined in: apps/client/src/ui/studio/StudioMap.tsx:107

A click on an element: it is selected.

Parameters ​

selection ​

Selection

Returns ​

void


onZone() ​

onZone(id): void

Defined in: apps/client/src/ui/studio/StudioMap.tsx:99

A click on a zone: it is selected.

Parameters ​

id ​

string

Returns ​

void


onZoneDrag() ​

onZoneDrag(id, to, done): void

Defined in: apps/client/src/ui/studio/StudioMap.tsx:101

A zone's centre dragged to a point; done once it is let go.

Parameters ​

id ​

string

to ​

Pt

done ​

boolean

Returns ​

void


onZonePoint() ​

onZonePoint(id, point, to, done): void

Defined in: apps/client/src/ui/studio/StudioMap.tsx:103

A point of a selected polygon zone dragged to a point; done once it is let go.

Parameters ​

id ​

string

point ​

number

to ​

Pt

done ​

boolean

Returns ​

void