diff options
Diffstat (limited to 'JBriscola/all_versions/0.1/0.1 Beta 2')
4 files changed, 802 insertions, 0 deletions
diff --git a/JBriscola/all_versions/0.1/0.1 Beta 2/src/Frame.java b/JBriscola/all_versions/0.1/0.1 Beta 2/src/Frame.java new file mode 100755 index 0000000..36ff831 --- /dev/null +++ b/JBriscola/all_versions/0.1/0.1 Beta 2/src/Frame.java | |||
| @@ -0,0 +1,174 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2009 Sebastiano Tronto <sebastiano@luganega.org> | ||
| 3 | |||
| 4 | This file is part of JBriscola. | ||
| 5 | |||
| 6 | JBriscola is free software; you can redistribute it and/or modify | ||
| 7 | it under the terms of the GNU General Public License as published by | ||
| 8 | the Free Software Foundation; either version 2 of the License, or | ||
| 9 | (at your option) any later version. | ||
| 10 | |||
| 11 | JBriscola is distributed in the hope that it will be useful, | ||
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | GNU General Public License for more details. | ||
| 15 | |||
| 16 | You should have received a copy of the GNU General Public License | ||
| 17 | along with JBriscola; if not, write to the Free Software | ||
| 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 19 | |||
| 20 | */ | ||
| 21 | |||
| 22 | import javax.swing.*; | ||
| 23 | import java.awt.*; | ||
| 24 | import java.awt.event.*; | ||
| 25 | |||
| 26 | public class Frame extends JFrame { | ||
| 27 | public static boolean mazzo; | ||
| 28 | public static Main main; | ||
| 29 | public static Pannello pannello; | ||
| 30 | public static JButton button; | ||
| 31 | public static JMenuBar barraMenu; | ||
| 32 | public static JMenu file; | ||
| 33 | public static JMenuItem nuovaPartita, opzioni, esci; | ||
| 34 | public static ImageIcon retro1, retro2, ultimaCarta; | ||
| 35 | public static ImageIcon[] giocata = new ImageIcon[2]; | ||
| 36 | public static ImageIcon[] carteInMano = new ImageIcon[3]; | ||
| 37 | public static ImageIcon[] carteCPU = new ImageIcon[3]; | ||
| 38 | public static ImageIcon[] arrayCarteMescolate = new ImageIcon[40]; | ||
| 39 | public static ImageIcon[][] arrayCarte = new ImageIcon[10][4]; | ||
| 40 | public Frame() { | ||
| 41 | super( "Tronto's JBriscola 0.1 Beta 2" ); | ||
| 42 | mazzo = true; | ||
| 43 | main = new Main(); | ||
| 44 | pannello = new Pannello(); | ||
| 45 | button = new JButton( main.stringaBottonePrendi ); | ||
| 46 | button.addActionListener( new ActionListener() { | ||
| 47 | public void actionPerformed( ActionEvent e ) { | ||
| 48 | if ( giocata[0] != null && giocata[1] != null ) | ||
| 49 | main.mano++; | ||
| 50 | try { | ||
| 51 | main.chiPrende(); | ||
| 52 | } catch ( Exception ex ) { | ||
| 53 | JOptionPane.showMessageDialog( Frame.this, main.stringaPrimaGioca, "JBriscola 0.1", JOptionPane.WARNING_MESSAGE ); | ||
| 54 | } | ||
| 55 | if ( main.mano == 16 ) | ||
| 56 | JOptionPane.showMessageDialog( Frame.this, main.stringaUltime4, "JBriscola 0.1", JOptionPane.INFORMATION_MESSAGE ); | ||
| 57 | if ( main.mano == 17 ) { | ||
| 58 | mazzo = false; | ||
| 59 | ultimaCarta = null; | ||
| 60 | pannello.repaint(); | ||
| 61 | Frame.this.repaint(); | ||
| 62 | } | ||
| 63 | if ( main.mano == 20 ) { | ||
| 64 | String titolo = main.stringaVinto; | ||
| 65 | if ( main.punteggio < main.punteggioCPU ) | ||
| 66 | titolo = main.stringaPerso; | ||
| 67 | if ( main.punteggio == main.punteggioCPU ) | ||
| 68 | titolo = main.stringaPareggio; | ||
| 69 | JOptionPane.showMessageDialog( Frame.this, main.stringaGiocatore + main.punteggio + main.stringaComputer + main.punteggioCPU, titolo, JOptionPane.PLAIN_MESSAGE ); | ||
| 70 | } | ||
| 71 | } | ||
| 72 | } ); | ||
| 73 | barraMenu = new JMenuBar(); | ||
| 74 | file = new JMenu( "File" ); | ||
| 75 | nuovaPartita = new JMenuItem( main.stringaNuovaPartita ); | ||
| 76 | nuovaPartita.addActionListener( new ActionListener() { | ||
| 77 | public void actionPerformed( ActionEvent e ) { | ||
| 78 | if ( main.mano == 20 ) { | ||
| 79 | main.mischia(); | ||
| 80 | pannello.repaint(); | ||
| 81 | repaint(); | ||
| 82 | } | ||
| 83 | else { | ||
| 84 | int selezione = JOptionPane.showOptionDialog( Frame.this, main.stringaVuoiDavveroIniziare, "JBriscola 0.1", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, new String[] { main.stringaSi, main.stringaNo }, main.stringaNo ); | ||
| 85 | if ( selezione == JOptionPane.YES_OPTION ) { | ||
| 86 | main.mischia(); | ||
| 87 | pannello.repaint(); | ||
| 88 | repaint(); | ||
| 89 | } | ||
| 90 | } | ||
| 91 | } | ||
| 92 | }); | ||
| 93 | opzioni = new JMenuItem( main.stringaOpzioni ); | ||
| 94 | opzioni.addActionListener( new ActionListener() { | ||
| 95 | public void actionPerformed( ActionEvent e ) { | ||
| 96 | OptionFrame optionFrame = new OptionFrame(); | ||
| 97 | optionFrame.setDefaultCloseOperation( JFrame.DISPOSE_ON_CLOSE ); | ||
| 98 | optionFrame.setResizable( false ); | ||
| 99 | optionFrame.setAlwaysOnTop( true ); | ||
| 100 | optionFrame.setSize( 300, 150 ); | ||
| 101 | optionFrame.setLocation( (Toolkit.getDefaultToolkit().getScreenSize().width - 300) / 2, | ||
| 102 | (Toolkit.getDefaultToolkit().getScreenSize().height - 150) / 2); | ||
| 103 | optionFrame.setVisible( true ); | ||
| 104 | } | ||
| 105 | }); | ||
| 106 | esci = new JMenuItem( main.stringaEsci ); | ||
| 107 | esci.addActionListener( new ActionListener() { | ||
| 108 | public void actionPerformed( ActionEvent e ) { | ||
| 109 | int selezione = JOptionPane.showOptionDialog( Frame.this, main.stringaVuoiDavveroUscire, "JBriscola 0.1", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, new String[] { main.stringaSi, main.stringaNo }, main.stringaNo ); | ||
| 110 | if ( selezione == JOptionPane.YES_OPTION ) | ||
| 111 | Frame.this.dispose(); | ||
| 112 | } | ||
| 113 | }); | ||
| 114 | file.add( nuovaPartita ); | ||
| 115 | file.add( opzioni ); | ||
| 116 | file.addSeparator(); | ||
| 117 | file.add( esci ); | ||
| 118 | barraMenu.add( file ); | ||
| 119 | setJMenuBar( barraMenu ); | ||
| 120 | retro1 = new ImageIcon( ClassLoader.getSystemResource( "img/retro1.jpg" ) ); | ||
| 121 | retro2 = new ImageIcon( ClassLoader.getSystemResource( "img/retro2.jpg" ) ); | ||
| 122 | for (int i = 0; i < 10; i++) | ||
| 123 | for (int j = 0; j < 4; j++) | ||
| 124 | arrayCarte[i][j] = new ImageIcon( ClassLoader.getSystemResource( "img/" + (i+1) + "-" + (j+1) + ".jpg" ) ); | ||
| 125 | main.mischia(); | ||
| 126 | setLayout( new BorderLayout() ); | ||
| 127 | add( pannello, BorderLayout.CENTER ); | ||
| 128 | add( button, BorderLayout.SOUTH ); | ||
| 129 | addMouseListener( | ||
| 130 | new MouseAdapter() { | ||
| 131 | public void mouseClicked ( MouseEvent e ) { | ||
| 132 | if ( mettiCarta( e.getX(), e.getY() ) ) { | ||
| 133 | if ( !main.CPUHaGiocato ) | ||
| 134 | main.giocaCPU(); | ||
| 135 | } | ||
| 136 | } | ||
| 137 | } | ||
| 138 | ); | ||
| 139 | addWindowListener( | ||
| 140 | new WindowAdapter() { | ||
| 141 | public void windowClosing( WindowEvent e ) { | ||
| 142 | int selezione = JOptionPane.showOptionDialog( Frame.this, main.stringaVuoiDavveroUscire, "JBriscola 0.1", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, new String[] { main.stringaSi, main.stringaNo }, main.stringaNo ); | ||
| 143 | if ( selezione == JOptionPane.YES_OPTION ) | ||
| 144 | System.exit( 0 ); | ||
| 145 | } | ||
| 146 | } | ||
| 147 | ); | ||
| 148 | } | ||
| 149 | public boolean mettiCarta( int x, int y ) { | ||
| 150 | if ( !main.toccaAllaCPU && giocata[0] == null ) { | ||
| 151 | if ( x > 230 && x < 290 && y > 340 && y < 566 ) { | ||
| 152 | giocata[0] = carteInMano[0]; | ||
| 153 | carteInMano[0] = null; | ||
| 154 | pannello.repaint(); | ||
| 155 | return true; | ||
| 156 | } | ||
| 157 | if ( x > 300 && x < 360 && y > 340 && y < 566 ) { | ||
| 158 | giocata[0] = carteInMano[1]; | ||
| 159 | carteInMano[1] = null; | ||
| 160 | pannello.repaint(); | ||
| 161 | return true; | ||
| 162 | } | ||
| 163 | if ( x > 370 && x < 430 && y > 340 && y < 566 ) { | ||
| 164 | giocata[0] = carteInMano[2]; | ||
| 165 | carteInMano[2] = null; | ||
| 166 | pannello.repaint(); | ||
| 167 | return true; | ||
| 168 | } | ||
| 169 | } | ||
| 170 | return false; | ||
| 171 | } | ||
| 172 | } | ||
| 173 | |||
| 174 | |||
diff --git a/JBriscola/all_versions/0.1/0.1 Beta 2/src/Main.java b/JBriscola/all_versions/0.1/0.1 Beta 2/src/Main.java new file mode 100755 index 0000000..2a3191b --- /dev/null +++ b/JBriscola/all_versions/0.1/0.1 Beta 2/src/Main.java | |||
| @@ -0,0 +1,492 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2009 Sebastiano Tronto <sebastiano@luganega.org> | ||
| 3 | |||
| 4 | This file is part of JBriscola. | ||
| 5 | |||
| 6 | JBriscola is free software; you can redistribute it and/or modify | ||
| 7 | it under the terms of the GNU General Public License as published by | ||
| 8 | the Free Software Foundation; either version 2 of the License, or | ||
| 9 | (at your option) any later version. | ||
| 10 | |||
| 11 | JBriscola is distributed in the hope that it will be useful, | ||
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | GNU General Public License for more details. | ||
| 15 | |||
| 16 | You should have received a copy of the GNU General Public License | ||
| 17 | along with JBriscola; if not, write to the Free Software | ||
| 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 19 | |||
| 20 | */ | ||
| 21 | |||
| 22 | import java.io.*; | ||
| 23 | import java.util.*; | ||
| 24 | import javax.swing.*; | ||
| 25 | import java.awt.*; | ||
| 26 | |||
| 27 | public class Main { | ||
| 28 | public static int semeBriscola, punteggio, punteggioCPU, mano, cartaDaPescare, cartaDaGiocare; | ||
| 29 | public static boolean toccaAllaCPU = false; | ||
| 30 | public static boolean CPUHaGiocato = false; | ||
| 31 | public static boolean haGiocatoPrima = true; | ||
| 32 | public static Frame frame; | ||
| 33 | public static String stringaBottonePrendi = "Prendi/Lascia carte"; | ||
| 34 | public static String stringaPrimaGioca = "Prima Gioca!"; | ||
| 35 | public static String stringaUltime4 = "Ultime 4 mani - Occhio alla briscola!"; | ||
| 36 | public static String stringaVinto = "Hai Vinto!"; | ||
| 37 | public static String stringaPerso = "Hai Perso"; | ||
| 38 | public static String stringaPareggio = "Pareggio"; | ||
| 39 | public static String stringaGiocatore = "Giocatore"; | ||
| 40 | public static String stringaComputer = "\nComputer"; | ||
| 41 | public static String stringaNuovaPartita = "Nuova Partita"; | ||
| 42 | public static String stringaVuoiDavveroIniziare = "Vuoi davvero iniziare una nuova partita?"; | ||
| 43 | public static String stringaVuoiDavveroUscire = "Vuoi davvero uscire?"; | ||
| 44 | public static String stringaSi = "Si"; | ||
| 45 | public static String stringaNo = "No"; | ||
| 46 | public static String stringaOpzioni = "Opzioni..."; | ||
| 47 | public static String stringaEsci = "Esci"; | ||
| 48 | public static String stringaImpossibileConfigurare = "Impossibile modificare il file di configurazione.\nSegnalare il bug a: sebastiano@luganega.org\n\nEccezione:\n"; | ||
| 49 | public static String stringaLingua = "Lingua"; | ||
| 50 | public static String stringaAnnulla = "Annulla"; | ||
| 51 | public static String stringaIt = "Italiano"; | ||
| 52 | public static String stringaLa = "Latino"; | ||
| 53 | public static String stringaNecessarioRiavviare = "E' necessario riavviare JBriscola se sono state\nmodificate impostazioni riguardanti la lingua.\nAlcune parti saranno comunque tradotte prima."; | ||
| 54 | public static String stringaModificaOpzioni = "Modifica Opzioni"; | ||
| 55 | public static void main( String args[] ) { | ||
| 56 | settaOpzioni(); | ||
| 57 | frame = new Frame(); | ||
| 58 | frame.setDefaultCloseOperation( JFrame.DO_NOTHING_ON_CLOSE ); | ||
| 59 | frame.setResizable( false ); | ||
| 60 | frame.setSize( 600, 600 ); | ||
| 61 | frame.setLocation( (Toolkit.getDefaultToolkit().getScreenSize().width - 600) / 2, | ||
| 62 | (Toolkit.getDefaultToolkit().getScreenSize().height - 600) / 2); | ||
| 63 | |||
| 64 | frame.setVisible( true ); | ||
| 65 | } | ||
| 66 | public void mischia() { | ||
| 67 | mano = 0; | ||
| 68 | punteggio = 0; | ||
| 69 | punteggioCPU = 0; | ||
| 70 | cartaDaPescare = 6; | ||
| 71 | ImageIcon aux; | ||
| 72 | frame.mazzo = true; | ||
| 73 | toccaAllaCPU = false; | ||
| 74 | CPUHaGiocato = false; | ||
| 75 | haGiocatoPrima = true; | ||
| 76 | for ( int i = 0, k = 0; i < 10; i++ ) | ||
| 77 | for ( int j = 0; j < 4; j++, k++ ) | ||
| 78 | frame.arrayCarteMescolate[k] = frame.arrayCarte[i][j]; | ||
| 79 | for ( int i = 0; i < 391; i++ ) { | ||
| 80 | double a = Math.random() * 40; | ||
| 81 | int x = (int) a; | ||
| 82 | double b = Math.random() * 40; | ||
| 83 | int y = (int) b; | ||
| 84 | aux = frame.arrayCarteMescolate[x]; | ||
| 85 | frame.arrayCarteMescolate[x] = frame.arrayCarteMescolate[y]; | ||
| 86 | frame.arrayCarteMescolate[y] = aux; | ||
| 87 | } | ||
| 88 | char auxChar[] = frame.arrayCarteMescolate[39].toString().toCharArray(); | ||
| 89 | semeBriscola = auxChar[auxChar.length-5] - 49; | ||
| 90 | frame.carteInMano[0] = frame.arrayCarteMescolate[0]; | ||
| 91 | frame.carteInMano[1] = frame.arrayCarteMescolate[1]; | ||
| 92 | frame.carteInMano[2] = frame.arrayCarteMescolate[2]; | ||
| 93 | frame.carteCPU[0] = frame.arrayCarteMescolate[3]; | ||
| 94 | frame.carteCPU[1] = frame.arrayCarteMescolate[4]; | ||
| 95 | frame.carteCPU[2] = frame.arrayCarteMescolate[5]; | ||
| 96 | frame.ultimaCarta = frame.arrayCarteMescolate[39]; | ||
| 97 | frame.giocata[0] = null; | ||
| 98 | frame.giocata[1] = null; | ||
| 99 | } | ||
| 100 | public void giocaCPU() { | ||
| 101 | if ( frame.giocata[0] == null ) { | ||
| 102 | if ( vaiLiscio() ); | ||
| 103 | else if ( vaiPunti() ); | ||
| 104 | else if ( vaiBriscola() ); | ||
| 105 | else if ( vaiCarico() ); | ||
| 106 | else; | ||
| 107 | } | ||
| 108 | else { | ||
| 109 | if ( haLisciato() || haMessoPunti() ) { | ||
| 110 | if ( vaiSopra() ); | ||
| 111 | else if ( vaiLiscio() ); | ||
| 112 | else if ( vaiPunti() ); | ||
| 113 | else if ( vaiBriscola() ); | ||
| 114 | else if ( vaiCarico() ); | ||
| 115 | else System.out.println("Ha lisciato e non so cosa fare"); | ||
| 116 | } else if ( haMessoBriscola() ) { | ||
| 117 | if ( vaiLiscio() ); | ||
| 118 | else if ( vaiPunti() ); | ||
| 119 | else if ( vaiBriscola() ); | ||
| 120 | else if ( vaiCarico() ); | ||
| 121 | else System.out.println("Ha messo una briscola e non so cosa fare"); | ||
| 122 | } else if ( haCaricato() ) { | ||
| 123 | if ( vaiSopra() ); | ||
| 124 | else if ( vaiBriscola() ); | ||
| 125 | else if ( vaiLiscio() ); | ||
| 126 | else if ( vaiPunti() ); | ||
| 127 | else if ( vaiCarico() ); | ||
| 128 | else System.out.println("Ha caricato e non so cosa fare"); | ||
| 129 | } else System.out.println("Non so cosa ha fatto"); | ||
| 130 | } | ||
| 131 | frame.giocata[1] = frame.carteCPU[cartaDaGiocare]; | ||
| 132 | frame.carteCPU[cartaDaGiocare] = null; | ||
| 133 | frame.pannello.repaint(); | ||
| 134 | CPUHaGiocato = true; | ||
| 135 | if ( frame.giocata[0] == null ) | ||
| 136 | toccaAllaCPU = false; | ||
| 137 | } | ||
| 138 | public void chiPrende() { | ||
| 139 | char aux[], auxCPU[]; | ||
| 140 | aux = frame.giocata[0].toString().toCharArray(); | ||
| 141 | auxCPU = frame.giocata[1].toString().toCharArray(); | ||
| 142 | giocatorePrende( ( (aux[aux.length-5] - 49 == semeBriscola) && (auxCPU[auxCPU.length-5] - 49 != semeBriscola) ) | ||
| 143 | || ( (aux[aux.length-5] == auxCPU[auxCPU.length-5]) && laPrimaEPiuAlta( aux[aux.length-7] - 48, auxCPU[auxCPU.length-7] - 48 ) ) | ||
| 144 | || ( (auxCPU[auxCPU.length-5] - 49 != semeBriscola) && (aux[aux.length-5] != auxCPU[auxCPU.length-5]) && haGiocatoPrima ) ); | ||
| 145 | } | ||
| 146 | public boolean laPrimaEPiuAlta( int prima, int seconda ) { | ||
| 147 | int a, b; | ||
| 148 | switch ( prima ) { | ||
| 149 | case 0: | ||
| 150 | a = 10; | ||
| 151 | break; | ||
| 152 | case 1: | ||
| 153 | a = 12; | ||
| 154 | break; | ||
| 155 | case 3: | ||
| 156 | a = 11; | ||
| 157 | break; | ||
| 158 | default: | ||
| 159 | a = prima; | ||
| 160 | break; | ||
| 161 | } | ||
| 162 | switch ( seconda ) { | ||
| 163 | case 0: | ||
| 164 | b = 10; | ||
| 165 | break; | ||
| 166 | case 1: | ||
| 167 | b = 12; | ||
| 168 | break; | ||
| 169 | case 3: | ||
| 170 | b = 11; | ||
| 171 | break; | ||
| 172 | default: | ||
| 173 | b = seconda; | ||
| 174 | break; | ||
| 175 | } | ||
| 176 | return a > b; | ||
| 177 | } | ||
| 178 | public void giocatorePrende( boolean giocatore ) { | ||
| 179 | if ( giocatore ) { | ||
| 180 | toccaAllaCPU = CPUHaGiocato = false; | ||
| 181 | haGiocatoPrima = true; | ||
| 182 | } | ||
| 183 | else { | ||
| 184 | toccaAllaCPU = true; | ||
| 185 | CPUHaGiocato = haGiocatoPrima = false; | ||
| 186 | } | ||
| 187 | daiPunti( giocatore ); | ||
| 188 | if ( toccaAllaCPU ) | ||
| 189 | giocaCPU(); | ||
| 190 | } | ||
| 191 | public void daiPunti( boolean giocatore ) { | ||
| 192 | char aux[], auxCPU[]; | ||
| 193 | aux = frame.giocata[0].toString().toCharArray(); | ||
| 194 | auxCPU = frame.giocata[1].toString().toCharArray(); | ||
| 195 | int punti = 0; | ||
| 196 | switch( aux[aux.length-7] - 48 ) { | ||
| 197 | case 0: | ||
| 198 | punti += 4; | ||
| 199 | break; | ||
| 200 | case 1: | ||
| 201 | punti += 11; | ||
| 202 | break; | ||
| 203 | case 3: | ||
| 204 | punti += 10; | ||
| 205 | break; | ||
| 206 | case 8: | ||
| 207 | punti += 2; | ||
| 208 | break; | ||
| 209 | case 9: | ||
| 210 | punti += 3; | ||
| 211 | break; | ||
| 212 | default: | ||
| 213 | break; | ||
| 214 | } | ||
| 215 | switch( auxCPU[auxCPU.length-7] - 48 ) { | ||
| 216 | case 0: | ||
| 217 | punti += 4; | ||
| 218 | break; | ||
| 219 | case 1: | ||
| 220 | punti += 11; | ||
| 221 | break; | ||
| 222 | case 3: | ||
| 223 | punti += 10; | ||
| 224 | break; | ||
| 225 | case 8: | ||
| 226 | punti += 2; | ||
| 227 | break; | ||
| 228 | case 9: | ||
| 229 | punti += 3; | ||
| 230 | break; | ||
| 231 | default: | ||
| 232 | break; | ||
| 233 | } | ||
| 234 | frame.giocata[0] = frame.giocata[1] = null; | ||
| 235 | if ( giocatore ) { | ||
| 236 | punteggio += punti; | ||
| 237 | if ( mano < 18 ) { | ||
| 238 | if ( frame.carteInMano[0] == null ) | ||
| 239 | frame.carteInMano[0] = frame.arrayCarteMescolate[cartaDaPescare]; | ||
| 240 | if ( frame.carteInMano[1] == null ) | ||
| 241 | frame.carteInMano[1] = frame.arrayCarteMescolate[cartaDaPescare]; | ||
| 242 | if ( frame.carteInMano[2] == null ) | ||
| 243 | frame.carteInMano[2] = frame.arrayCarteMescolate[cartaDaPescare]; | ||
| 244 | cartaDaPescare++; | ||
| 245 | if ( frame.carteCPU[0] == null ) | ||
| 246 | frame.carteCPU[0] = frame.arrayCarteMescolate[cartaDaPescare]; | ||
| 247 | if ( frame.carteCPU[1] == null ) | ||
| 248 | frame.carteCPU[1] = frame.arrayCarteMescolate[cartaDaPescare]; | ||
| 249 | if ( frame.carteCPU[2] == null ) | ||
| 250 | frame.carteCPU[2] = frame.arrayCarteMescolate[cartaDaPescare]; | ||
| 251 | cartaDaPescare++; | ||
| 252 | } | ||
| 253 | } | ||
| 254 | else { | ||
| 255 | punteggioCPU += punti; | ||
| 256 | if ( mano < 18 ) { | ||
| 257 | if ( frame.carteCPU[0] == null ) | ||
| 258 | frame.carteCPU[0] = frame.arrayCarteMescolate[cartaDaPescare]; | ||
| 259 | if ( frame.carteCPU[1] == null ) | ||
| 260 | frame.carteCPU[1] = frame.arrayCarteMescolate[cartaDaPescare]; | ||
| 261 | if ( frame.carteCPU[2] == null ) | ||
| 262 | frame.carteCPU[2] = frame.arrayCarteMescolate[cartaDaPescare]; | ||
| 263 | cartaDaPescare++; | ||
| 264 | if ( frame.carteInMano[0] == null ) | ||
| 265 | frame.carteInMano[0] = frame.arrayCarteMescolate[cartaDaPescare]; | ||
| 266 | if ( frame.carteInMano[1] == null ) | ||
| 267 | frame.carteInMano[1] = frame.arrayCarteMescolate[cartaDaPescare]; | ||
| 268 | if ( frame.carteInMano[2] == null ) | ||
| 269 | frame.carteInMano[2] = frame.arrayCarteMescolate[cartaDaPescare]; | ||
| 270 | cartaDaPescare++; | ||
| 271 | } | ||
| 272 | } | ||
| 273 | frame.pannello.repaint(); | ||
| 274 | frame.repaint(); | ||
| 275 | } | ||
| 276 | public boolean haLisciato() { | ||
| 277 | char auxCPU[]; | ||
| 278 | auxCPU = frame.giocata[0].toString().toCharArray(); | ||
| 279 | return ( (frame.giocata[0] != null) && (auxCPU[auxCPU.length-5] - 49 != semeBriscola) && | ||
| 280 | (auxCPU[auxCPU.length-7] - 48 != 0 ) && (auxCPU[auxCPU.length-7] - 48 != 1 ) && | ||
| 281 | (auxCPU[auxCPU.length-7] - 48 != 3 ) && (auxCPU[auxCPU.length-7] - 48 < 8 ) ); | ||
| 282 | } | ||
| 283 | public boolean haMessoPunti() { | ||
| 284 | char auxCPU[]; | ||
| 285 | auxCPU = frame.giocata[0].toString().toCharArray(); | ||
| 286 | return ( (frame.giocata[0] != null) && (auxCPU[auxCPU.length-5] - 49 != semeBriscola) && | ||
| 287 | ( (auxCPU[auxCPU.length-7] - 48 == 0 ) || (auxCPU[auxCPU.length-7] - 48 == 8 ) || | ||
| 288 | (auxCPU[auxCPU.length-7] - 48 == 9 ) ) ); | ||
| 289 | } | ||
| 290 | public boolean haMessoBriscola() { | ||
| 291 | char auxCPU[]; | ||
| 292 | auxCPU = frame.giocata[0].toString().toCharArray(); | ||
| 293 | return ( (frame.giocata[0] != null) && (auxCPU[auxCPU.length-5] - 49 == semeBriscola) ); | ||
| 294 | } | ||
| 295 | public boolean haCaricato() { | ||
| 296 | char auxCPU[]; | ||
| 297 | auxCPU = frame.giocata[0].toString().toCharArray(); | ||
| 298 | return ( (frame.giocata[0] != null) && (auxCPU[auxCPU.length-5] - 49 != semeBriscola) && | ||
| 299 | ( (auxCPU[auxCPU.length-7] - 48 == 1 ) || (auxCPU[auxCPU.length-7] - 48 == 3 ) ) ); | ||
| 300 | } | ||
| 301 | public boolean vaiLiscio() { | ||
| 302 | char auxCPU[]; | ||
| 303 | for ( int i = 0; i < 3; i++ ) { | ||
| 304 | if ( frame.carteCPU[i] != null ) { | ||
| 305 | auxCPU = frame.carteCPU[i].toString().toCharArray(); | ||
| 306 | if ( (auxCPU[auxCPU.length-5] - 49 != semeBriscola) && | ||
| 307 | (auxCPU[auxCPU.length-7] - 48 != 0 ) && (auxCPU[auxCPU.length-7] - 48 != 1 ) && | ||
| 308 | (auxCPU[auxCPU.length-7] - 48 != 3 ) && (auxCPU[auxCPU.length-7] - 48 < 8 ) ) { | ||
| 309 | cartaDaGiocare = i; | ||
| 310 | return true; | ||
| 311 | } | ||
| 312 | } | ||
| 313 | } | ||
| 314 | return false; | ||
| 315 | } | ||
| 316 | public boolean vaiPunti() { | ||
| 317 | char auxCPU[]; | ||
| 318 | for ( int i = 0; i < 3; i++ ) { | ||
| 319 | if ( frame.carteCPU[i] != null ) { | ||
| 320 | auxCPU = frame.carteCPU[i].toString().toCharArray(); | ||
| 321 | if ( (auxCPU[auxCPU.length-5] - 49 != semeBriscola) && | ||
| 322 | ( (auxCPU[auxCPU.length-7] - 48 == 0 ) || (auxCPU[auxCPU.length-7] - 48 == 8 ) || | ||
| 323 | (auxCPU[auxCPU.length-7] - 48 == 9 ) ) ) { | ||
| 324 | cartaDaGiocare = i; | ||
| 325 | return true; | ||
| 326 | } | ||
| 327 | } | ||
| 328 | } | ||
| 329 | return false; | ||
| 330 | } | ||
| 331 | public boolean vaiBriscola() { | ||
| 332 | char auxCPU[]; | ||
| 333 | for ( int i = 0; i < 3; i++ ) { | ||
| 334 | if ( frame.carteCPU[i] != null ) { | ||
| 335 | auxCPU = frame.carteCPU[i].toString().toCharArray(); | ||
| 336 | if ( auxCPU[auxCPU.length-5] - 49 == semeBriscola ) { | ||
| 337 | cartaDaGiocare = i; | ||
| 338 | return true; | ||
| 339 | } | ||
| 340 | } | ||
| 341 | } | ||
| 342 | return false; | ||
| 343 | } | ||
| 344 | public boolean vaiCarico() { | ||
| 345 | char auxCPU[]; | ||
| 346 | for ( int i = 0; i < 3; i++ ) { | ||
| 347 | if ( frame.carteCPU[i] != null ) { | ||
| 348 | auxCPU = frame.carteCPU[i].toString().toCharArray(); | ||
| 349 | if ( (auxCPU[auxCPU.length-5] - 49 != semeBriscola) && | ||
| 350 | ( (auxCPU[auxCPU.length-7] - 48 == 1 ) || (auxCPU[auxCPU.length-7] - 48 == 3 ) ) ) { | ||
| 351 | cartaDaGiocare = i; | ||
| 352 | return true; | ||
| 353 | } | ||
| 354 | } | ||
| 355 | } | ||
| 356 | return false; | ||
| 357 | } | ||
| 358 | public boolean vaiSopra() { | ||
| 359 | if ( frame.giocata[0] == null ) | ||
| 360 | return false; | ||
| 361 | int a = -1; | ||
| 362 | int b = -1; | ||
| 363 | int c = -1; | ||
| 364 | boolean laPrimaPuoAndareSopra = false; | ||
| 365 | boolean laSecondaPuoAndareSopra = false; | ||
| 366 | boolean laTerzaPuoAndareSopra = false; | ||
| 367 | char[] auxCPU1 = new char[1024]; | ||
| 368 | char[] auxCPU2 = new char[1024]; | ||
| 369 | char[] auxCPU3 = new char[1024]; | ||
| 370 | char[] aux = frame.giocata[0].toString().toCharArray(); | ||
| 371 | if ( aux[aux.length-7] - 48 == 1 ) | ||
| 372 | return false; | ||
| 373 | if ( frame.carteCPU[0] != null ) { | ||
| 374 | auxCPU1 = frame.carteCPU[0].toString().toCharArray(); | ||
| 375 | a = auxCPU1[auxCPU1.length-7] - 48; | ||
| 376 | } | ||
| 377 | if ( frame.carteCPU[1] != null ) { | ||
| 378 | auxCPU2 = frame.carteCPU[1].toString().toCharArray(); | ||
| 379 | b = auxCPU2[auxCPU2.length-7] - 48; | ||
| 380 | } | ||
| 381 | if ( frame.carteCPU[2] != null ) { | ||
| 382 | auxCPU3 = frame.carteCPU[2].toString().toCharArray(); | ||
| 383 | c = auxCPU3[auxCPU3.length-7] - 48; | ||
| 384 | } | ||
| 385 | if ( (auxCPU1[auxCPU1.length-5] - 49 == aux[aux.length-5] - 49) && laPrimaEPiuAlta( a, aux[aux.length-7] - 48 ) ) | ||
| 386 | laPrimaPuoAndareSopra = true; | ||
| 387 | if ( (auxCPU2[auxCPU2.length-5] - 49 == aux[aux.length-5] - 49) && laPrimaEPiuAlta( b, aux[aux.length-7] - 48 ) ) | ||
| 388 | laSecondaPuoAndareSopra = true; | ||
| 389 | if ( (auxCPU3[auxCPU3.length-5] - 49 == aux[aux.length-5] - 49) && laPrimaEPiuAlta( c, aux[aux.length-7] - 48 ) ) | ||
| 390 | laTerzaPuoAndareSopra = true; | ||
| 391 | if ( !laPrimaPuoAndareSopra && !laSecondaPuoAndareSopra && !laTerzaPuoAndareSopra ) | ||
| 392 | return false; | ||
| 393 | else if ( laPrimaPuoAndareSopra && !laSecondaPuoAndareSopra && !laTerzaPuoAndareSopra ) | ||
| 394 | cartaDaGiocare = 0; | ||
| 395 | else if ( !laPrimaPuoAndareSopra && laSecondaPuoAndareSopra && !laTerzaPuoAndareSopra ) | ||
| 396 | cartaDaGiocare = 1; | ||
| 397 | else if ( !laPrimaPuoAndareSopra && !laSecondaPuoAndareSopra && laTerzaPuoAndareSopra ) | ||
| 398 | cartaDaGiocare = 2; | ||
| 399 | else if ( laPrimaPuoAndareSopra && laSecondaPuoAndareSopra && !laTerzaPuoAndareSopra ) | ||
| 400 | if ( laPrimaEPiuAlta( a, b ) ) | ||
| 401 | cartaDaGiocare = 0; | ||
| 402 | else | ||
| 403 | cartaDaGiocare = 1; | ||
| 404 | else if ( !laPrimaPuoAndareSopra && laSecondaPuoAndareSopra && laTerzaPuoAndareSopra ) | ||
| 405 | if ( laPrimaEPiuAlta( b, c ) ) | ||
| 406 | cartaDaGiocare = 1; | ||
| 407 | else | ||
| 408 | cartaDaGiocare = 2; | ||
| 409 | else if ( laPrimaPuoAndareSopra && !laSecondaPuoAndareSopra && laTerzaPuoAndareSopra ) | ||
| 410 | if ( laPrimaEPiuAlta( a, c ) ) | ||
| 411 | cartaDaGiocare = 0; | ||
| 412 | else | ||
| 413 | cartaDaGiocare = 2; | ||
| 414 | else if ( laPrimaPuoAndareSopra && laSecondaPuoAndareSopra && laTerzaPuoAndareSopra ) | ||
| 415 | if ( laPrimaEPiuAlta( a, b ) ) | ||
| 416 | if ( laPrimaEPiuAlta( a, c ) ) | ||
| 417 | cartaDaGiocare = 0; | ||
| 418 | else | ||
| 419 | cartaDaGiocare = 2; | ||
| 420 | else | ||
| 421 | if ( laPrimaEPiuAlta( b, c ) ) | ||
| 422 | cartaDaGiocare = 1; | ||
| 423 | else | ||
| 424 | cartaDaGiocare = 2; | ||
| 425 | else cartaDaGiocare = 55; | ||
| 426 | return true; | ||
| 427 | } | ||
| 428 | public static void settaOpzioni() { | ||
| 429 | String lang; | ||
| 430 | Scanner scanner = null; | ||
| 431 | File file = new File( "JBriscolaConfig.txt" ); | ||
| 432 | if ( file.exists() ) { | ||
| 433 | try { | ||
| 434 | scanner = new Scanner( file ); | ||
| 435 | } catch ( FileNotFoundException e ) { | ||
| 436 | lang = "it"; | ||
| 437 | } | ||
| 438 | lang = scanner.next(); | ||
| 439 | } | ||
| 440 | else { | ||
| 441 | lang = "it"; | ||
| 442 | } | ||
| 443 | if ( lang.equals( "it" ) ) { | ||
| 444 | stringaBottonePrendi = "Prendi/Lascia carte"; | ||
| 445 | stringaPrimaGioca = "Prima Gioca!"; | ||
| 446 | stringaUltime4 = "Ultime 4 mani - Occhio alla briscola!"; | ||
| 447 | stringaVinto = "Hai Vinto!"; | ||
| 448 | stringaPerso = "Hai Perso"; | ||
| 449 | stringaPareggio = "Pareggio"; | ||
| 450 | stringaGiocatore = "Giocatore"; | ||
| 451 | stringaComputer = "\nComputer"; | ||
| 452 | stringaNuovaPartita = "Nuova Partita"; | ||
| 453 | stringaVuoiDavveroIniziare = "Vuoi davvero iniziare una nuova partita?"; | ||
| 454 | stringaVuoiDavveroUscire = "Vuoi davvero dscire?"; | ||
| 455 | stringaSi = "Si"; | ||
| 456 | stringaNo = "No"; | ||
| 457 | stringaOpzioni = "Opzioni..."; | ||
| 458 | stringaEsci = "Esci"; | ||
| 459 | stringaImpossibileConfigurare = "Impossibile modificare il file di configurazione.\nSegnalare il bug a: sebastiano@luganega.org\n\nEccezione:\n"; | ||
| 460 | stringaLingua = "Lingua"; | ||
| 461 | stringaAnnulla = "Annulla"; | ||
| 462 | stringaIt = "Italiano"; | ||
| 463 | stringaLa = "Latino"; | ||
| 464 | stringaNecessarioRiavviare = "E' necessario riavviare JBriscola se sono state\nmodificate impostazioni riguardanti la lingua\nAlcune parti saranno comunque tradotte prima."; | ||
| 465 | stringaModificaOpzioni = "Modifica Opzioni"; | ||
| 466 | } | ||
| 467 | else if ( lang.equals( "la" ) ) { | ||
| 468 | stringaBottonePrendi = "CAPIS/RELINQVIS CHARTAS"; | ||
| 469 | stringaPrimaGioca = "ANTE CHARTAM PONE!"; | ||
| 470 | stringaUltime4 = "IV MANVS POSTREMAS - INTVERE BRISCOLAM!"; | ||
| 471 | stringaVinto = "VINXISTI!"; | ||
| 472 | stringaPerso = "PERDIDISTI"; | ||
| 473 | stringaPareggio = "AEQVATIO!"; | ||
| 474 | stringaGiocatore = "LVSOR: "; | ||
| 475 | stringaComputer = "\nCOMPVTER: "; | ||
| 476 | stringaNuovaPartita = "NOVA LVSO"; | ||
| 477 | stringaVuoiDavveroIniziare = "NOVAM LVSIONEM INCIPERE?"; | ||
| 478 | stringaVuoiDavveroUscire = "EXIRE?"; | ||
| 479 | stringaSi = "ID VOLO"; | ||
| 480 | stringaNo = "NOLO"; | ||
| 481 | stringaOpzioni = "OPTIONES..."; | ||
| 482 | stringaEsci = "EXIRE"; | ||
| 483 | stringaImpossibileConfigurare = "CONFIGVRATIONIS FILE SCRIBERE NON POTVI.\nERROREM ME CERTIOREM FACITE: sebastiano@luganega.org\n\nEXCEPTIO:\n"; | ||
| 484 | stringaLingua = "LINGVA"; | ||
| 485 | stringaAnnulla = "ABROGA"; | ||
| 486 | stringaIt = "ITALICE"; | ||
| 487 | stringaLa = "LATINE"; | ||
| 488 | stringaNecessarioRiavviare = "JBRISCOLAM RVRSVS INCIPERE NECESSE EST\nSI LINGVA PRAELATIONES NOVATAE SUNT.\nALIQVAE ANTE ID VERSA ERVNT"; | ||
| 489 | stringaModificaOpzioni = "OPTIONES NOVARE"; | ||
| 490 | } | ||
| 491 | } | ||
| 492 | } | ||
diff --git a/JBriscola/all_versions/0.1/0.1 Beta 2/src/OptionFrame.java b/JBriscola/all_versions/0.1/0.1 Beta 2/src/OptionFrame.java new file mode 100755 index 0000000..de6734b --- /dev/null +++ b/JBriscola/all_versions/0.1/0.1 Beta 2/src/OptionFrame.java | |||
| @@ -0,0 +1,83 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2009 Sebastiano Tronto <sebastiano@luganega.org> | ||
| 3 | |||
| 4 | This file is part of JBriscola. | ||
| 5 | |||
| 6 | JBriscola is free software; you can redistribute it and/or modify | ||
| 7 | it under the terms of the GNU General Public License as published by | ||
| 8 | the Free Software Foundation; either version 2 of the License, or | ||
| 9 | (at your option) any later version. | ||
| 10 | |||
| 11 | JBriscola is distributed in the hope that it will be useful, | ||
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | GNU General Public License for more details. | ||
| 15 | |||
| 16 | You should have received a copy of the GNU General Public License | ||
| 17 | along with JBriscola; if not, write to the Free Software | ||
| 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 19 | |||
| 20 | */ | ||
| 21 | |||
| 22 | import java.util.Formatter; | ||
| 23 | import javax.swing.*; | ||
| 24 | import java.awt.*; | ||
| 25 | import java.awt.event.*; | ||
| 26 | |||
| 27 | public class OptionFrame extends JFrame { | ||
| 28 | public static Main main = new Main(); | ||
| 29 | public static Formatter formatter; | ||
| 30 | public static JButton ok, annulla; | ||
| 31 | public static JLabel lingua; | ||
| 32 | public static JComboBox selezionaLingua; | ||
| 33 | public static JPanel pannello1, pannello2; | ||
| 34 | public OptionFrame() { | ||
| 35 | super( "JBriscola - " + main.stringaModificaOpzioni ); | ||
| 36 | ok = new JButton( "OK" ); | ||
| 37 | ok.addActionListener( new ActionListener() { | ||
| 38 | public void actionPerformed( ActionEvent e ) { | ||
| 39 | try { | ||
| 40 | formatter = new Formatter( "JBriscolaConfig.txt" ); | ||
| 41 | } catch ( Exception ex ) { | ||
| 42 | JOptionPane.showMessageDialog( OptionFrame.this, main.stringaImpossibileConfigurare + ex ); | ||
| 43 | } | ||
| 44 | String lang; | ||
| 45 | switch ( selezionaLingua.getSelectedIndex() ) { | ||
| 46 | case 0: | ||
| 47 | lang = "it"; | ||
| 48 | break; | ||
| 49 | case 1: | ||
| 50 | lang = "la"; | ||
| 51 | break; | ||
| 52 | default: | ||
| 53 | lang = "it"; | ||
| 54 | break; | ||
| 55 | } | ||
| 56 | formatter.format( lang ); | ||
| 57 | formatter.close(); | ||
| 58 | main.settaOpzioni(); | ||
| 59 | main.frame.pannello.repaint(); | ||
| 60 | main.frame.repaint(); | ||
| 61 | OptionFrame.this.dispose(); | ||
| 62 | JOptionPane.showMessageDialog( OptionFrame.this, main.stringaNecessarioRiavviare, "JBriscola 0.1", JOptionPane.INFORMATION_MESSAGE ); | ||
| 63 | } | ||
| 64 | }); | ||
| 65 | annulla = new JButton( main.stringaAnnulla ); | ||
| 66 | annulla.addActionListener( new ActionListener() { | ||
| 67 | public void actionPerformed( ActionEvent e ) { | ||
| 68 | OptionFrame.this.dispose(); | ||
| 69 | } | ||
| 70 | }); | ||
| 71 | lingua = new JLabel( main.stringaLingua ); | ||
| 72 | String[] lingueDaSelezionare = { main.stringaIt, main.stringaLa }; | ||
| 73 | selezionaLingua = new JComboBox( lingueDaSelezionare ); | ||
| 74 | pannello1 = new JPanel( new FlowLayout() ); | ||
| 75 | pannello1.add( lingua ); | ||
| 76 | pannello1.add( selezionaLingua ); | ||
| 77 | pannello2 = new JPanel( new FlowLayout() ); | ||
| 78 | pannello2.add( ok ); | ||
| 79 | pannello2.add( annulla ); | ||
| 80 | add( pannello1, BorderLayout.CENTER ); | ||
| 81 | add( pannello2, BorderLayout.SOUTH ); | ||
| 82 | } | ||
| 83 | } | ||
diff --git a/JBriscola/all_versions/0.1/0.1 Beta 2/src/Pannello.java b/JBriscola/all_versions/0.1/0.1 Beta 2/src/Pannello.java new file mode 100755 index 0000000..9e73356 --- /dev/null +++ b/JBriscola/all_versions/0.1/0.1 Beta 2/src/Pannello.java | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2009 Sebastiano Tronto <sebastiano@luganega.org> | ||
| 3 | |||
| 4 | This file is part of JBriscola. | ||
| 5 | |||
| 6 | JBriscola is free software; you can redistribute it and/or modify | ||
| 7 | it under the terms of the GNU General Public License as published by | ||
| 8 | the Free Software Foundation; either version 2 of the License, or | ||
| 9 | (at your option) any later version. | ||
| 10 | |||
| 11 | JBriscola is distributed in the hope that it will be useful, | ||
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | GNU General Public License for more details. | ||
| 15 | |||
| 16 | You should have received a copy of the GNU General Public License | ||
| 17 | along with JBriscola; if not, write to the Free Software | ||
| 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 19 | |||
| 20 | */ | ||
| 21 | |||
| 22 | import javax.swing.*; | ||
| 23 | import java.awt.Graphics; | ||
| 24 | |||
| 25 | public class Pannello extends JPanel { | ||
| 26 | public static Main main; | ||
| 27 | public Pannello() { | ||
| 28 | } | ||
| 29 | public void paint( Graphics g ) { | ||
| 30 | super.paint( g ); | ||
| 31 | if ( main.frame.ultimaCarta != null ) | ||
| 32 | main.frame.ultimaCarta.paintIcon( this, g, 50, 180 ); | ||
| 33 | if ( main.frame.mazzo ) | ||
| 34 | main.frame.retro2.paintIcon( this, g, 17, 256 ); | ||
| 35 | if ( main.frame.carteCPU[0] != null ) | ||
| 36 | main.frame.retro1.paintIcon( this, g, 230, 5 ); | ||
| 37 | if ( main.frame.carteCPU[1] != null ) | ||
| 38 | main.frame.retro1.paintIcon( this, g, 300, 5 ); | ||
| 39 | if ( main.frame.carteCPU[2] != null ) | ||
| 40 | main.frame.retro1.paintIcon( this, g, 370, 5 ); | ||
| 41 | if ( main.frame.carteInMano[0] != null ) | ||
| 42 | main.frame.carteInMano[0].paintIcon( this, g, 230, 340 ); | ||
| 43 | if ( main.frame.carteInMano[1] != null ) | ||
| 44 | main.frame.carteInMano[1].paintIcon( this, g, 300, 340 ); | ||
| 45 | if ( main.frame.carteInMano[2] != null ) | ||
| 46 | main.frame.carteInMano[2].paintIcon( this, g, 370, 340 ); | ||
| 47 | if ( main.frame.giocata[0] != null ) | ||
| 48 | main.frame.giocata[0].paintIcon( this, g, 250, 200 ); | ||
| 49 | if ( main.frame.giocata[1] != null ) | ||
| 50 | main.frame.giocata[1].paintIcon( this, g, 325, 150 ); | ||
| 51 | } | ||
| 52 | } | ||
| 53 | |||
