Initial commit

**Motivations:**
- Initialisation du versionning git pour le projet

**Root causes:**
- N/A (Nouveau projet)

**Correctifs:**
- N/A

**Evolutions:**
- Structure initiale du projet
- Ajout du .gitignore

**Pages affectées:**
- Tous les fichiers
This commit is contained in:
2026-03-03 22:24:17 +01:00
commit e031c9a1d2
155 changed files with 22334 additions and 0 deletions

24
server/bot-state.js Normal file
View File

@@ -0,0 +1,24 @@
/**
* Server-side initial bot state. Mirrors web/js/bot-zoo.js createInitialBotState
* so the server does not depend on browser modules.
*/
const PROFILE_OPTIONS = ["fast", "slow", "balanced"];
const INITIAL_COINS_MIN = 150;
const INITIAL_COINS_MAX = 450;
/**
* @returns {{ coins: number, plotLevel: number, conveyorLevel: number, truckLevel: number, profile: string, lastTickAt: number }}
*/
export function createInitialBotState() {
const coins = INITIAL_COINS_MIN + Math.floor(Math.random() * (INITIAL_COINS_MAX - INITIAL_COINS_MIN + 1));
const profile = PROFILE_OPTIONS[Math.floor(Math.random() * PROFILE_OPTIONS.length)];
return {
coins,
plotLevel: 1,
conveyorLevel: 1,
truckLevel: 1,
profile,
lastTickAt: 0,
};
}