use of com.playshogi.website.gwt.shared.models.AnalysisRequestResult in project playshogi by Tellmarch.
the class ViewKifuActivity method onRequestKifuEvaluationEvent.
@EventHandler
public void onRequestKifuEvaluationEvent(final RequestKifuEvaluationEvent event) {
GWT.log("View Kifu Activity Handling RequestKifuEvaluationEvent");
String usf = UsfFormat.INSTANCE.write(viewKifuView.getNavigationController().getGameNavigation().getGameTree());
kifuService.requestKifuAnalysis(sessionInformation.getSessionId(), usf, new AsyncCallback<AnalysisRequestStatus>() {
@Override
public void onFailure(Throwable throwable) {
GWT.log("ViewKifu - error requesting kifu evaluation");
}
@Override
public void onSuccess(AnalysisRequestStatus result) {
GWT.log("ViewKifu - kifu evaluation result: " + result);
if (result.isDenied()) {
eventBus.fireEvent(new KifuEvaluationEvent(new AnalysisRequestResult(result), kifuId));
} else if (result.needToWait()) {
Timer timer = new Timer() {
@Override
public void run() {
queryKifuAnalysisResults(usf, this);
}
};
timer.scheduleRepeating(1000);
} else {
queryKifuAnalysisResults(usf, null);
}
}
});
}
Aggregations