2023-11-10 08:36:18 -05:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// General types
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2023-11-21 15:14:08 -05:00
|
|
|
export class Position {
|
|
|
|
public x: number;
|
|
|
|
public y: number;
|
|
|
|
|
|
|
|
private constructor(x: number, y: number) {
|
|
|
|
this.x = x;
|
|
|
|
this.y = y;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static at(x: number, y: number): Position {
|
|
|
|
return new Position(x, y);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static default(): Position {
|
|
|
|
return new Position(0, 0);
|
|
|
|
}
|
2023-11-08 15:53:14 -05:00
|
|
|
}
|
|
|
|
|
2023-11-10 08:36:18 -05:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// Testing
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The shared test interface, so tests can be run by both runtimes
|
|
|
|
*/
|
|
|
|
export interface ITestBase {
|
|
|
|
assertEquals(actual: unknown, expected: unknown): void;
|
|
|
|
assertExists(actual: unknown): void;
|
2023-11-16 20:57:21 -05:00
|
|
|
assertFalse(actual: boolean): void;
|
2023-11-10 08:36:18 -05:00
|
|
|
assertInstanceOf(actual: unknown, expectedType: any): void;
|
2023-11-16 20:57:21 -05:00
|
|
|
assertNotEquals(actual: unknown, expected: unknown): void;
|
|
|
|
assertStrictEquals(actual: unknown, expected: unknown): void;
|
2023-11-10 08:36:18 -05:00
|
|
|
assertTrue(actual: boolean): void;
|
2023-11-16 20:57:21 -05:00
|
|
|
testSuite(testObj: any): void;
|
2023-11-10 08:36:18 -05:00
|
|
|
}
|