Files
builazoo/docs/specs/case_generique.md
Nicolas Cantu 5143a79890 docs: enrich docs/specs and remove placeholders
**Motivations:**
- Make docs/specs implementation-ready without empty sections or placeholders.

**Root causes:**
- Multiple specs still contained non-actionable placeholders (N/A, “see above”, "..."), and inconsistent “no cache” wording.

**Correctifs:**
- Replace placeholders with explicit tables, structures, and typed examples.
- Align “no cache / no memorization” statements where relevant.

**Evolutions:**
- Add a features doc entry to track the documentation enrichment effort.

**Pages affectées:**
- docs/specs/*
- docs/features/docs-specs-enrichment.md
- docs/leo.md
- docs/plan-enrich-docs-specs.md
2026-03-05 03:08:15 +01:00

106 lines
3.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Spécifications : Case (Générique)
## Définition
Une case est l'unité élémentaire de la grille (Zoo ou Monde).
## Propriétés
- **Coordonnées** : Position (x, y) dans la grille.
- **Couleur (Milieu)** : Définit le biome et l'environnement visuel.
- **Température** : Liée à la couleur/biome.
- **Contenu** : Peut contenir un bâtiment, un animal, un visiteur, ou être vide.
- **État** : Peut avoir des indicateurs visuels (herbe jaunie, givre, fertilité).
# Annexes Techniques
## 1. Données et États
### Modèle de Données (JSON)
```json
{
"x": "integer",
"y": "integer",
"grid_id": "string (stable key: `${x}:${y}`)",
"owner_id": "uuid | null (null = carte neutre/monde)",
"created_at": "timestamp",
"updated_at": "timestamp",
"biome_id": "integer",
"biome_type": "enum('prairie','ocean','montagne','savane','toundra','desert','jungle','marais')",
"temperature_offset": "float (°C, additive)",
"content_ref": "uuid | null",
"content_type": "enum('empty','animal','building','visitor','staff','decoration','path','bridge','water','fence')",
"fertility_level": "float (0-100)",
"cleanliness_level": "float (0-100)",
"state_flags": [
"enum('frozen','dry','dirty','fertilized','muddy','snowy','flooded','trampled')"
],
"render": {
"tile_variant": "string (auto-tiling key)",
"occluder": "boolean",
"hitbox": "enum('tile','base_sprite','custom_polygon')"
},
"iso_x": "integer",
"iso_y": "integer",
"z_index": "integer"
}
```
### Contraintes (Invariants)
* **Unicité** : (`x`,`y`) est unique dans une grille.
* **Cohérence contenu** : si `content_type === 'empty'` alors `content_ref === null`.
* **Température** : `temperature_offset` sapplique additivement à la température “biome” et aux modificateurs (saison, jour/nuit).
* **Z-index isométrique** : `z_index` est dérivé principalement de `y` (et secondairement de `x`) pour garantir le recouvrement correct.
## 8. Logique et Interfaces
### Pseudo-code Impacts
```python
def fertilize_case(case, player):
cost = 50
if player.money < cost: return error("NO_MONEY")
player.money -= cost
case.fertility_level = 100
case.state_flags.append("fertilized")
# Si plante dessus, boost croissance
if case.content and case.content.type == "plant":
case.content.growth_rate *= 1.5
return success("CASE_FERTILIZED")
```
### Messages d'Infos / Alerte
| Type | Message | Condition | Priorité |
|---|---|---|---:|
| Info | "Sol fertilisé." | `state_flags` ajoute `fertilized` | 2 |
| Warn | "Fonds insuffisants." | `player.money < cost` | 4 |
| Warn | "Case occupée : action indisponible." | `content_type` non compatible | 3 |
# Annexes UX/UI
## 0. Direction Artistique & Vue
* **Vue** : Isométrique (2.5D).
* **Style** : Coloré, vivant, détails foisonnants (Réf: IMG_20260303_170253.jpg).
* **Sprites** : 4 directions.
* **Interactions** :
* **Sélection** : Cliquer sur la base de l'élément (ou son sprite principal) pour le sélectionner.
* **Feedback** : Surbrillance (outline blanc/jaune) au survol de la souris.
## 1. Expérience Utilisateur (UX)
### Fertilisation (Action)
**Description UX** : Le joueur améliore le sol pour que l'herbe repousse plus vite.
**Description UI** : Outil "Sac d'engrais". Clic sur la case.
**Emplacement** : Menu Outils -> Case.
**Intégration** : Curseur.
**Navigation** : Clic.
**Événements** : `FERTILIZE_SOIL`.
#### Assets
- **Musiques** : `ambience_garden_soft.mp3` (léger, discret).
- **Sons** : `scatter.mp3`.
- **Graphiques** : Particules vertes/brunes.
- **Images** : Texture terre riche (plus foncée).
- **Animations** : Poussière qui retombe.
- **Couleurs** : Marron foncé.
- **Textes** : `TOOL_FERTILIZE` = "Engrais", `CASE_FERTILIZED` = "Sol fertilisé"
- **Formes** : Curseur rond (outil), surbrillance tuile.