You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
76 lines
938 B
76 lines
938 B
2 years ago
|
declare namespace Serialized {
|
||
|
interface Game {
|
||
|
players: Player[]
|
||
|
balls: Ball[]
|
||
|
finished: boolean
|
||
|
paused: boolean
|
||
|
}
|
||
|
|
||
|
interface Lobby {
|
||
|
id: string
|
||
|
name: string
|
||
|
game: string
|
||
|
clientCounts: number[]
|
||
|
clients: Client[]
|
||
|
hasStarted: boolean
|
||
|
}
|
||
|
|
||
|
interface Client {
|
||
|
id: string
|
||
|
name: string
|
||
|
game: string
|
||
|
isReady: boolean
|
||
|
isPlayer: boolean
|
||
|
isSpectator: boolean
|
||
|
}
|
||
|
|
||
|
interface Ball {
|
||
|
pos: Vector
|
||
|
vel: Vector
|
||
|
color: Color
|
||
|
radius: number
|
||
|
runningUp: boolean
|
||
|
nextStep: Vector
|
||
|
}
|
||
|
|
||
|
interface Player {
|
||
|
id: string
|
||
|
pos: Vector
|
||
|
dim: Vector
|
||
|
vel: Vector
|
||
|
color: Color
|
||
|
points: number
|
||
|
}
|
||
|
|
||
|
interface Vector {
|
||
|
x: number,
|
||
|
y: number
|
||
|
}
|
||
|
|
||
|
interface Color {
|
||
|
stroke: string
|
||
|
fill: string
|
||
|
}
|
||
|
|
||
|
module Player {
|
||
|
interface Input {
|
||
|
up: boolean
|
||
|
down: boolean
|
||
|
}
|
||
|
|
||
|
interface Side {
|
||
|
x: number
|
||
|
y: number
|
||
|
}
|
||
|
}
|
||
|
|
||
|
enum Directions {
|
||
|
Top,
|
||
|
Right,
|
||
|
Bottom,
|
||
|
Left,
|
||
|
Forward,
|
||
|
Back,
|
||
|
Center
|
||
|
}
|
||
|
}
|