File tree Expand file tree Collapse file tree 3 files changed +8
-12
lines changed
src/main/java/spypunk/tetris Expand file tree Collapse file tree 3 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -197,17 +197,12 @@ private void checkShapeLocked() {
197197
198198 String playerName = "" ;
199199
200- System .out .println ("not added" );
201-
202200 while (!tetrisUserNameInputView .playerNameGiven ){
203201 playerName = tetrisUserNameInputView .getPlayerName ();
204- System .out .println ("2: " + playerName );
205202 if (tetrisUserNameInputView .playerNameGiven )
206203 break ;
207204 }
208205
209- System .out .println ("added" );
210-
211206 tetrisUserNameInputView .closeView ();
212207 currentPlayerScore .add (new HighScoreEntry (playerName , playerScore ));
213208 tetris .setHighScore (currentPlayerScore .highestScore ().getScore ());
Original file line number Diff line number Diff line change 66import java .io .IOException ;
77import java .util .Scanner ;
88
9- import jdk .javadoc .internal .doclets .formats .html .SourceToHTMLConverter ;
9+ import org .slf4j .Logger ;
10+ import org .slf4j .LoggerFactory ;
11+
12+ import spypunk .tetris .ui .util .SwingUtils ;
1013
1114public class Scores {
15+ private static final Logger LOGGER = LoggerFactory .getLogger (Scores .class );
16+
1217 public static final int maxEntries = 10 ;
1318 private int numEntries ;
1419
@@ -54,8 +59,7 @@ public void updateFile(){
5459 }
5560 myWriter .close ();
5661 } catch (IOException e ) {
57- System .out .println ("An error occurred." );
58- e .printStackTrace ();
62+ LOGGER .error (e .getMessage (), e );
5963 }
6064 }
6165
@@ -73,8 +77,7 @@ public void updateEntries(){
7377 }
7478 myReader .close ();
7579 } catch (FileNotFoundException e ) {
76- System .out .println ("An error occurred." );
77- e .printStackTrace ();
80+ LOGGER .error (e .getMessage (), e );
7881 }
7982 }
8083
Original file line number Diff line number Diff line change @@ -37,13 +37,11 @@ public TetrisUserNameInputView() {
3737 jButton .addActionListener ((e ) -> {
3838 playerName = userInput .getText ();
3939 playerNameGiven = true ;
40- System .out .println ("name entered" );
4140 });
4241
4342 }
4443
4544 public String getPlayerName (){
46- System .out .println ("1: " + playerName );
4745 return playerName ;
4846 }
4947
You can’t perform that action at this time.
0 commit comments