- Simplify the logic wherever possible to remove overengineering and simplify the netcode - Actually improve the netcode - The new lines are mainly the package locks and tests Reviewed-on: https://home.schmelczer.dev/git/andras/decla-red/pulls/4
17 lines
377 B
TypeScript
17 lines
377 B
TypeScript
import { CharacterTeam } from 'shared';
|
|
|
|
export interface GameEvents {
|
|
addPoints(blue: number, red: number): void;
|
|
announce(text: string): void;
|
|
}
|
|
|
|
export const addPointsForTeam = (
|
|
game: GameEvents,
|
|
team: CharacterTeam,
|
|
points: number,
|
|
): void => {
|
|
game.addPoints(
|
|
team === CharacterTeam.blue ? points : 0,
|
|
team === CharacterTeam.red ? points : 0,
|
|
);
|
|
};
|