mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-20 16:22:56 +02:00
prettify, sorry for the big ass commit
This commit is contained in:
@@ -1,29 +1,29 @@
|
||||
export type Position = {
|
||||
row: number;
|
||||
column: number;
|
||||
row: number;
|
||||
column: number;
|
||||
};
|
||||
|
||||
export class PositionTracker {
|
||||
positions: Map<string, Position>;
|
||||
positions: Map<string, Position>;
|
||||
|
||||
constructor() {
|
||||
this.positions = new Map<string, Position>();
|
||||
}
|
||||
constructor() {
|
||||
this.positions = new Map<string, Position>();
|
||||
}
|
||||
|
||||
saveCursor(filename: string, pos: Position): void {
|
||||
this.positions.set(filename, pos);
|
||||
}
|
||||
saveCursor(filename: string, pos: Position): void {
|
||||
this.positions.set(filename, pos);
|
||||
}
|
||||
|
||||
getCursor(filename: string): Position {
|
||||
const position = this.positions.get(filename);
|
||||
if (!position) {
|
||||
return {
|
||||
row: -1,
|
||||
column: -1,
|
||||
};
|
||||
}
|
||||
return position;
|
||||
}
|
||||
getCursor(filename: string): Position {
|
||||
const position = this.positions.get(filename);
|
||||
if (!position) {
|
||||
return {
|
||||
row: -1,
|
||||
column: -1,
|
||||
};
|
||||
}
|
||||
return position;
|
||||
}
|
||||
}
|
||||
|
||||
export const CursorPositions: PositionTracker = new PositionTracker();
|
||||
export const CursorPositions: PositionTracker = new PositionTracker();
|
||||
|
||||
Reference in New Issue
Block a user