Browse Source

update refratoring

main
Thoumi Ngonga Brice 2 years ago
parent
commit
dc47e08306
  1. 2
      .idea/hellsgamers.iml
  2. 14
      src/main/java/BattleShip/AIGridGUI.java
  3. BIN
      target/classes/BattleShip/AIGridGUI.class
  4. BIN
      target/classes/PingPong/Paddle.class
  5. BIN
      target/classes/PingPong/Score.class

2
.idea/hellsgamers.iml

@ -7,7 +7,7 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/test_/java" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/test_/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/Test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" /> <excludeFolder url="file://$MODULE_DIR$/target" />
</content> </content>
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />

14
src/main/java/BattleShip/AIGridGUI.java

@ -5,7 +5,7 @@ import javax.swing.border.*;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.*;
import java.util.*; import java.util.*;
//refractoring test
public class AIGridGUI extends JPanel { public class AIGridGUI extends JPanel {
@ -28,8 +28,8 @@ public class AIGridGUI extends JPanel {
Border loweredBevel = BorderFactory.createLoweredBevelBorder(); Border loweredBevel = BorderFactory.createLoweredBevelBorder();
//Border raisedbevel = BorderFactory.createRaisedBevelBorder(); //Border raisedbevel = BorderFactory.createRaisedBevelBorder();
Border defaultBorder; Border defaultBorder;
//empty = BorderFactory.createEmptyBorder(4, 4, 4, 4);
Border compound = BorderFactory.createCompoundBorder();
Ship shipToPlace; Ship shipToPlace;
boolean vertical = false; boolean vertical = false;
boolean clear; boolean clear;
@ -504,6 +504,14 @@ public class AIGridGUI extends JPanel {
clear = false; clear = false;
} }
} }
} else {
for(int i = 0; i < shipToPlace.getLength(); i++) {
int testing = cell.getGridLocation() + i;
if((i > 0 && (testing % columns) == 0) || buttons.get(testing).getCellContents() != null) {
clear = false;
}
}
} }
if(clear) { if(clear) {

BIN
target/classes/BattleShip/AIGridGUI.class

BIN
target/classes/PingPong/Paddle.class

BIN
target/classes/PingPong/Score.class

Loading…
Cancel
Save