Skip to content

Commit

Permalink
Misc update
Browse files Browse the repository at this point in the history
  • Loading branch information
ginowangsh4 committed Jun 14, 2018
1 parent 516d489 commit 06160e5
Show file tree
Hide file tree
Showing 48 changed files with 15 additions and 31 deletions.
Binary file added bin/tsuro/APlayer$State.class
Binary file not shown.
Binary file added bin/tsuro/APlayer.class
Binary file not shown.
Binary file modified bin/tsuro/Board.class
Binary file not shown.
Binary file modified bin/tsuro/HPlayer.class
Binary file not shown.
Binary file removed bin/tsuro/IPlayer.class
Binary file not shown.
Binary file removed bin/tsuro/MPlayer$1.class
Binary file not shown.
Binary file removed bin/tsuro/MPlayer$State.class
Binary file not shown.
Binary file removed bin/tsuro/MPlayer$Strategy.class
Binary file not shown.
Binary file modified bin/tsuro/MPlayer.class
Binary file not shown.
Binary file added bin/tsuro/MPlayerKA.class
Binary file not shown.
Binary file added bin/tsuro/MPlayerLeastSym.class
Binary file not shown.
Binary file added bin/tsuro/MPlayerMostSym.class
Binary file not shown.
Binary file added bin/tsuro/MPlayerRandom.class
Binary file not shown.
Binary file modified bin/tsuro/MPlayerTest.class
Binary file not shown.
Binary file removed bin/tsuro/PlayATurnAdapterTest.class
Binary file not shown.
Binary file modified bin/tsuro/RemotePlayer.class
Binary file not shown.
Binary file modified bin/tsuro/SPlayer.class
Binary file not shown.
Binary file modified bin/tsuro/Server.class
Binary file not shown.
Binary file modified bin/tsuro/ServerTest.class
Binary file not shown.
Binary file modified bin/tsuro/Tsuro.class
Binary file not shown.
Binary file modified bin/tsuro/admin/Admin.class
Binary file not shown.
Binary file modified bin/tsuro/admin/AdminSocket.class
Binary file not shown.
Binary file modified bin/tsuro/admin/App.class
Binary file not shown.
Binary file modified bin/tsuro/admin/EndGameController.class
Binary file not shown.
Binary file modified bin/tsuro/admin/PlacePawnController.class
Binary file not shown.
Binary file modified bin/tsuro/admin/PlayTurnController.class
Binary file not shown.
Binary file modified bin/tsuro/admin/StartGameController.class
Binary file not shown.
Binary file modified bin/tsuro/parser/BoardParser.class
Binary file not shown.
Binary file modified image/board/0/0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified image/board/0/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified image/board/0/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified image/board/0/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified image/board/1/0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified image/board/1/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified image/board/1/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified image/board/1/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified image/board/2/0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified image/board/2/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified image/board/2/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified image/board/2/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified image/board/board.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified image/hand/0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified image/hand/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified image/hand/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/admin/Admin.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// Localhost IP: "127.0.0.1"
// Richie IP: "10.105.75.35"
// Jin IP: "10.105.16.16"

// Jennifer IP: "10.105.35.58"
public class Admin {
private static DocumentBuilder db;
private static AdminSocket socket;
Expand All @@ -27,7 +27,7 @@ public class Admin {
public static void main(String[] args) throws Exception {
db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
parser = new Parser(db);
socket = new AdminSocket("127.0.0.1", Integer.parseInt(args[0]));
socket = new AdminSocket("localhost", Integer.parseInt(args[0]));
if (args[2].equals("M")) {
switch (args[3]) {
case "R":
Expand Down
12 changes: 12 additions & 0 deletions src/main/Board.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,18 @@ public static boolean posOffBoard(int[] position) {
return position[0] < 0 || position[0] > 5 || position[1] < 0 || position[1] > 5;
}

/**
* Find the token of a APlayer on a given board
*/
public Token findMyToken(int color) {
for (SPlayer sp : getSPlayerList()) {
if (sp.getToken().getColor() == color) {
return sp.getToken();
}
}
throw new IllegalArgumentException("Cannot find token on board");
}

/**
* Simulate the path taken by a token given a board
* @param token token that attempts making the move
Expand Down
14 changes: 1 addition & 13 deletions src/main/HPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,6 @@ public void endGame(Board b, List<Integer> colors) throws Exception {
out.println(winnerList.toString());
}

/**
* Find the token of this HPlayer on a given board
*/
private Token findMyToken(Board b) {
for (SPlayer sp : b.getSPlayerList()) {
if (sp.getToken().getColor() == color) {
return sp.getToken();
}
}
throw new IllegalArgumentException("Cannot find token on board");
}

/**
* Generate a token given inputs from UI
* @param colorIndex color of this token
Expand Down Expand Up @@ -143,7 +131,7 @@ private Tile getTile(List<Tile> hand, int handIndex, int rotationIndex) {
private void generateBoardAndTileImages(Board b, List<Tile> hand) throws Exception {
Document boardXML = parser.boardParser.buildXML(b);
generateBoardImage(boardXML, -1, -1);
Token token = findMyToken(b);
Token token = b.findMyToken(color);
int[] location = Board.getAdjacentLocation(token);
for (int i = 0; i < hand.size(); i++) {
Tile copy = hand.get(i).copyTile();
Expand Down
16 changes: 0 additions & 16 deletions src/main/MPlayerKA.java

This file was deleted.

0 comments on commit 06160e5

Please sign in to comment.