mirror of
https://git.rezel.net/LudoTech/traque.git
synced 2026-02-09 02:10:18 +01:00
Map resize correction + player focus + cleaning
This commit is contained in:
15
traque-front/util/functions.js
Normal file
15
traque-front/util/functions.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import { GameState } from './types';
|
||||
import { teamStatus } from './configurations';
|
||||
|
||||
export function getStatus(team, gamestate) {
|
||||
switch (gamestate) {
|
||||
case GameState.SETUP:
|
||||
return teamStatus.waiting;
|
||||
case GameState.PLACEMENT:
|
||||
return team.ready ? teamStatus.ready : teamStatus.notready;
|
||||
case GameState.PLAYING:
|
||||
return team.captured ? teamStatus.captured : team.outofzone ? teamStatus.outofzone : teamStatus.playing;
|
||||
case GameState.FINISHED:
|
||||
return team.captured ? teamStatus.captured : teamStatus.playing;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user