This commit is contained in:
Sebastien Riviere
2025-09-08 15:08:44 +02:00
parent 75f8b10ecd
commit 7e4d9f910a
37 changed files with 403 additions and 435 deletions

View File

@@ -1,4 +1,4 @@
import { ZoneTypes } from "./types";
import { ZoneTypes, Colors } from "./types";
export const mapLocations = {
paris: [48.86, 2.33]
@@ -26,10 +26,11 @@ export const defaultZoneSettings = {
}
export const teamStatus = {
playing: { label: "En jeu", color: "text-custom-green" },
captured: { label: "Capturée", color: "text-custom-red" },
outofzone: { label: "Hors zone", color: "text-custom-orange" },
ready: { label: "Placée", color: "text-custom-green" },
notready: { label: "Non placée", color: "text-custom-red" },
waiting: { label: "En attente", color: "text-custom-grey" },
default: { label: "Indisponible", color: Colors.black },
playing: { label: "En jeu", color: Colors.green },
captured: { label: "Capturée", color: Colors.red },
outofzone: { label: "Hors zone", color: Colors.orange },
ready: { label: "Placée", color: Colors.green },
notready: { label: "Non placée", color: Colors.red },
waiting: { label: "En attente", color: Colors.grey },
}

View File

@@ -2,6 +2,7 @@ import { GameState } from './types';
import { teamStatus } from './configurations';
export function getStatus(team, gamestate) {
if (!team) return null;
switch (gamestate) {
case GameState.SETUP:
return teamStatus.waiting;
@@ -11,5 +12,7 @@ export function getStatus(team, gamestate) {
return team.captured ? teamStatus.captured : team.outofzone ? teamStatus.outofzone : teamStatus.playing;
case GameState.FINISHED:
return team.captured ? teamStatus.captured : teamStatus.playing;
default:
return teamStatus.default;
}
}

View File

@@ -1,3 +1,11 @@
export const Colors = {
black: "#000000",
grey: "#808080",
green: "#19e119",
red: "#e11919",
orange: "#fa6400"
}
export const GameState = {
SETUP: "setup",
PLACEMENT: "placement",