-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
impr: Add a default
bin
export. (#26)
- Loading branch information
Showing
39 changed files
with
283 additions
and
295 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
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,19 +1,18 @@ | ||
import type { Parsed } from 'typed-binary'; | ||
import { arrayOf, dynamicArrayOf, i32, object } from 'typed-binary'; | ||
import bin from 'typed-binary'; | ||
|
||
export const Vertex = object({ | ||
x: i32, | ||
y: i32, | ||
z: i32, | ||
export const Vertex = bin.object({ | ||
x: bin.i32, | ||
y: bin.i32, | ||
z: bin.i32, | ||
}); | ||
|
||
export const Polygon = object({ | ||
vertices: arrayOf(Vertex, 3), | ||
export const Polygon = bin.object({ | ||
vertices: bin.arrayOf(Vertex, 3), | ||
}); | ||
|
||
export const Mesh = object({ | ||
faces: dynamicArrayOf(Polygon), | ||
export const Mesh = bin.object({ | ||
faces: bin.dynamicArrayOf(Polygon), | ||
}); | ||
|
||
// Helpful for the top-most level element | ||
export type Mesh = Parsed<typeof Mesh>; | ||
export type Mesh = bin.Parsed<typeof Mesh>; |
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
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,7 +1,7 @@ | ||
import { dynamicArrayOf, i32, object } from 'typed-binary'; | ||
import bin from 'typed-binary'; | ||
import { NodeTemplate } from './node'; | ||
|
||
export const Graph = object({ | ||
entryNode: i32, | ||
nodes: dynamicArrayOf(NodeTemplate), | ||
export const Graph = bin.object({ | ||
entryNode: bin.i32, | ||
nodes: bin.dynamicArrayOf(NodeTemplate), | ||
}); |
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,10 +1,10 @@ | ||
import { bool, dynamicArrayOf, f32, i32, object, string } from 'typed-binary'; | ||
import bin from 'typed-binary'; | ||
import { ConnectionTemplate } from './connection'; | ||
|
||
export const NodeTemplate = object({ | ||
animationKey: string, | ||
startFrame: i32, | ||
playbackSpeed: f32, | ||
looping: bool, | ||
connections: dynamicArrayOf(ConnectionTemplate), | ||
export const NodeTemplate = bin.object({ | ||
animationKey: bin.string, | ||
startFrame: bin.i32, | ||
playbackSpeed: bin.f32, | ||
looping: bin.bool, | ||
connections: bin.dynamicArrayOf(ConnectionTemplate), | ||
}); |
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.