Improve netcode and simplify (#4)
- 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
This commit is contained in:
parent
5d854440ec
commit
93a7fe01ab
1 changed files with 15073 additions and 4754 deletions
17
backend/src/game-events.ts
Normal file
17
backend/src/game-events.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
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,
|
||||
);
|
||||
};
|
||||
Loading…
Reference in a new issue