Search in sources :

Example 1 with RandomStatsDetails

use of games.strategy.engine.random.RandomStatsDetails in project triplea by triplea-game.

the class HistoryLog method printDiceStatistics.

public void printDiceStatistics(final GameData data, final IRandomStats randomStats) {
    final PrintWriter logWriter = printWriter;
    final RandomStatsDetails stats = randomStats.getRandomStats(data.getDiceSides());
    final String diceStats = stats.getAllStatsString();
    if (diceStats.length() > 0) {
        logWriter.println(diceStats);
        logWriter.println();
        logWriter.println();
    }
    textArea.setText(stringWriter.toString());
}
Also used : RandomStatsDetails(games.strategy.engine.random.RandomStatsDetails) PrintWriter(java.io.PrintWriter)

Example 2 with RandomStatsDetails

use of games.strategy.engine.random.RandomStatsDetails in project triplea by triplea-game.

the class GameMenu method addShowDiceStats.

private void addShowDiceStats() {
    add(SwingAction.of("Show Dice Stats", e -> {
        final IRandomStats randomStats = (IRandomStats) game.getRemoteMessenger().getRemote(IRandomStats.RANDOM_STATS_REMOTE_NAME);
        final RandomStatsDetails stats = randomStats.getRandomStats(gameData.getDiceSides());
        JOptionPane.showMessageDialog(frame, new JScrollPane(stats.getAllStats()), "Random Stats", JOptionPane.INFORMATION_MESSAGE);
    })).setMnemonic(KeyEvent.VK_D);
}
Also used : JScrollPane(javax.swing.JScrollPane) RandomStatsDetails(games.strategy.engine.random.RandomStatsDetails) IRandomStats(games.strategy.engine.random.IRandomStats)

Aggregations

RandomStatsDetails (games.strategy.engine.random.RandomStatsDetails)2 IRandomStats (games.strategy.engine.random.IRandomStats)1 PrintWriter (java.io.PrintWriter)1 JScrollPane (javax.swing.JScrollPane)1