Skip to content

Commit

Permalink
Remove unused GameType class that was replaced by netplayjs.Game
Browse files Browse the repository at this point in the history
  • Loading branch information
rameshvarun committed Apr 6, 2023
1 parent 31a399a commit f01c4a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 30 deletions.
4 changes: 4 additions & 0 deletions netplayjs-client/src/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import { TouchControl } from "./touchcontrols";

export type GameClass = {
new (canvas: HTMLCanvasElement, players: Array<NetplayPlayer>): Game;

/**
* The length of a single timestep in milliseconds.
*/
timestep: number;

/**
Expand Down
31 changes: 1 addition & 30 deletions netplayjs-client/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,33 +68,4 @@ export class NetplayPlayer {
getID(): number {
return this.id;
}
}

export interface GameType<TState, TInput> {
/**
* Given a list of players, return the initial game state.
*/
constructInitialState(players: Array<NetplayPlayer>): TState;

/**
* Construct a new input object with a default value. A new object
* needs to be constructed, since serialized values will be copied into this.
*/
constructDefaultInput(): TInput;

/**
* The game simulation timestep, in milliseconds.
*/
timestep: number;

// The dimensions of the rendering canvas.
canvasWidth: number;
canvasHeight: number;

draw(state: TState, canvas: HTMLCanvasElement, ctx: CanvasRenderingContext2D);

getInputReader(
document: HTMLDocument,
canvas: HTMLCanvasElement
): () => TInput;
}
}

0 comments on commit f01c4a9

Please sign in to comment.