From e3e9e9a8696f1604c4b3590c142ead48167210b4 Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Tue, 10 May 2016 19:09:50 +0200 Subject: Statify method --- src/ch/epfl/xblast/client/XBlastComponent.java | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/ch') diff --git a/src/ch/epfl/xblast/client/XBlastComponent.java b/src/ch/epfl/xblast/client/XBlastComponent.java index e734d2d..fe5bf5a 100644 --- a/src/ch/epfl/xblast/client/XBlastComponent.java +++ b/src/ch/epfl/xblast/client/XBlastComponent.java @@ -119,6 +119,17 @@ public final class XBlastComponent extends JComponent { return coordinateComparator.thenComparing(idComparator); } + /** + * Draws the players on the graphic context. + * + * @param g the graphic context + * @param players the list of players to be displayed + */ + private static void drawPlayers(Graphics2D g, List players) { + for (GameState.Player p : players) + Painter.drawImage(g, Grid.positionForPlayer(p), p.image()); + } + private GameState gameState; private PlayerID playerID; @@ -164,15 +175,4 @@ public final class XBlastComponent extends JComponent { drawPlayers(g, Lists.sorted(this.gameState.players(), buildPlayerComparator(this.playerID))); } - /** - * Draw the players on the graphic context. - * - * @param g the graphic context - * @param players the list of players to be displayed - */ - private void drawPlayers(Graphics2D g, List players) { - for (GameState.Player p : players) - Painter.drawImage(g, Grid.positionForPlayer(p), p.image()); - } - } -- cgit v1.2.3