From 13d3963d0df936bf23e539ff744fdbbf8f946590 Mon Sep 17 00:00:00 2001 From: Zocker1999NET Date: Mon, 4 Jul 2016 20:20:17 +0200 Subject: [PATCH 1/5] =?UTF-8?q?Debug=20Datei=20f=C3=BCr=206=20Spieler=20en?= =?UTF-8?q?tfernt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Debug6.java | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 Debug6.java diff --git a/Debug6.java b/Debug6.java deleted file mode 100644 index 8cf7a47..0000000 --- a/Debug6.java +++ /dev/null @@ -1,8 +0,0 @@ -public class Debug6 extends Map_World { - public Debug6() { - super( - new String[] {"Spieler Nr. 1", "Player No. 2", "Spieler Nr. 3", "Player No. 4", "Spieler Nr. 5", "Player No. 6"}, - new int[] {1,2,3,4,5,6} - ); - } -} \ No newline at end of file From f25f9eba90771c1610a3d3910327166fc2a320dc Mon Sep 17 00:00:00 2001 From: Zocker1999NET Date: Mon, 4 Jul 2016 20:20:37 +0200 Subject: [PATCH 2/5] =?UTF-8?q?Hinzuf=C3=BCgen=20der=20Begrenzung=20auf=20?= =?UTF-8?q?5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Colours.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Colours.java b/Colours.java index 61a4a98..7ffbd3e 100644 --- a/Colours.java +++ b/Colours.java @@ -17,8 +17,8 @@ public class Colours extends World implements ButtonEvent Button lila = new Button ("Lila", 16, this); Button gelb = new Button ("Gelb", 16, this); Button weiter = new Button ("Weiter", 16, this); - int[] color = new int [6]; - String[] pn = new String [6]; + int[] color = new int [5]; + String[] pn = new String [5]; int x = 0; boolean possw = true; // schwarz boolean posbl = true; // blau @@ -40,7 +40,6 @@ public class Colours extends World implements ButtonEvent Label pl3 = new Label("",16); Label pl4 = new Label("",16); Label pl5 = new Label("",16); - Label pl6 = new Label("",16); /** * Constructor for objects of class Colors. @@ -52,7 +51,7 @@ public class Colours extends World implements ButtonEvent setBackground(Start_Load.backgroundImage); Button[] bList = new Button[] {schwarz,gelb,blau,grün,rot,lila,weiter,remove}; - Label[] lList = new Label[] {header,pl1,pl2,pl3,pl4,pl5,pl6}; + Label[] lList = new Label[] {header,pl1,pl2,pl3,pl4,pl5}; addObject(header,200,15); @@ -70,7 +69,6 @@ public class Colours extends World implements ButtonEvent addObject(pl3,355,200); addObject(pl4,355,220); addObject(pl5,355,240); - addObject(pl6,355,260); schwarz.setForeColor(Color.black); gelb.setForeColor(Color.yellow); @@ -179,6 +177,9 @@ public class Colours extends World implements ButtonEvent } private Color getC(boolean pos) { + if(x >= 5) { + return false; + } return (pos) ? Color.lightGray : Color.gray; } @@ -198,10 +199,7 @@ public class Colours extends World implements ButtonEvent pl3.setText(""); pl4.setText(""); pl5.setText(""); - pl6.setText(""); switch(x) { - case 6: - pl6.setText(pn[5]); case 5: pl5.setText(pn[4]); case 4: From 26d255911f1a66a9420a8c72aa22bbfeb8b513ce Mon Sep 17 00:00:00 2001 From: Zocker1999NET Date: Mon, 4 Jul 2016 20:31:45 +0200 Subject: [PATCH 3/5] Debug Colours --- Colours.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Colours.java b/Colours.java index 7ffbd3e..5cc3066 100644 --- a/Colours.java +++ b/Colours.java @@ -178,7 +178,7 @@ public class Colours extends World implements ButtonEvent private Color getC(boolean pos) { if(x >= 5) { - return false; + return Color.gray; } return (pos) ? Color.lightGray : Color.gray; } From 68828cc7cc460cbba7f77932386883c137707555 Mon Sep 17 00:00:00 2001 From: Zocker1999NET Date: Mon, 4 Jul 2016 20:36:00 +0200 Subject: [PATCH 4/5] Colours Buttons deaktivieren --- Colours.java | 95 ++++++++++++++++++++++++---------------------------- 1 file changed, 43 insertions(+), 52 deletions(-) diff --git a/Colours.java b/Colours.java index 5cc3066..ab1e6eb 100644 --- a/Colours.java +++ b/Colours.java @@ -96,58 +96,49 @@ public class Colours extends World implements ButtonEvent //der per Konstruktor die Daten der Colorklasse übertragen werden, dannach wird die Map die aktive Welt public void buttonClicked (Button b) { - if ( b == schwarz && possw == true) - { - color[x] = sw; - pn[x]=getName(x,"Schwarz"); - if(pn[x].length() > 0) { - x+=1; - possw = false; - } - } - if (b == blau && posbl == true) - { - color[x] = bl; - pn[x]=getName(x,"Blau"); - if(pn[x].length() > 0) { - x+=1; - posbl = false; - } - } - if (b == grün && posgr == true ) - { - color[x] = gr; - pn[x]=getName(x,"Grün"); - if(pn[x].length() > 0) { - x+=1; - posgr = false; - } - } - if ( b == rot && posrt == true) - { - color[x] = rt; - pn[x]=getName(x,"Rot"); - if(pn[x].length() > 0) { - x+=1; - posrt = false; - } - } - if ( b == gelb && posgb == true) - { - color [x] = gb; - pn[x]=getName(x,"Gelb"); - if(pn[x].length() > 0) { - x+=1; - posgb = false; - } - } - if ( b == lila && posli == true) - { - color [x] = li; - pn[x]=getName(x,"Lila"); - if(pn[x].length() > 0) { - x+=1; - posli = false; + if (x < 5) { + if (b == schwarz && possw == true) { + color[x] = sw; + pn[x]=getName(x,"Schwarz"); + if(pn[x].length() > 0) { + x+=1; + possw = false; + } + } else if (b == blau && posbl == true) { + color[x] = bl; + pn[x]=getName(x,"Blau"); + if(pn[x].length() > 0) { + x+=1; + posbl = false; + } + } else if (b == grün && posgr == true ) { + color[x] = gr; + pn[x]=getName(x,"Grün"); + if(pn[x].length() > 0) { + x+=1; + posgr = false; + } + } else if (b == rot && posrt == true) { + color[x] = rt; + pn[x]=getName(x,"Rot"); + if(pn[x].length() > 0) { + x+=1; + posrt = false; + } + } else if (b == gelb && posgb == true) { + color [x] = gb; + pn[x]=getName(x,"Gelb"); + if(pn[x].length() > 0) { + x+=1; + posgb = false; + } + } else if (b == lila && posli == true) { + color [x] = li; + pn[x]=getName(x,"Lila"); + if(pn[x].length() > 0) { + x+=1; + posli = false; + } } } if(b == remove && x > 0) { From 1808dda27fbdb7bbc0d3179229cb28d6560e6d74 Mon Sep 17 00:00:00 2001 From: Zocker1999NET Date: Mon, 4 Jul 2016 20:37:44 +0200 Subject: [PATCH 5/5] =?UTF-8?q?Mindestanzahl=20der=20Spieler=20hinzugef?= =?UTF-8?q?=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Colours.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Colours.java b/Colours.java index ab1e6eb..71e997d 100644 --- a/Colours.java +++ b/Colours.java @@ -185,6 +185,7 @@ public class Colours extends World implements ButtonEvent lila.setBackColor(getC(posli)); gelb.setBackColor(getC(posgb)); remove.setBackColor((x > 0) ? Color.black : Color.gray); + weiter.setBackColor((x > 2) ? Color.black : Color.gray); pl1.setText(""); pl2.setText(""); pl3.setText("");