El Impostor v0.1 — app Flutter completa

Juego de deducción social para 3-20 jugadores.
Modo un solo móvil completamente funcional.
1000 palabras en 10 categorías.
Notas privadas, votación, adivinanza, revancha.
Material 3 dark theme.
Package: es.freetimelab.elimpostor
This commit is contained in:
ShanaiaBot
2026-04-04 00:50:04 +02:00
parent eb7661cb36
commit de2c8ffa18
45 changed files with 4206 additions and 0 deletions

51
lib/modelos/jugador.dart Normal file
View File

@@ -0,0 +1,51 @@
/// Representa un jugador en la partida
class Jugador {
final String id;
final String nombre;
bool esImpostor;
bool eliminado;
String? palabra;
String? endpointId; // Para modo multimóvil
Map<String, String> notas; // nombre_jugador -> nota
Jugador({
required this.id,
required this.nombre,
this.esImpostor = false,
this.eliminado = false,
this.palabra,
this.endpointId,
Map<String, String>? notas,
}) : notas = notas ?? {};
Jugador copiar({
bool? esImpostor,
bool? eliminado,
String? palabra,
String? endpointId,
}) {
return Jugador(
id: id,
nombre: nombre,
esImpostor: esImpostor ?? this.esImpostor,
eliminado: eliminado ?? this.eliminado,
palabra: palabra ?? this.palabra,
endpointId: endpointId ?? this.endpointId,
notas: Map.from(notas),
);
}
Map<String, dynamic> toJson() => {
'id': id,
'nombre': nombre,
'esImpostor': esImpostor,
'eliminado': eliminado,
};
factory Jugador.fromJson(Map<String, dynamic> json) => Jugador(
id: json['id'] as String,
nombre: json['nombre'] as String,
esImpostor: json['esImpostor'] as bool? ?? false,
eliminado: json['eliminado'] as bool? ?? false,
);
}