2024-06-21 14:14:10 -04:00
|
|
|
/**
|
|
|
|
* Convenience type for (x,y) coordinate values
|
|
|
|
*/
|
|
|
|
export class Position {
|
|
|
|
private constructor(public x: number = 0, public y: number = 0) {}
|
|
|
|
|
|
|
|
public static at(x: number, y: number): Position {
|
|
|
|
return new Position(x, y);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static from(p: Position): Position {
|
|
|
|
return new Position(p.x, p.y);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static default(): Position {
|
|
|
|
return new Position();
|
|
|
|
}
|
|
|
|
}
|
2024-06-26 15:45:33 -04:00
|
|
|
|
|
|
|
export default Position;
|