scroll/src/common/position.ts
Timothy J. Warren e6b53ef327
Some checks failed
timw4mail/scroll/pipeline/head There was a failure building this commit
Do basic highlighting of search results, finish stop #151 of the kilo tutorial
2024-06-21 14:14:10 -04:00

19 lines
383 B
JavaScript

/**
* 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();
}
}