import Chit, { ChitFromDb } from "Modules/Chit" export default class Fridge { #chits: Chit[] = []; constructor() { const f = sessionStorage.fridge; if (f === null) { location.href = "/" return; } const cs = JSON.parse(f) as ChitFromDb[]; for (const c of cs) { this.#chits.push(new Chit(this, c)) } } setChitZIAuto() { for (const c of this.#chits) c.div.style.zIndex = "auto" } // moveChit(coord: { top: number, left: number }) { // for (const c of this.#chits) { // if (c.isMoving) { // c.move(coord) // } // } // } // stopChitMove() { // for (const c of this.#chits) { // c.isMoving = false; // //@ts-expect-error // c.mouseUpH({ preventDefault: () => null }) // } // } createChit() { this.#chits.push(new Chit(this)) } get chits(): Chit[] { return this.#chits; } }