add templates

This commit is contained in:
2026-06-24 21:00:19 -03:00
parent f80223e0ed
commit b210ed4f92
17 changed files with 866 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
import { BaseGameValidator } from "../../../../shared/BaseGameValidator";
export class ExemploValidator extends BaseGameValidator {
validatePhase(history, config, gameConfig, sceneRef) {
// Lê a posição lógica final do jogador diretamente da cena (fonte de verdade)
const { jogadorLogico } = sceneRef;
const alvo = config?.alvo;
if (jogadorLogico.col === alvo.col && jogadorLogico.row === alvo.row) {
return this.success();
}
return this.failure(
gameConfig?.mensagens?.naoAlcancou || "O personagem não chegou ao alvo. Tente de novo!"
);
}
}
export function validationSolution(history, config, gameConfig, sceneRef) {
const validator = new ExemploValidator();
return validator.validate(history, config, gameConfig, sceneRef);
}