-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0a2c0cc
commit 364101c
Showing
9 changed files
with
148 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,12 @@ | ||
import { SetupInfo } from "../types/static"; | ||
import FactionData from "./factions"; | ||
import PlanetData from "./planets"; | ||
import SystemData from "./systems"; | ||
|
||
const DefaultSetupInfo: SetupInfo = { | ||
factions: FactionData, | ||
planets: PlanetData, | ||
systems: SystemData, | ||
}; | ||
|
||
export { FactionData, PlanetData, SystemData }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from "./galaxy"; | ||
export * from "./types/galaxy"; | ||
export * from "./math"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { describe, expect, it } from "vitest"; | ||
import { tilePositionToCoordinate, tileBounds } from "../math"; | ||
|
||
describe("math.test.coords", () => { | ||
it("Test coordinates", () => { | ||
const coords0 = tilePositionToCoordinate({ x: 0, y: 0 }); | ||
expect(coords0).toEqual({ x: 182, y: 317 }); | ||
|
||
const coords1 = tilePositionToCoordinate({ x: 1, y: 0 }); | ||
expect(coords1).toEqual({ x: 457, y: 158.5 }); | ||
|
||
const coords2 = tilePositionToCoordinate({ x: 0, y: 1 }); | ||
expect(coords2).toEqual({ x: 182, y: 634 }); | ||
}); | ||
|
||
it("Test bounding box", () => { | ||
const bb0 = tileBounds({ x: 0, y: 0 }); | ||
expect(bb0).toEqual({ minX: 0, minY: 158.5, maxX: 364, maxY: 475.5 }); | ||
|
||
const bb1 = tileBounds({ x: 1, y: 0 }); | ||
expect(bb1).toEqual({ minX: 275, minY: 0, maxX: 639, maxY: 317 }); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters