Private
Public Access
1
0

feat: Adding economic system to do scoring

This commit is contained in:
gauvainboiche
2026-03-30 11:28:47 +02:00
parent b19fb262a4
commit c0f66d8cc0
16 changed files with 1303 additions and 145 deletions

View File

@@ -48,4 +48,20 @@ export async function apiGetMe(token) {
return fetch("/api/auth/me", {
headers: { Authorization: `Bearer ${token}` },
});
}
}
export async function apiFetchEconScores() {
const res = await fetch("/api/econ-scores");
if (!res.ok) throw new Error("econ_scores_fetch_failed");
return res.json();
}
export async function apiTickEconScores(seed, blue, red) {
const res = await fetch("/api/econ-scores/tick", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ seed, blue, red }),
});
if (!res.ok) throw new Error("econ_tick_failed");
return res.json();
}