import AbstractView from "./abstracts/AbstractView.js"; import { lang } from "../index.js"; import { TicTacToe } from "../api/game/tictactoe/TicTacToeGame.js" export class TicTacToeOnlineView extends AbstractView { constructor(params, titleKey) { super(params, lang.get('ticTacToeTitle')); this.params = params; this.titleKey = titleKey; this.game_id = params.id; this.height = 560; this.width = 560; } async postInit() { this.Morpion = new TicTacToe(this.height, this.width, 30, 55.5, document.getElementById("Morpion"), this.game_id); this.Morpion.DrawSuperMorpion(); await this.Morpion.init(); } async leavePage() { this.Morpion.uninit(); } setTitle() { document.title = lang.get(this.titleKey, this.titleKey); } async getHtml() { return `

${lang.get('ruleTitle')}

${lang.get('ruleBase')}

${lang.get('ruleMovement')}

${lang.get('ruleDraw')}
` } }