diff options
Diffstat (limited to 'test-client/protocol.ts')
-rw-r--r-- | test-client/protocol.ts | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/test-client/protocol.ts b/test-client/protocol.ts index 9761f152..3b61ce94 100644 --- a/test-client/protocol.ts +++ b/test-client/protocol.ts @@ -1,4 +1,24 @@ +export type ID = number; +export type Vec2 = [number, number] +export type Item = string +export type Tile = string +export type PacketS = + { join: { name: string } } + | "leave" + | { position: { pos: Vec2, rot: number } } + | { interact: { pos: Vec2 } } + + +export type PacketC = + { joined: { id: ID } } + | { add_player: { id: ID, name: string } } + | { remove_player: { id: ID } } + | { position: { player: ID, pos: Vec2, rot: number } } + | { take_item: { item: ID, player: ID } } + | { put_item: { item: ID, pos: Vec2 } } + | { produce_item: { id: ID, pos: Vec2, kind: Item } } + | { consume_item: { id: ID, pos: Vec2 } } + | { set_active: { tile: Vec2 } } + | { update_map: { pos: Vec2, tile: Tile } } -export type PacketS = {} -export type PacketC = {} |