use of games.strategy.triplea.delegate.dataObjects.TechRoll in project triplea by triplea-game.
the class TripleAPlayer method tech.
private void tech() {
if (getPlayerBridge().isGameOver()) {
return;
}
final ITechDelegate techDelegate;
try {
techDelegate = (ITechDelegate) getPlayerBridge().getRemoteDelegate();
} catch (final ClassCastException e) {
final String errorContext = "PlayerBridge step name: " + getPlayerBridge().getStepName() + ", Remote class name: " + getPlayerBridge().getRemoteDelegate().getClass();
// for some reason the client is not seeing or getting these errors, so print to err too
System.err.println(errorContext);
ClientLogger.logQuietly(errorContext, e);
throw new IllegalStateException(errorContext, e);
}
final PlayerID id = getPlayerId();
if (!soundPlayedAlreadyTechnology) {
ClipPlayer.play(SoundPath.CLIP_PHASE_TECHNOLOGY, id);
soundPlayedAlreadyTechnology = true;
}
final TechRoll techRoll = ui.getTechRolls(id);
if (techRoll != null) {
final TechResults techResults = techDelegate.rollTech(techRoll.getRolls(), techRoll.getTech(), techRoll.getNewTokens(), techRoll.getWhoPaysHowMuch());
if (techResults.isError()) {
ui.notifyError(techResults.getErrorString());
tech();
} else {
ui.notifyTechResults(techResults);
}
}
}
Aggregations