aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ch/epfl/xblast/client/XBlastComponent.java22
1 files changed, 11 insertions, 11 deletions
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 {
119 return coordinateComparator.thenComparing(idComparator); 119 return coordinateComparator.thenComparing(idComparator);
120 } 120 }
121 121
122 /**
123 * Draws the players on the graphic context.
124 *
125 * @param g the graphic context
126 * @param players the list of players to be displayed
127 */
128 private static void drawPlayers(Graphics2D g, List<GameState.Player> players) {
129 for (GameState.Player p : players)
130 Painter.drawImage(g, Grid.positionForPlayer(p), p.image());
131 }
132
122 private GameState gameState; 133 private GameState gameState;
123 private PlayerID playerID; 134 private PlayerID playerID;
124 135
@@ -164,15 +175,4 @@ public final class XBlastComponent extends JComponent {
164 drawPlayers(g, Lists.sorted(this.gameState.players(), buildPlayerComparator(this.playerID))); 175 drawPlayers(g, Lists.sorted(this.gameState.players(), buildPlayerComparator(this.playerID)));
165 } 176 }
166 177
167 /**
168 * Draw the players on the graphic context.
169 *
170 * @param g the graphic context
171 * @param players the list of players to be displayed
172 */
173 private void drawPlayers(Graphics2D g, List<GameState.Player> players) {
174 for (GameState.Player p : players)
175 Painter.drawImage(g, Grid.positionForPlayer(p), p.image());
176 }
177
178} 178}