-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #278 from bcdrme/map-metadata-integration
Integration of the map-metadata service
- Loading branch information
Showing
101 changed files
with
2,205 additions
and
4,847 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
import { LuaOptionSection } from "@main/content/game/lua-options"; | ||
|
||
export type GameVersion = { | ||
gameVersion: string; | ||
packageMd5: string; | ||
luaOptionSections: LuaOptionSection[]; | ||
ais: GameAI[]; | ||
}; | ||
|
||
export interface GameAI { | ||
name: string; | ||
shortName: string; | ||
description: string; | ||
options?: LuaOptionSection[]; | ||
} |
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,25 @@ | ||
//Boxes | ||
export function pointsToXYWH(points: { x: number; y: number }[]) { | ||
if (points.length !== 2) { | ||
throw new Error("pointsToXYWH expects exactly 2 points"); | ||
} | ||
const xs = points.map((point) => point.x); | ||
const ys = points.map((point) => point.y); | ||
const x = Math.min(...xs); | ||
const y = Math.min(...ys); | ||
const w = Math.max(...xs) - x; | ||
const h = Math.max(...ys) - y; | ||
return { x, y, w, h }; | ||
} | ||
|
||
export function spadsPointsToLTRBPercent(points: { x: number; y: number }[]) { | ||
if (points.length !== 2) { | ||
throw new Error("SpadsPointsToLTRBPercent expects exactly 2 points"); | ||
} | ||
return { | ||
left: points[0].x / 200, | ||
top: points[0].y / 200, | ||
right: points[1].x / 200, | ||
bottom: points[1].y / 200, | ||
}; | ||
} |
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
Oops, something went wrong.