Added documentation to README.md

This commit is contained in:
2026-01-31 17:06:22 +01:00
parent 819c03fb80
commit b0afdc50f3

View File

@@ -73,5 +73,51 @@ Le projet est assez simple d'utilisation car une fois le serveur lancé, il vous
## Documentation
### Tools
Les outils implementes sont :
### Outils
Outils liés à la gestion de la partie :
```python
async def load_game(slot:int) # Charge une sauvegarde
async def save_game(slot:int) # Sauvegarde une partie
async def get_game_state() # Récupère le contexte de la partie pour se remettre à jour
```
Routines de création de contenu :
```python
# Crée un joueur
async def create_npc(name: str, strength: int, dexterity: int, intelligence: int, wisdom: int, charisma: int, hp: int, armor: int, speed: int, item_id:str)
# Crée un personnage non-joueur
async def create_player(name: str, strength: int, dexterity: int, intelligence: int, wisdom: int, charisma: int, hp: int, armor: int, speed: int, item_id:str)
# Crée un objet
async def create_item(name: str, description: str, stat_modifier: dict[str,int])
# Crée un événement (fonctionne comme un contexte de combat, d'exploration, etc.)
async def start_event(location:str, initial_description:str, entity_list:list[str])
```
Routines d'actions du joueur et du système
```python
# Lance une attaque
async def perform_attack(src_entity_id:str, target_entity_id:str, attack_type:Stat)
# Lance un test (ex: crocheter une serrure, soulever un poids)
async def perform_simple_action(entity_id:str, stat:Stat, difficulty:int, roll:int, description:str)
# Modifie une statistique (se faire maudire, boire une potion)
async def perform_stat_modification(entity_id:str, stat:Stat, value:int=0)
# Donne un objet à une entité
async def equip_item_to_entity(entity_id: str, item_id: str)
```
Routines utilitaires :
```python
# Récupère les propriétés d'un objet
async def get_item_properties(item_id: str) -> Dict[str, Any]
# Récupère les propriétés d'une entité
async def get_entity_status(entity_id: str) -> Dict[str, Any]
# Récupère l'événement en cours
async def get_current_event() -> Dict[str, Any]
# Récupère la liste de toutes les entités actives
async def get_all_entities_status()
# Lance un dé
async def throw_a_dice(n_faces: int) -> Any
# Lance une pièce
async def toss_coin()
```