console crea la tabla tab_completions automaticament

This commit is contained in:
2026-03-30 23:27:38 +02:00
parent 1817d00881
commit b164c11ba7
2 changed files with 95 additions and 60 deletions

View File

@@ -2,11 +2,12 @@
#include <SDL3/SDL.h>
#include <deque> // Para deque (historial)
#include <functional> // Para function
#include <memory> // Para shared_ptr
#include <string> // Para string
#include <vector> // Para vector
#include <deque> // Para deque (historial)
#include <functional> // Para function
#include <memory> // Para shared_ptr
#include <string> // Para string
#include <unordered_map> // Para unordered_map (tab_completions_)
#include <vector> // Para vector
class Surface;
class Sprite;
@@ -101,4 +102,5 @@ class Console {
// Estado de autocompletado (TAB)
std::vector<std::string> tab_matches_; // Comandos que coinciden con el prefijo actual
int tab_index_{-1}; // Índice actual en tab_matches_
std::unordered_map<std::string, std::vector<std::string>> tab_completions_; // Mapa pre-calculado en constructor
};