mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-03 21:20:36 +00:00
improve front page
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import {ClientID} from "../core/Schemas";
|
||||
import {Client} from "./Client";
|
||||
|
||||
export class Lobby {
|
||||
|
||||
public clients: Map<ClientID, Client> = new Map()
|
||||
private startGameTs: number
|
||||
|
||||
|
||||
constructor(public readonly id: string, durationMs: number) {
|
||||
this.startGameTs = Date.now() + durationMs
|
||||
}
|
||||
|
||||
public addClient(client: Client) {
|
||||
this.clients.set(client.id, client)
|
||||
}
|
||||
|
||||
public isExpired(now: number): boolean {
|
||||
return now > this.startGameTs
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user