From 6628efe957b8d7aca95d454cb5ad0853cef9ddc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= Date: Thu, 2 Feb 2023 15:28:30 +0000 Subject: [PATCH] Door interface --- ui/src/components/door_map/DoorPlacer.vue | 4 ++-- ui/src/components/door_map/calendar.ts | 11 +++-------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/ui/src/components/door_map/DoorPlacer.vue b/ui/src/components/door_map/DoorPlacer.vue index 59216f7..b7fe8f3 100644 --- a/ui/src/components/door_map/DoorPlacer.vue +++ b/ui/src/components/door_map/DoorPlacer.vue @@ -38,11 +38,11 @@ export default class extends Vue { private doors!: Door[]; private get rectangles() { - return this.doors.filter((door) => door.position); + return this.doors.map((door) => door.position); } private on_draw(position: Rectangle) { - this.doors.push(new Door(position)); + this.doors.push({ position: position }); } private find_door_index(position: Rectangle): number { diff --git a/ui/src/components/door_map/calendar.ts b/ui/src/components/door_map/calendar.ts index 4e5f2e3..f51b309 100644 --- a/ui/src/components/door_map/calendar.ts +++ b/ui/src/components/door_map/calendar.ts @@ -1,11 +1,6 @@ import { Rectangle } from "../rects/rectangles"; -export class Door { - public day?: number; - public position: Rectangle; - - constructor(position: Rectangle, day?: number) { - this.position = position; - this.day = day; - } +export interface Door { + day?: number; + position: Rectangle; } \ No newline at end of file