Skip to content

Commit

Permalink
feat(utils): add isQuad and isTiled functions
Browse files Browse the repository at this point in the history
  • Loading branch information
meszaros-lajos-gyorgy committed May 22, 2024
1 parent 6894d54 commit 4e1dc70
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/fts/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ import { ArxPolygon, ArxPolygonFlags } from '@fts/Polygon.js'
import { ArxVertex } from '@fts/Vertex.js'
import { COORDS_THAT_ROUND_UP } from '@fts/constants.js'

const isQuad = (polygon: ArxPolygon) => {
return (polygon.flags & ArxPolygonFlags.Quad) !== 0
export const isQuad = ({ flags }: { flags: ArxPolygonFlags }) => {
return (flags & ArxPolygonFlags.Quad) !== 0
}

export const isTiled = ({ flags }: { flags: ArxPolygonFlags }) => {
return (flags & ArxPolygonFlags.Tiled) !== 0
}

export const addLightIndex = (polygons: ArxPolygon[]) => {
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { getCellCoords } from '@fts/helpers.js'
export { getCellCoords, isQuad, isTiled } from '@fts/helpers.js'

export type { DoubleOf, TripleOf, QuadrupleOf, Optional, Expand, RecursiveExpand } from '@common/types.js'

Expand Down

0 comments on commit 4e1dc70

Please sign in to comment.