Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

first version.

  • Loading branch information...
commit 04062a0be46f74589008da72dcac31f2511a0af1 1 parent f5d680d
@timesqueezer authored
View
0  README.md 100755 → 100644
File mode changed
View
BIN  server-gui/game_gui.conf 100755 → 100644
Binary file not shown
View
0  server-gui/replays/replay_swc_2013_cartagena_Spieler_1_Spieler_2_2012.10.11_13_38_25.xml.gz 100755 → 100644
File mode changed
View
0  server-gui/replays/replay_swc_2013_cartagena_Spieler_1_Spieler_2_2012.10.13_12_57_21.xml.gz 100755 → 100644
File mode changed
View
0  server-gui/replays/replay_swc_2013_cartagena_Spieler_1_Spieler_2_2012.10.13_13_14_21.xml.gz 100755 → 100644
File mode changed
View
0  server-gui/replays/replay_swc_2013_cartagena_Spieler_1_Spieler_2_2012.10.13_13_30_45.xml.gz 100755 → 100644
File mode changed
View
135 server-gui/sync.error 100755 → 100644
@@ -43,3 +43,138 @@ java.lang.InterruptedException
at java.lang.Object.wait(Object.java:485)
at sc.plugin2013.gui.renderer.RenderFacade$1.run(RenderFacade.java:70)
at java.lang.Thread.run(Unknown Source)
+java.lang.InterruptedException
+ at java.lang.Object.wait(Native Method)
+ at java.lang.Object.wait(Object.java:485)
+ at sc.plugin2013.gui.renderer.RenderFacade$1.run(RenderFacade.java:70)
+ at java.lang.Thread.run(Unknown Source)
+java.lang.InterruptedException
+ at java.lang.Object.wait(Native Method)
+ at java.lang.Object.wait(Object.java:485)
+ at sc.plugin2013.gui.renderer.RenderFacade$1.run(RenderFacade.java:70)
+ at java.lang.Thread.run(Unknown Source)
+java.lang.InterruptedException
+ at java.lang.Object.wait(Native Method)
+ at java.lang.Object.wait(Object.java:485)
+ at sc.plugin2013.gui.renderer.RenderFacade$1.run(RenderFacade.java:70)
+ at java.lang.Thread.run(Unknown Source)
+java.lang.InterruptedException
+ at java.lang.Object.wait(Native Method)
+ at java.lang.Object.wait(Object.java:485)
+ at sc.plugin2013.gui.renderer.RenderFacade$1.run(RenderFacade.java:70)
+ at java.lang.Thread.run(Unknown Source)
+java.lang.InterruptedException
+ at java.lang.Object.wait(Native Method)
+ at java.lang.Object.wait(Object.java:485)
+ at sc.plugin2013.gui.renderer.RenderFacade$1.run(RenderFacade.java:70)
+ at java.lang.Thread.run(Unknown Source)
+java.lang.InterruptedException
+ at java.lang.Object.wait(Native Method)
+ at java.lang.Object.wait(Object.java:485)
+ at sc.plugin2013.gui.renderer.RenderFacade$1.run(RenderFacade.java:70)
+ at java.lang.Thread.run(Unknown Source)
+java.lang.InterruptedException
+ at java.lang.Object.wait(Native Method)
+ at java.lang.Object.wait(Object.java:485)
+ at sc.plugin2013.gui.renderer.RenderFacade$1.run(RenderFacade.java:70)
+ at java.lang.Thread.run(Unknown Source)
+java.lang.InterruptedException
+ at java.lang.Object.wait(Native Method)
+ at java.lang.Object.wait(Object.java:485)
+ at sc.plugin2013.gui.renderer.RenderFacade$1.run(RenderFacade.java:70)
+ at java.lang.Thread.run(Unknown Source)
+java.lang.InterruptedException
+ at java.lang.Object.wait(Native Method)
+ at java.lang.Object.wait(Object.java:485)
+ at sc.plugin2013.gui.renderer.RenderFacade$1.run(RenderFacade.java:70)
+ at java.lang.Thread.run(Unknown Source)
+java.lang.InterruptedException
+ at java.lang.Object.wait(Native Method)
+ at java.lang.Object.wait(Object.java:485)
+ at sc.plugin2013.gui.renderer.RenderFacade$1.run(RenderFacade.java:70)
+ at java.lang.Thread.run(Unknown Source)
+java.lang.InterruptedException
+ at java.lang.Object.wait(Native Method)
+ at java.lang.Object.wait(Object.java:485)
+ at sc.plugin2013.gui.renderer.RenderFacade$1.run(RenderFacade.java:70)
+ at java.lang.Thread.run(Unknown Source)
+java.lang.InterruptedException
+ at java.lang.Object.wait(Native Method)
+ at java.lang.Object.wait(Object.java:485)
+ at sc.plugin2013.gui.renderer.RenderFacade$1.run(RenderFacade.java:70)
+ at java.lang.Thread.run(Unknown Source)
+java.lang.InterruptedException
+ at java.lang.Object.wait(Native Method)
+ at java.lang.Object.wait(Object.java:485)
+ at sc.plugin2013.gui.renderer.RenderFacade$1.run(RenderFacade.java:70)
+ at java.lang.Thread.run(Unknown Source)
+java.lang.InterruptedException
+ at java.lang.Object.wait(Native Method)
+ at java.lang.Object.wait(Object.java:485)
+ at sc.plugin2013.gui.renderer.RenderFacade$1.run(RenderFacade.java:70)
+ at java.lang.Thread.run(Unknown Source)
+java.lang.InterruptedException
+ at java.lang.Object.wait(Native Method)
+ at java.lang.Object.wait(Object.java:485)
+ at sc.plugin2013.gui.renderer.RenderFacade$1.run(RenderFacade.java:70)
+ at java.lang.Thread.run(Unknown Source)
+java.lang.InterruptedException
+ at java.lang.Object.wait(Native Method)
+ at java.lang.Object.wait(Object.java:485)
+ at sc.plugin2013.gui.renderer.RenderFacade$1.run(RenderFacade.java:70)
+ at java.lang.Thread.run(Unknown Source)
+java.lang.InterruptedException
+ at java.lang.Object.wait(Native Method)
+ at java.lang.Object.wait(Object.java:485)
+ at sc.plugin2013.gui.renderer.RenderFacade$1.run(RenderFacade.java:70)
+ at java.lang.Thread.run(Unknown Source)
+java.lang.InterruptedException
+ at java.lang.Object.wait(Native Method)
+ at java.lang.Object.wait(Object.java:485)
+ at sc.plugin2013.gui.renderer.RenderFacade$1.run(RenderFacade.java:70)
+ at java.lang.Thread.run(Unknown Source)
+java.lang.InterruptedException
+ at java.lang.Object.wait(Native Method)
+ at java.lang.Object.wait(Object.java:485)
+ at sc.plugin2013.gui.renderer.RenderFacade$1.run(RenderFacade.java:70)
+ at java.lang.Thread.run(Unknown Source)
+java.lang.InterruptedException
+ at java.lang.Object.wait(Native Method)
+ at java.lang.Object.wait(Object.java:485)
+ at sc.plugin2013.gui.renderer.RenderFacade$1.run(RenderFacade.java:70)
+ at java.lang.Thread.run(Unknown Source)
+java.lang.InterruptedException
+ at java.lang.Object.wait(Native Method)
+ at java.lang.Object.wait(Object.java:485)
+ at sc.plugin2013.gui.renderer.RenderFacade$1.run(RenderFacade.java:70)
+ at java.lang.Thread.run(Unknown Source)
+java.lang.InterruptedException
+ at java.lang.Object.wait(Native Method)
+ at java.lang.Object.wait(Object.java:485)
+ at sc.plugin2013.gui.renderer.RenderFacade$1.run(RenderFacade.java:70)
+ at java.lang.Thread.run(Unknown Source)
+java.lang.InterruptedException
+ at java.lang.Object.wait(Native Method)
+ at java.lang.Object.wait(Object.java:485)
+ at sc.plugin2013.gui.renderer.RenderFacade$1.run(RenderFacade.java:70)
+ at java.lang.Thread.run(Unknown Source)
+java.lang.InterruptedException
+ at java.lang.Object.wait(Native Method)
+ at java.lang.Object.wait(Object.java:485)
+ at sc.plugin2013.gui.renderer.RenderFacade$1.run(RenderFacade.java:70)
+ at java.lang.Thread.run(Unknown Source)
+java.lang.InterruptedException
+ at java.lang.Object.wait(Native Method)
+ at java.lang.Object.wait(Object.java:485)
+ at sc.plugin2013.gui.renderer.RenderFacade$1.run(RenderFacade.java:70)
+ at java.lang.Thread.run(Unknown Source)
+java.lang.InterruptedException
+ at java.lang.Object.wait(Native Method)
+ at java.lang.Object.wait(Object.java:485)
+ at sc.plugin2013.gui.renderer.RenderFacade$1.run(RenderFacade.java:70)
+ at java.lang.Thread.run(Unknown Source)
+java.lang.InterruptedException
+ at java.lang.Object.wait(Native Method)
+ at java.lang.Object.wait(Object.java:485)
+ at sc.plugin2013.gui.renderer.RenderFacade$1.run(RenderFacade.java:70)
+ at java.lang.Thread.run(Unknown Source)
View
BIN  simpleclient-ca-src/bin/lolol.jar
Binary file not shown
View
0  simpleclient-ca-src/src/sc/player2013/MatzLogic.java
No changes.
View
0  simpleclient-ca-src/src/sc/player2013/Starter.java 100755 → 100644
File mode changed
View
56 simpleclient-ca-src/src/sc/player2013/WinnerLogic.java 100755 → 100644
@@ -1,7 +1,9 @@
package sc.player2013;
import java.security.SecureRandom;
+import java.util.ArrayList;
import java.util.LinkedList;
+import java.util.List;
import java.util.Random;
import sc.plugin2013.BackwardMove;
@@ -56,7 +58,21 @@ public void gameEnded(GameResult data, PlayerColor color,
System.out.println("*** Das Spiel ist beendet");
}
-
+
+ /**
+ * {@inheritDoc}
+ */
+ public int getFirstPirateFieldIndex() {
+ int result = 0;
+ for (int k = 0; k < gameState.getBoard().size(); k++) {
+ if (gameState.getBoard().getField(k).numPirates(gameState.getCurrentPlayerColor()) > 0) {
+ result = k;
+ break;
+ }
+ }
+ return result;
+ }
+
/**
* {@inheritDoc}
*/
@@ -68,6 +84,15 @@ public void onRequestAction() {
for (int i = 0; i < 3; i++) {
// Liste der verfügbaren Züge
LinkedList<Move> possibleMoves = (LinkedList<Move>) gameState.getPossibleMoves();
+ List<ForwardMove> possibleForwardMoves = new ArrayList<ForwardMove>();
+ List<BackwardMove> possibleBackwardMoves = new ArrayList<BackwardMove>();
+ for (Move m: possibleMoves) {
+ if (m.getClass().equals(ForwardMove.class)) {
+ possibleForwardMoves.add((ForwardMove) m);
+ } else if (m.getClass().equals(BackwardMove.class)) {
+ possibleBackwardMoves.add((BackwardMove) m);
+ }
+ }
System.out.println("*** Anzahl der möglichen Züge:"
+ possibleMoves.size());
@@ -75,29 +100,26 @@ public void onRequestAction() {
// Wenn es mögliche Züge gibt:
if (possibleMoves.size() > 0) {
- if (currentPlayer.getCards().size() <= 1) {
+ if (gameState.getCurrentPlayer().getCards().size() <= 1) {
for (int k = gameState.getBoard().size(); k > 0; k--) {
- Field pirate_field = gameState.getBoard().getField(k);
+ System.out.println("Size:" + k);
+ Field pirate_field = gameState.getBoard().getField(k-1);
if (pirate_field.numPirates(gameState.getCurrentPlayerColor()) > 0) {
- move = new BackwardMove(k);
+ move = new BackwardMove(k-1);
+ break;
}
}
} else {
-
- int biggest_index = 0;
-
- for (Move m: possibleMoves) {
- if (m.fieldIndex > biggest_index) {
- biggest_index = m.fieldIndex;
- }
- }
- for (Move m: possibleMoves) {
- if (m.fieldIndex == biggest_index) {
- move = (ForwardMove) m;
- }
- }
+ int k = getFirstPirateFieldIndex();
+ System.out.println("K = " + k);
+ for (Move m: possibleForwardMoves) {
+ if (m.fieldIndex == k) {
+ move = (ForwardMove) m;
+ break;
+ }
+ }
}
} else {
Please sign in to comment.
Something went wrong with that request. Please try again.