app.h (2006B)
1 /* app.h - declaraciones compartidas del cliente Linux. */ 2 #ifndef APP_H 3 #define APP_H 4 #include <stdbool.h> 5 #include <stdint.h> 6 #include "frontend.h" 7 #include "session.h" 8 9 typedef struct { 10 int lang; 11 int handoff; 12 int bot_delay; 13 int bot_level; /* 0 facil, 1 medio, 2 dificil (ISMCTS con 25 / 300 / 30000 iteraciones) */ 14 int layout; 15 int scale; 16 char name[20]; 17 char server[128]; 18 char color[MAXP][8]; /* "#rrggbb" por asiento; vacio = el original */ 19 } Settings; 20 21 void settings_load(Settings *st); 22 void settings_save(const Settings *st); 23 void settings_apply_colors(const Settings *st); /* PLAYER_COLOR segun la config */ 24 25 int app_selftest(void); 26 int app_sim(int n, uint64_t seed0, int players, bool v2p); 27 extern int g_sim_scenario, g_sim_map; 28 int app_duel(int n, uint64_t seed0, int players, bool v2p, const SearchCfg *cfg); 29 void app_menu(Frontend *fe, Settings *st); 30 int app_play(Frontend *fe, Session *s, Settings *st); /* 1: "jugar otra" (ver app_play_again) */ 31 void app_play_again(Session *s, Settings *st); /* misma partida local, otro reparto y otros dados */ 32 int run_form(Frontend *fe, Form *f, void (*on_change)(Form *, void *), void *ctx); 33 uint64_t fresh_seed(void); 34 35 /* mapas (app.c): opciones del campo "Mapa" segun la familia de tablero (0 = al azar, 36 * k = mapa k-1), los escenarios para el campo "Escenario" y la vista previa del tablero 37 * antes de crear la partida (R otro reparto, flechas otro mapa; elige o->map y 38 * o->bseed; false = volver al formulario) */ 39 extern const char *const SCEN_CH_ES[SCEN__COUNT], *const SCEN_CH_EN[SCEN__COUNT]; 40 const char *const *map_choices(int family); 41 bool map_preview(Frontend *fe, int layout, Opts *o, bool random_map, const char *const names[MAXP]); 42 43 /* modos online (online.c) */ 44 bool online_menu(Frontend *fe, Settings *st, const char *server); 45 bool lan_host(Frontend *fe, Settings *st, int port); 46 bool lan_join(Frontend *fe, Settings *st, const char *host, int port); 47 48 #endif