mirror of
https://code.lenaisten.de/Lenaisten/advent22.git
synced 2024-11-23 00:03:07 +00:00
Door interface
This commit is contained in:
parent
6d7646daf7
commit
6628efe957
2 changed files with 5 additions and 10 deletions
|
@ -38,11 +38,11 @@ export default class extends Vue {
|
||||||
private doors!: Door[];
|
private doors!: Door[];
|
||||||
|
|
||||||
private get rectangles() {
|
private get rectangles() {
|
||||||
return this.doors.filter((door) => door.position);
|
return this.doors.map((door) => door.position);
|
||||||
}
|
}
|
||||||
|
|
||||||
private on_draw(position: Rectangle) {
|
private on_draw(position: Rectangle) {
|
||||||
this.doors.push(new Door(position));
|
this.doors.push({ position: position });
|
||||||
}
|
}
|
||||||
|
|
||||||
private find_door_index(position: Rectangle): number {
|
private find_door_index(position: Rectangle): number {
|
||||||
|
|
|
@ -1,11 +1,6 @@
|
||||||
import { Rectangle } from "../rects/rectangles";
|
import { Rectangle } from "../rects/rectangles";
|
||||||
|
|
||||||
export class Door {
|
export interface Door {
|
||||||
public day?: number;
|
day?: number;
|
||||||
public position: Rectangle;
|
position: Rectangle;
|
||||||
|
|
||||||
constructor(position: Rectangle, day?: number) {
|
|
||||||
this.position = position;
|
|
||||||
this.day = day;
|
|
||||||
}
|
|
||||||
}
|
}
|
Loading…
Reference in a new issue