-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFramedLicensePlate.ts
30 lines (25 loc) · 1.12 KB
/
FramedLicensePlate.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import {bindable, autoinject, observable} from 'aurelia-framework';
import {EventAggregator} from 'aurelia-event-aggregator';
import {AuMsgAnswersPanelState} from './messages';
import type {LicensePlatePuzzle} from "./lib/license-plate-puzzle"
import type {LicensePlateGameAPI} from "license-plate-game-api"
import {Settings, PuzzleAnswer} from "./lib"
// The container for the interior of the license plate frame.
// It displays either:
// - the input component and the game status messages component
// - the scored answers
@autoinject
export class FramedLicensePlate {
@bindable settings: Settings
@bindable @observable current_game: LicensePlatePuzzle | undefined
@bindable @observable elapsed_seconds: number
@bindable @observable puzzle_answers: PuzzleAnswer[]
@bindable @observable hint: LicensePlateGameAPI.HintResponse | undefined
answers_panel_is_open: boolean
constructor(private ea: EventAggregator) {
this.answers_panel_is_open = false
this.ea.subscribe(AuMsgAnswersPanelState, (msg: AuMsgAnswersPanelState) => {
this.answers_panel_is_open = msg.is_open
})
}
}