UNPKG

pict-application

Version:

Application base class for a pict view-based application

31 lines (26 loc) 518 B
const libPictView = require('pict-view'); class SimpleSolverView extends libPictView { constructor(pFable, pOptions, pServiceHash) { super(pFable, pOptions, pServiceHash); } onBeforeSolve() { super.onBeforeSolve(); if (!('SolveCount' in this.pict.AppData)) { this.pict.AppData.SolveCount = 0; } } onSolve() { super.onSolve(); this.pict.AppData.SolveCount++; } onAfterSolve() { this.pict.log.info(`SolveCount: ${this.pict.AppData.SolveCount}`); } } module.exports = SimpleSolverView;