import { gameManager } from "@/Game"; import { IPointData } from "pixi.js"; class Position { static instance: Position = null private constructor() { } static getInstance() { if (Position.instance == null) { Position.instance = new Position } return Position.instance } get(xType: "center", yType: "center", offset: Partial): IPointData { let x, y if (xType === 'center') { x = gameManager.getInfo().width / 2 + (offset.x ?? 0) } if (yType === 'center') { y = gameManager.getInfo().height / 2 + (offset.y ?? 0) } return { x, y } } } export default Position.getInstance()