-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
App still broken, doesn't paint the Ships and fails on first MouseClick
- Loading branch information
Aleksandar
authored and
Aleksandar
committed
Jan 10, 2014
1 parent
5243baa
commit 768f4be
Showing
29 changed files
with
177 additions
and
348 deletions.
There are no files selected for viewing
Binary file modified
BIN
+18 Bytes
(100%)
battleships/bin/Battleships/Adapters/AttackMousePressListener.class
Binary file not shown.
Binary file modified
BIN
+604 Bytes
(140%)
battleships/bin/Battleships/Adapters/HomeMousePressListener.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+33 Bytes
(100%)
battleships/bin/Battleships/Behaviors/HShipGridSetter.class
Binary file not shown.
Binary file modified
BIN
+143 Bytes
(110%)
battleships/bin/Battleships/Behaviors/ShipGridSetterBehavior.class
Binary file not shown.
Binary file modified
BIN
+33 Bytes
(100%)
battleships/bin/Battleships/Behaviors/VShipGridSetter.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 0 additions & 27 deletions
27
battleships/src/Battleships/Factories/AxisResolverFactory.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
battleships/src/Battleships/Factories/ResolverFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package Battleships.Factories; | ||
|
||
import Battleships.Ships.AircraftCarrier; | ||
import Battleships.Ships.Battleship; | ||
import Battleships.Ships.Destroyer; | ||
import Battleships.Ships.Minesweeper; | ||
import Battleships.Ships.Submarine; | ||
|
||
public class ResolverFactory { | ||
public static int AxisCoOrdinate(int Coordinate) { | ||
if (Coordinate < 20) | ||
return 0; | ||
else if (Coordinate < 40) | ||
return 1; | ||
else if (Coordinate < 60) | ||
return 2; | ||
else if (Coordinate < 80) | ||
return 3; | ||
else if (Coordinate < 100) | ||
return 4; | ||
else if (Coordinate < 120) | ||
return 5; | ||
else if (Coordinate < 140) | ||
return 6; | ||
else if (Coordinate < 160) | ||
return 7; | ||
else if (Coordinate < 180) | ||
return 8; | ||
else if (Coordinate < 200) | ||
return 9; | ||
return -1; | ||
} | ||
public static String nextShip(String current) { | ||
if(current.equalsIgnoreCase(AircraftCarrier.class.getSimpleName())) | ||
return Battleship.class.getSimpleName(); | ||
else if(current.equalsIgnoreCase(Battleship.class.getSimpleName())) | ||
return Destroyer.class.getSimpleName(); | ||
else if(current.equalsIgnoreCase(Destroyer.class.getSimpleName())) | ||
return Submarine.class.getSimpleName(); | ||
else if(current.equalsIgnoreCase(Submarine.class.getSimpleName())) | ||
return Minesweeper.class.getSimpleName(); | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.