diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2026-03-26 19:27:18 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2026-03-26 19:27:18 +0100 |
| commit | 7167b4341ef290d56fb96e2af10883a4b925d83b (patch) | |
| tree | 1eb1b9e5ab82ddd89540e68d6b22ae69514575c6 /JBriscola/all_versions/0.3/0.3.2 | |
| download | ancient-projects-master.tar.gz ancient-projects-master.zip | |
Diffstat (limited to 'JBriscola/all_versions/0.3/0.3.2')
50 files changed, 2983 insertions, 0 deletions
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/CartePassateFrame.java b/JBriscola/all_versions/0.3/0.3.2/src/CartePassateFrame.java new file mode 100755 index 0000000..c1d90ef --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/CartePassateFrame.java | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2009-2010 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 | |||
| 25 | public class CartePassateFrame extends JFrame { | ||
| 26 | |||
| 27 | public static Main main = new Main(); | ||
| 28 | public static PannelloCartePassate pannelloCP = new PannelloCartePassate(); | ||
| 29 | |||
| 30 | CartePassateFrame() { | ||
| 31 | super( "JBriscola - " + main.stringaCartePassate ); | ||
| 32 | pannelloCP.repaint(); | ||
| 33 | add( pannelloCP ); | ||
| 34 | } | ||
| 35 | |||
| 36 | } | ||
| 37 | |||
| 38 | |||
| 39 | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/Frame.java b/JBriscola/all_versions/0.3/0.3.2/src/Frame.java new file mode 100755 index 0000000..c211cab --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/Frame.java | |||
| @@ -0,0 +1,552 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2009-2010 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 javax.sound.sampled.*; | ||
| 24 | import java.io.*; | ||
| 25 | import java.net.*; | ||
| 26 | import java.awt.*; | ||
| 27 | import java.awt.event.*; | ||
| 28 | |||
| 29 | public class Frame extends JFrame { | ||
| 30 | |||
| 31 | /* Booleana per determinare se disegnare il mazzo di carte o no (se | ||
| 32 | * è l'ultima mano). */ | ||
| 33 | public static boolean mazzo; | ||
| 34 | |||
| 35 | public static Main main; | ||
| 36 | |||
| 37 | /* Menu, bottoni, pannelli e componenti vari. */ | ||
| 38 | public static Pannello pannello; | ||
| 39 | public static JPanel pannello2; | ||
| 40 | public static JButton button; | ||
| 41 | public static JMenuBar barraMenu; | ||
| 42 | public static JMenu file, puntoInterrogativo; | ||
| 43 | public static JMenuItem nuovaPartita, nuovaPartitaAiTrenta, opzioni, esci, informazioni, punti, cartePassate, aggiornamenti, trucchi, tastiRapidi, briscola; | ||
| 44 | |||
| 45 | /* Immagini delle carte. */ | ||
| 46 | public static ImageIcon retro1, retro2, ultimaCarta; | ||
| 47 | public static ImageIcon[] giocata = new ImageIcon[2]; | ||
| 48 | public static ImageIcon[] carteInMano = new ImageIcon[3]; | ||
| 49 | public static ImageIcon[] carteCPU = new ImageIcon[3]; | ||
| 50 | public static ImageIcon[] arrayCarteMescolate = new ImageIcon[40]; | ||
| 51 | public static ImageIcon[] arrayCartePassate = new ImageIcon[40]; | ||
| 52 | public static ImageIcon[][] arrayCarte = new ImageIcon[10][4]; | ||
| 53 | |||
| 54 | public Frame() { | ||
| 55 | |||
| 56 | super( "Tronto's JBriscola " + main.version ); | ||
| 57 | |||
| 58 | mazzo = true; | ||
| 59 | main = new Main(); | ||
| 60 | pannello = new Pannello(); | ||
| 61 | pannello2 = new JPanel( new FlowLayout() ); | ||
| 62 | |||
| 63 | button = new JButton( main.stringaBottonePrendi ); | ||
| 64 | button.addActionListener( new ActionListener() { | ||
| 65 | |||
| 66 | /* Quando viene premuto il bottone per prendere/lasciare le carte, | ||
| 67 | * valuta innanzitutto se il giocatore ha giocato, poi a chi | ||
| 68 | * darle ed eventualmente, se è finita la partita, a caricare | ||
| 69 | * il suono adatto. */ | ||
| 70 | public void actionPerformed( ActionEvent e ) { | ||
| 71 | |||
| 72 | arrayCartePassate[main.mano*2] = giocata[0]; | ||
| 73 | arrayCartePassate[main.mano*2+1] = giocata[1]; | ||
| 74 | |||
| 75 | if ( giocata[0] != null && giocata[1] != null ) | ||
| 76 | main.mano++; | ||
| 77 | |||
| 78 | try { | ||
| 79 | main.chiPrende(); | ||
| 80 | } catch ( Exception ex ) { | ||
| 81 | /* Avvisa di giocare una carta. */ | ||
| 82 | JOptionPane.showMessageDialog( Frame.this, main.stringaPrimaGioca, "JBriscola " + main.version, JOptionPane.WARNING_MESSAGE ); | ||
| 83 | } | ||
| 84 | |||
| 85 | /* Avvisa che si è arrivati alla quartultima mano. */ | ||
| 86 | if ( main.mano == 16 ) | ||
| 87 | JOptionPane.showMessageDialog( Frame.this, main.stringaUltime4, "JBriscola " + main.version, JOptionPane.INFORMATION_MESSAGE ); | ||
| 88 | |||
| 89 | /* Non disegna più la briscola e il mazzo se sono già state | ||
| 90 | * pescate tutte le carte. */ | ||
| 91 | if ( main.mano == 17 ) { | ||
| 92 | mazzo = false; | ||
| 93 | ultimaCarta = null; | ||
| 94 | pannello.repaint(); | ||
| 95 | Frame.this.repaint(); | ||
| 96 | } | ||
| 97 | |||
| 98 | /* Mostra il punteggio e carica i suoni se è finita la partita. */ | ||
| 99 | if ( main.mano == 20 || | ||
| 100 | ( main.aiTrenta && | ||
| 101 | ( ( main.punteggio >= 30 || main.punteggioCPU >= 30 ) ) ) ) { | ||
| 102 | |||
| 103 | String titolo = ""; | ||
| 104 | String suonoFinale = ""; | ||
| 105 | |||
| 106 | if ( main.punteggio > main.punteggioCPU ) { | ||
| 107 | titolo = main.stringaVinto; | ||
| 108 | suonoFinale = "sounds/perso.wav"; | ||
| 109 | } | ||
| 110 | if ( main.punteggio < main.punteggioCPU ) { | ||
| 111 | titolo = main.stringaPerso; | ||
| 112 | suonoFinale = "sounds/vinto.wav"; | ||
| 113 | } | ||
| 114 | if ( main.punteggio == main.punteggioCPU ) { | ||
| 115 | titolo = main.stringaPareggio; | ||
| 116 | suonoFinale = "sounds/pareggio.wav"; | ||
| 117 | } | ||
| 118 | |||
| 119 | if ( main.sound ) { | ||
| 120 | try { | ||
| 121 | AudioFileFormat aff = AudioSystem.getAudioFileFormat( ClassLoader.getSystemResource( suonoFinale ) ); | ||
| 122 | AudioInputStream ais = AudioSystem.getAudioInputStream( ClassLoader.getSystemResource( suonoFinale ) ); | ||
| 123 | AudioFormat af = aff.getFormat(); | ||
| 124 | DataLine.Info info = new DataLine.Info( Clip.class, ais.getFormat(), ( (int) ais.getFrameLength() * af.getFrameSize() ) ); | ||
| 125 | Clip ol = ( Clip ) AudioSystem.getLine( info ); | ||
| 126 | ol.open(ais); | ||
| 127 | ol.loop( 0 ); | ||
| 128 | } catch ( Exception ex ) { | ||
| 129 | System.err.println( e ); | ||
| 130 | } | ||
| 131 | } | ||
| 132 | |||
| 133 | JOptionPane.showMessageDialog( Frame.this, main.stringaGiocatore + main.punteggio + main.stringaComputer + main.punteggioCPU, titolo, JOptionPane.INFORMATION_MESSAGE ); | ||
| 134 | |||
| 135 | main.pulisciTavolo(); | ||
| 136 | |||
| 137 | } | ||
| 138 | if ( main.toccaAllaCPU ) | ||
| 139 | if ( main.aiTrenta ) | ||
| 140 | main.giocaCPUAiTrenta(); | ||
| 141 | else | ||
| 142 | main.giocaCPU(); | ||
| 143 | } | ||
| 144 | } ); | ||
| 145 | button.addKeyListener( new KeyAdapter() { | ||
| 146 | /* Aggiunge il keyListener per le scorciatoie da tastiera. Dato | ||
| 147 | * che il bottone prendi/lascia è l'unico componente effettivo | ||
| 148 | * della finestra, avrà obbligatoriamente il focus ed è necessario | ||
| 149 | * che sia lui a gestire gli eventi della tastiera. */ | ||
| 150 | public void keyReleased( KeyEvent key ) { | ||
| 151 | |||
| 152 | if ( main.keys ) { | ||
| 153 | switch ( key.getKeyCode() ) { | ||
| 154 | case KeyEvent.VK_1: | ||
| 155 | if ( mettiCarta( 231, 500 ) ) { | ||
| 156 | if ( !main.CPUHaGiocato ) | ||
| 157 | if ( main.aiTrenta ) | ||
| 158 | main.giocaCPUAiTrenta(); | ||
| 159 | else | ||
| 160 | main.giocaCPU(); | ||
| 161 | } | ||
| 162 | break; | ||
| 163 | |||
| 164 | case KeyEvent.VK_2: | ||
| 165 | if ( mettiCarta( 301, 500 ) ) { | ||
| 166 | if ( !main.CPUHaGiocato ) | ||
| 167 | if ( main.aiTrenta ) | ||
| 168 | main.giocaCPUAiTrenta(); | ||
| 169 | else | ||
| 170 | main.giocaCPU(); | ||
| 171 | } | ||
| 172 | break; | ||
| 173 | |||
| 174 | case KeyEvent.VK_3: | ||
| 175 | if ( mettiCarta( 371, 500 ) ) { | ||
| 176 | if ( !main.CPUHaGiocato ) | ||
| 177 | if ( main.aiTrenta ) | ||
| 178 | main.giocaCPUAiTrenta(); | ||
| 179 | else | ||
| 180 | main.giocaCPU(); | ||
| 181 | } | ||
| 182 | break; | ||
| 183 | |||
| 184 | case KeyEvent.VK_F1: | ||
| 185 | JOptionPane.showMessageDialog( Frame.this, main.stringaTasti2, "JBriscola - " + main.version, JOptionPane.INFORMATION_MESSAGE ); | ||
| 186 | break; | ||
| 187 | |||
| 188 | case KeyEvent.VK_F2: | ||
| 189 | if ( main.mano == 20 ) { | ||
| 190 | main.aiTrenta = false; | ||
| 191 | main.mischia(); | ||
| 192 | pannello.repaint(); | ||
| 193 | repaint(); | ||
| 194 | } | ||
| 195 | else { | ||
| 196 | int selezione = JOptionPane.showOptionDialog( Frame.this, main.stringaVuoiDavveroIniziare, "JBriscola " + main.version, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, new String[] { main.stringaSi, main.stringaNo }, main.stringaNo ); | ||
| 197 | if ( selezione == JOptionPane.YES_OPTION ) { | ||
| 198 | main.aiTrenta = false; | ||
| 199 | main.mischia(); | ||
| 200 | pannello.repaint(); | ||
| 201 | repaint(); | ||
| 202 | } | ||
| 203 | } | ||
| 204 | break; | ||
| 205 | |||
| 206 | case KeyEvent.VK_F3: | ||
| 207 | OptionFrame optionFrame = new OptionFrame(); | ||
| 208 | optionFrame.setDefaultCloseOperation( JFrame.DISPOSE_ON_CLOSE ); | ||
| 209 | optionFrame.setResizable( false ); | ||
| 210 | optionFrame.setAlwaysOnTop( true ); | ||
| 211 | optionFrame.setSize( 300, 200 ); | ||
| 212 | optionFrame.setLocation( (Toolkit.getDefaultToolkit().getScreenSize().width - 300) / 2, (Toolkit.getDefaultToolkit().getScreenSize().height - 150) / 2); | ||
| 213 | optionFrame.setVisible( true ); | ||
| 214 | break; | ||
| 215 | |||
| 216 | case KeyEvent.VK_F4: | ||
| 217 | JOptionPane.showMessageDialog( Frame.this, main.stringaGiocatore + main.punteggio + main.stringaComputer + main.punteggioCPU, main.stringaPunteggio, JOptionPane.INFORMATION_MESSAGE ); | ||
| 218 | break; | ||
| 219 | |||
| 220 | case KeyEvent.VK_F5: | ||
| 221 | CartePassateFrame cartePassateFrame = new CartePassateFrame(); | ||
| 222 | cartePassateFrame.setDefaultCloseOperation( JFrame.DISPOSE_ON_CLOSE ); | ||
| 223 | cartePassateFrame.setResizable( false ); | ||
| 224 | cartePassateFrame.setAlwaysOnTop( true ); | ||
| 225 | cartePassateFrame.setSize( 700, 560 ); | ||
| 226 | cartePassateFrame.setLocation( (Toolkit.getDefaultToolkit().getScreenSize().width - 700) / 2, (Toolkit.getDefaultToolkit().getScreenSize().height - 560) / 2); | ||
| 227 | cartePassateFrame.setVisible( true ); | ||
| 228 | break; | ||
| 229 | |||
| 230 | case KeyEvent.VK_F6: | ||
| 231 | JOptionPane.showMessageDialog( Frame.this, main.stringaInformazioni2, main.stringaInformazioni, JOptionPane.PLAIN_MESSAGE ); | ||
| 232 | break; | ||
| 233 | |||
| 234 | case KeyEvent.VK_F7: | ||
| 235 | String latest = main.version; | ||
| 236 | try { | ||
| 237 | URL latestIs = new URL( "http://porkynator.altervista.org/jbriscola-latest.is" ); | ||
| 238 | BufferedReader latestIsReader = new BufferedReader( new InputStreamReader( latestIs.openStream() ) ); | ||
| 239 | latest = latestIsReader.readLine(); | ||
| 240 | } catch ( Exception ex ) { | ||
| 241 | JOptionPane.showMessageDialog( Frame.this, main.stringaNoInternet, "JBriscola - " + main.version, JOptionPane.ERROR_MESSAGE ); | ||
| 242 | } | ||
| 243 | if ( latest.equals( main.version ) ) | ||
| 244 | JOptionPane.showMessageDialog( Frame.this, main.stringaAggiornamentiNo, "JBriscola - " + main.version, JOptionPane.INFORMATION_MESSAGE ); | ||
| 245 | else | ||
| 246 | JOptionPane.showMessageDialog( Frame.this, main.stringaAggiornamentiSi + "\n" + main.version + " ==> " + latest + "\n\n" + main.stringaScarica, "JBriscola - " + main.version, JOptionPane.INFORMATION_MESSAGE ); | ||
| 247 | break; | ||
| 248 | |||
| 249 | case KeyEvent.VK_F8: | ||
| 250 | if ( main.mano == 20 ) { | ||
| 251 | main.aiTrenta = true; | ||
| 252 | main.mischia(); | ||
| 253 | pannello.repaint(); | ||
| 254 | repaint(); | ||
| 255 | } | ||
| 256 | else { | ||
| 257 | int selezione = JOptionPane.showOptionDialog( Frame.this, main.stringaVuoiDavveroIniziare, "JBriscola " + main.version, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, new String[] { main.stringaSi, main.stringaNo }, main.stringaNo ); | ||
| 258 | if ( selezione == JOptionPane.YES_OPTION ) { | ||
| 259 | main.aiTrenta = true; | ||
| 260 | main.mischia(); | ||
| 261 | pannello.repaint(); | ||
| 262 | repaint(); | ||
| 263 | } | ||
| 264 | } | ||
| 265 | break; | ||
| 266 | |||
| 267 | case KeyEvent.VK_F9: | ||
| 268 | main.trucco( JOptionPane.showInputDialog( Frame.this, main.stringaInserisciCodice, "JBriscola - " + main.version, JOptionPane.PLAIN_MESSAGE ) ); | ||
| 269 | break; | ||
| 270 | |||
| 271 | case KeyEvent.VK_Q: | ||
| 272 | int selezione = JOptionPane.showOptionDialog( Frame.this, main.stringaVuoiDavveroUscire, "JBriscola " + main.version, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, new String[] { main.stringaSi, main.stringaNo }, main.stringaNo ); | ||
| 273 | if ( selezione == JOptionPane.YES_OPTION ) | ||
| 274 | Frame.this.dispose(); | ||
| 275 | break; | ||
| 276 | } | ||
| 277 | } | ||
| 278 | } | ||
| 279 | } ); | ||
| 280 | |||
| 281 | barraMenu = new JMenuBar(); | ||
| 282 | |||
| 283 | file = new JMenu( "File" ); | ||
| 284 | |||
| 285 | nuovaPartita = new JMenuItem( main.stringaNuovaPartita ); | ||
| 286 | nuovaPartita.addActionListener( new ActionListener() { | ||
| 287 | /* Avvia una nuova partita, chiedendo prima conferma se ce n'è | ||
| 288 | * già una in corso. */ | ||
| 289 | public void actionPerformed( ActionEvent e ) { | ||
| 290 | if ( main.mano == 20 ) { | ||
| 291 | main.aiTrenta = false; | ||
| 292 | main.mischia(); | ||
| 293 | pannello.repaint(); | ||
| 294 | repaint(); | ||
| 295 | } | ||
| 296 | |||
| 297 | else { | ||
| 298 | int selezione = JOptionPane.showOptionDialog( Frame.this, main.stringaVuoiDavveroIniziare, "JBriscola " + main.version, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, new String[] { main.stringaSi, main.stringaNo }, main.stringaNo ); | ||
| 299 | if ( selezione == JOptionPane.YES_OPTION ) { | ||
| 300 | main.aiTrenta = false; | ||
| 301 | main.mischia(); | ||
| 302 | pannello.repaint(); | ||
| 303 | repaint(); | ||
| 304 | } | ||
| 305 | } | ||
| 306 | } | ||
| 307 | }); | ||
| 308 | |||
| 309 | nuovaPartitaAiTrenta = new JMenuItem( main.stringaNuovaPartitaAiTrenta ); | ||
| 310 | nuovaPartitaAiTrenta.addActionListener( new ActionListener() { | ||
| 311 | /* Avvia una nuova partita ai 30, chiedendo prima conferma se | ||
| 312 | * ce n'è già una in corso. */ | ||
| 313 | public void actionPerformed( ActionEvent e ) { | ||
| 314 | if ( main.mano == 20 ) { | ||
| 315 | main.aiTrenta = true; | ||
| 316 | main.mischia(); | ||
| 317 | pannello.repaint(); | ||
| 318 | repaint(); | ||
| 319 | } | ||
| 320 | |||
| 321 | else { | ||
| 322 | int selezione = JOptionPane.showOptionDialog( Frame.this, main.stringaVuoiDavveroIniziare, "JBriscola " + main.version, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, new String[] { main.stringaSi, main.stringaNo }, main.stringaNo ); | ||
| 323 | if ( selezione == JOptionPane.YES_OPTION ) { | ||
| 324 | main.aiTrenta = true; | ||
| 325 | main.mischia(); | ||
| 326 | pannello.repaint(); | ||
| 327 | repaint(); | ||
| 328 | } | ||
| 329 | } | ||
| 330 | } | ||
| 331 | }); | ||
| 332 | |||
| 333 | trucchi = new JMenuItem( main.stringaTrucchi ); | ||
| 334 | trucchi.addActionListener( new ActionListener() { | ||
| 335 | public void actionPerformed( ActionEvent e ) { | ||
| 336 | /* Esegue il trucco */ | ||
| 337 | main.trucco( JOptionPane.showInputDialog( Frame.this, main.stringaInserisciCodice, "JBriscola - " + main.version, JOptionPane.PLAIN_MESSAGE ) ); | ||
| 338 | } | ||
| 339 | } ); | ||
| 340 | |||
| 341 | opzioni = new JMenuItem( main.stringaOpzioni ); | ||
| 342 | opzioni.addActionListener( new ActionListener() { | ||
| 343 | /* Apre una OptionFrame per modificare le opzioni. */ | ||
| 344 | public void actionPerformed( ActionEvent e ) { | ||
| 345 | |||
| 346 | OptionFrame optionFrame = new OptionFrame(); | ||
| 347 | optionFrame.setDefaultCloseOperation( JFrame.DISPOSE_ON_CLOSE ); | ||
| 348 | optionFrame.setResizable( false ); | ||
| 349 | optionFrame.setAlwaysOnTop( true ); | ||
| 350 | optionFrame.setSize( 300, 200 ); | ||
| 351 | optionFrame.setLocation( (Toolkit.getDefaultToolkit().getScreenSize().width - 300) / 2, (Toolkit.getDefaultToolkit().getScreenSize().height - 150) / 2); | ||
| 352 | optionFrame.setVisible( true ); | ||
| 353 | } | ||
| 354 | }); | ||
| 355 | |||
| 356 | esci = new JMenuItem( main.stringaEsci ); | ||
| 357 | esci.addActionListener( new ActionListener() { | ||
| 358 | /* Ciede conferma prima di uscire. */ | ||
| 359 | public void actionPerformed( ActionEvent e ) { | ||
| 360 | int selezione = JOptionPane.showOptionDialog( Frame.this, main.stringaVuoiDavveroUscire, "JBriscola " + main.version, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, new String[] { main.stringaSi, main.stringaNo }, main.stringaNo ); | ||
| 361 | if ( selezione == JOptionPane.YES_OPTION ) | ||
| 362 | Frame.this.dispose(); | ||
| 363 | } | ||
| 364 | }); | ||
| 365 | |||
| 366 | file.add( nuovaPartita ); | ||
| 367 | file.add( nuovaPartitaAiTrenta ); | ||
| 368 | file.add( trucchi ); | ||
| 369 | file.add( opzioni ); | ||
| 370 | file.addSeparator(); | ||
| 371 | file.add( esci ); | ||
| 372 | |||
| 373 | puntoInterrogativo = new JMenu( "?" ); | ||
| 374 | |||
| 375 | informazioni = new JMenuItem( main.stringaInformazioni ); | ||
| 376 | informazioni.addActionListener( new ActionListener() { | ||
| 377 | /* Visualizza le informazioni. */ | ||
| 378 | public void actionPerformed( ActionEvent e ) { | ||
| 379 | JOptionPane.showMessageDialog( Frame.this, main.stringaInformazioni2, main.stringaInformazioni, JOptionPane.PLAIN_MESSAGE ); | ||
| 380 | } | ||
| 381 | } ); | ||
| 382 | |||
| 383 | tastiRapidi = new JMenuItem( main.stringaTasti ); | ||
| 384 | tastiRapidi.addActionListener( new ActionListener() { | ||
| 385 | /* Visualizza i tasti rapidi. */ | ||
| 386 | public void actionPerformed( ActionEvent e ) { | ||
| 387 | JOptionPane.showMessageDialog( Frame.this, main.stringaTasti2, "JBriscola - " + main.version, JOptionPane.INFORMATION_MESSAGE ); | ||
| 388 | } | ||
| 389 | } ); | ||
| 390 | |||
| 391 | briscola = new JMenuItem( main.stringaBriscola ); | ||
| 392 | briscola.addActionListener( new ActionListener() { | ||
| 393 | /* Visualizza il seme di briscola corrente. */ | ||
| 394 | public void actionPerformed( ActionEvent e ) { | ||
| 395 | JOptionPane.showMessageDialog( Frame.this, main.stringaBriscola + ": " + main.semi[main.semeBriscola], "JBriscola - " + main.version, JOptionPane.INFORMATION_MESSAGE ); | ||
| 396 | } | ||
| 397 | }); | ||
| 398 | |||
| 399 | punti = new JMenuItem( main.stringaPunteggio ); | ||
| 400 | punti.addActionListener( new ActionListener() { | ||
| 401 | /* Visualizza il punteggio. */ | ||
| 402 | public void actionPerformed( ActionEvent e ) { | ||
| 403 | JOptionPane.showMessageDialog( Frame.this, main.stringaGiocatore + main.punteggio + main.stringaComputer + main.punteggioCPU, main.stringaPunteggio, JOptionPane.INFORMATION_MESSAGE ); | ||
| 404 | } | ||
| 405 | } ); | ||
| 406 | |||
| 407 | cartePassate = new JMenuItem( main.stringaCartePassate ); | ||
| 408 | cartePassate.addActionListener( new ActionListener() { | ||
| 409 | /*Visualizza le carte passate*/ | ||
| 410 | public void actionPerformed( ActionEvent e ) { | ||
| 411 | CartePassateFrame cartePassateFrame = new CartePassateFrame(); | ||
| 412 | cartePassateFrame.setDefaultCloseOperation( JFrame.DISPOSE_ON_CLOSE ); | ||
| 413 | cartePassateFrame.setResizable( false ); | ||
| 414 | cartePassateFrame.setAlwaysOnTop( true ); | ||
| 415 | cartePassateFrame.setSize( 700, 560 ); | ||
| 416 | cartePassateFrame.setLocation( (Toolkit.getDefaultToolkit().getScreenSize().width - 700) / 2, (Toolkit.getDefaultToolkit().getScreenSize().height - 560) / 2); | ||
| 417 | cartePassateFrame.setVisible( true ); | ||
| 418 | } | ||
| 419 | } ); | ||
| 420 | |||
| 421 | aggiornamenti = new JMenuItem( main.stringaAggiornamenti ); | ||
| 422 | aggiornamenti.addActionListener( new ActionListener() { | ||
| 423 | /* Cerca aggiornamenti sul sito http://porkynator.altervista.org, | ||
| 424 | * confrontando la versione del programma con quella scritta nel | ||
| 425 | * file jbriscola-latest.is (online). */ | ||
| 426 | public void actionPerformed( ActionEvent e ) { | ||
| 427 | String latest = main.version; | ||
| 428 | try { | ||
| 429 | URL latestIs = new URL( "http://porkynator.altervista.org/jbriscola-latest.is" ); | ||
| 430 | BufferedReader latestIsReader = new BufferedReader( new InputStreamReader( latestIs.openStream() ) ); | ||
| 431 | latest = latestIsReader.readLine(); | ||
| 432 | } catch ( Exception ex ) { | ||
| 433 | JOptionPane.showMessageDialog( Frame.this, main.stringaNoInternet, "JBriscola - " + main.version, JOptionPane.ERROR_MESSAGE ); | ||
| 434 | } | ||
| 435 | if ( latest.equals( main.version ) ) | ||
| 436 | JOptionPane.showMessageDialog( Frame.this, main.stringaAggiornamentiNo, "JBriscola - " + main.version, JOptionPane.INFORMATION_MESSAGE ); | ||
| 437 | else | ||
| 438 | JOptionPane.showMessageDialog( Frame.this, main.stringaAggiornamentiSi + "\n" + main.version + " ==> " + latest + "\n\n" + main.stringaScarica, "JBriscola - " + main.version, JOptionPane.INFORMATION_MESSAGE ); | ||
| 439 | } | ||
| 440 | } ); | ||
| 441 | |||
| 442 | puntoInterrogativo.add( punti ); | ||
| 443 | puntoInterrogativo.add( cartePassate ); | ||
| 444 | puntoInterrogativo.add( briscola ); | ||
| 445 | puntoInterrogativo.add( tastiRapidi ); | ||
| 446 | puntoInterrogativo.add( informazioni ); | ||
| 447 | puntoInterrogativo.add( aggiornamenti ); | ||
| 448 | |||
| 449 | barraMenu.add( file ); | ||
| 450 | barraMenu.add( puntoInterrogativo ); | ||
| 451 | |||
| 452 | setJMenuBar( barraMenu ); | ||
| 453 | |||
| 454 | /* Inizializza le immagini del retro delle carte. */ | ||
| 455 | retro1 = new ImageIcon( ClassLoader.getSystemResource( "img/retro1.jpg" ) ); | ||
| 456 | retro2 = new ImageIcon( ClassLoader.getSystemResource( "img/retro2.jpg" ) ); | ||
| 457 | |||
| 458 | /* Inizializza tutte le immagini delle carte scorrendo l'array bidimensionale. */ | ||
| 459 | for (int i = 0; i < 10; i++) | ||
| 460 | for (int j = 0; j < 4; j++) | ||
| 461 | arrayCarte[i][j] = new ImageIcon( ClassLoader.getSystemResource( "img/" + (i+1) + "-" + (j+1) + ".jpg" ) ); | ||
| 462 | |||
| 463 | /* Mischia le carte. */ | ||
| 464 | main.mischia(); | ||
| 465 | |||
| 466 | /* Aggiunge i vari componenti. */ | ||
| 467 | pannello2.add( button ); | ||
| 468 | setLayout( new BorderLayout() ); | ||
| 469 | add( pannello, BorderLayout.CENTER ); | ||
| 470 | add( pannello2, BorderLayout.SOUTH ); | ||
| 471 | |||
| 472 | /* Chiama il metodo mettiCarta se l'utente clicca. */ | ||
| 473 | addMouseListener( | ||
| 474 | new MouseAdapter() { | ||
| 475 | public void mouseClicked ( MouseEvent e ) { | ||
| 476 | if ( mettiCarta( e.getX(), e.getY() ) ) { | ||
| 477 | if ( !main.CPUHaGiocato ) | ||
| 478 | if ( main.aiTrenta ) | ||
| 479 | main.giocaCPUAiTrenta(); | ||
| 480 | else | ||
| 481 | main.giocaCPU(); | ||
| 482 | } | ||
| 483 | } | ||
| 484 | } | ||
| 485 | ); | ||
| 486 | |||
| 487 | /* Chiede conferma prima di uscire quando viene chiusa la finestra. */ | ||
| 488 | addWindowListener( | ||
| 489 | new WindowAdapter() { | ||
| 490 | public void windowClosing( WindowEvent e ) { | ||
| 491 | int selezione = JOptionPane.showOptionDialog( Frame.this, main.stringaVuoiDavveroUscire, "JBriscola " + main.version, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, new String[] { main.stringaSi, main.stringaNo }, main.stringaNo ); | ||
| 492 | if ( selezione == JOptionPane.YES_OPTION ) | ||
| 493 | System.exit( 0 ); | ||
| 494 | } | ||
| 495 | } | ||
| 496 | ); | ||
| 497 | } | ||
| 498 | |||
| 499 | /* Se il giocatore ha cliccato su una carta la gioca e riproduce un suono casuale. */ | ||
| 500 | public boolean mettiCarta( int x, int y ) { | ||
| 501 | |||
| 502 | if ( !main.toccaAllaCPU && giocata[0] == null ) { | ||
| 503 | if ( main.sound && | ||
| 504 | ( ( x > 230 && x < 290 && y > 340 && y < 566 && carteInMano[0] != null ) || | ||
| 505 | ( x > 300 && x < 360 && y > 340 && y < 566 && carteInMano[1] != null ) || | ||
| 506 | ( x > 370 && x < 430 && y > 340 && y < 566 && carteInMano[2] != null ) ) ) { | ||
| 507 | try { | ||
| 508 | |||
| 509 | double a = Math.random() * 6; | ||
| 510 | int i = (int) a; | ||
| 511 | |||
| 512 | AudioFileFormat aff = AudioSystem.getAudioFileFormat( ClassLoader.getSystemResource("sounds/" + i + ".wav") ); | ||
| 513 | AudioInputStream ais = AudioSystem.getAudioInputStream( ClassLoader.getSystemResource("sounds/" + i + ".wav") ); | ||
| 514 | AudioFormat af = aff.getFormat(); | ||
| 515 | DataLine.Info info = new DataLine.Info( Clip.class, ais.getFormat(), ( (int) ais.getFrameLength() * af.getFrameSize() ) ); | ||
| 516 | Clip ol = ( Clip ) AudioSystem.getLine( info ); | ||
| 517 | |||
| 518 | ol.open(ais); | ||
| 519 | ol.loop( 0 ); | ||
| 520 | |||
| 521 | } catch ( Exception e ) { | ||
| 522 | System.err.println( e ); | ||
| 523 | } | ||
| 524 | } | ||
| 525 | |||
| 526 | if ( x > 230 && x < 290 && y > 340 && y < 566 && carteInMano[0] != null ) { | ||
| 527 | giocata[0] = carteInMano[0]; | ||
| 528 | carteInMano[0] = null; | ||
| 529 | pannello.repaint(); | ||
| 530 | return true; | ||
| 531 | } | ||
| 532 | |||
| 533 | if ( x > 300 && x < 360 && y > 340 && y < 566 && carteInMano[1] != null ) { | ||
| 534 | giocata[0] = carteInMano[1]; | ||
| 535 | carteInMano[1] = null; | ||
| 536 | pannello.repaint(); | ||
| 537 | return true; | ||
| 538 | } | ||
| 539 | |||
| 540 | if ( x > 370 && x < 430 && y > 340 && y < 566 && carteInMano[2] != null ) { | ||
| 541 | giocata[0] = carteInMano[2]; | ||
| 542 | carteInMano[2] = null; | ||
| 543 | pannello.repaint(); | ||
| 544 | return true; | ||
| 545 | } | ||
| 546 | } | ||
| 547 | |||
| 548 | return false; | ||
| 549 | } | ||
| 550 | } | ||
| 551 | |||
| 552 | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/Main.java b/JBriscola/all_versions/0.3/0.3.2/src/Main.java new file mode 100755 index 0000000..3760a0d --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/Main.java | |||
| @@ -0,0 +1,2086 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2009-2010 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 | |||
| 29 | /*Costanti per i semi e i valori delle carte*/ | ||
| 30 | public static final int COPPE = 0; | ||
| 31 | public static final int BASTONI = 1; | ||
| 32 | public static final int DENARI = 2; | ||
| 33 | public static final int SPADE = 3; | ||
| 34 | public static final int RE = 0; | ||
| 35 | public static final int ASSO = 1; | ||
| 36 | public static final int DUE = 2; | ||
| 37 | public static final int TRE = 3; | ||
| 38 | public static final int QUATTRO = 4; | ||
| 39 | public static final int CINQUE = 5; | ||
| 40 | public static final int SEI = 6; | ||
| 41 | public static final int SETTE = 7; | ||
| 42 | public static final int FANTE = 8; | ||
| 43 | public static final int CAVALLO = 9; | ||
| 44 | |||
| 45 | /* semeBriscola serve a determinare quale il seme di briscola (0 coppe, | ||
| 46 | * 1 bastoni, 2 denari, 3 spade). | ||
| 47 | * punteggio è il punteggio del giocatore, punteggioCPU quello della CPU | ||
| 48 | * mano tiene il conto della mano a cui si è arrivati. | ||
| 49 | * cartaDaPescare è la carta che la CPU deve raccogliere dal mazzo | ||
| 50 | * cartaDaGiocare (può assumere valore compraso tra 0 e 2) è la carta | ||
| 51 | * che la cpu deve giocare. */ | ||
| 52 | public static int semeBriscola, punteggio, punteggioCPU, mano, cartaDaPescare, cartaDaGiocare; | ||
| 53 | |||
| 54 | /* toccaAllaCPU determina se è il turno del computer o del giocatore, | ||
| 55 | * CPUHaGiocato se il computer ha già giocato in questo turno e | ||
| 56 | * haGiocatoPrima se la prima mossa del turno è stata del giocatore | ||
| 57 | * (true) o della CPU (false). | ||
| 58 | * aiTrenta serve per determinare se la partida che si sta giocando è | ||
| 59 | * normale o ai 30. | ||
| 60 | * carteScoperte serve se viene attivato il trucco per mostrare le | ||
| 61 | * carte della CPU. | ||
| 62 | * sound e keys riguardano le opzioni (souno si o no, tasti rapidi si | ||
| 63 | * o no) salvate nel file di configurazione. */ | ||
| 64 | public static boolean toccaAllaCPU = false; | ||
| 65 | public static boolean CPUHaGiocato = false; | ||
| 66 | public static boolean haGiocatoPrima = true; | ||
| 67 | public static boolean aiTrenta = false; | ||
| 68 | public static boolean carteScoperte = false; | ||
| 69 | public static boolean sound = true; | ||
| 70 | public static boolean keys = true; | ||
| 71 | |||
| 72 | /* frame è la finestra principale del gioco, color il colore dello sfondo. | ||
| 73 | * lang, soundString e keysString servono a leggere le opzioni dal file | ||
| 74 | * di configurazione. */ | ||
| 75 | public static Frame frame; | ||
| 76 | public static Color color = new Color( 0, 150, 0 ); | ||
| 77 | public static String lang, soundString, keysString; | ||
| 78 | |||
| 79 | /* Tutte le stringhe che vengono utilizzate durante il gioco sono | ||
| 80 | * inizializzate qui, per poter essere tradotte in altre lingue. */ | ||
| 81 | public static String version = "0.3.2"; | ||
| 82 | public static String semi[] = { "Bastoni", "Coppe", "Denari", "Spade" }; | ||
| 83 | public static String stringaBriscola = "Briscola"; | ||
| 84 | public static String stringaBottonePrendi = "Prendi/Lascia carte"; | ||
| 85 | public static String stringaPrimaGioca = "Prima Gioca!"; | ||
| 86 | public static String stringaUltime4 = "Ultima carta - Occhio alla briscola!"; | ||
| 87 | public static String stringaVinto = "Hai Vinto!"; | ||
| 88 | public static String stringaPerso = "Hai Perso"; | ||
| 89 | public static String stringaPareggio = "Pareggio"; | ||
| 90 | public static String stringaGiocatore = "Giocatore: "; | ||
| 91 | public static String stringaComputer = "\nComputer: "; | ||
| 92 | public static String stringaNuovaPartita = "Nuova Partita"; | ||
| 93 | public static String stringaNuovaPartitaAiTrenta = "Nuova Partita Ai 30"; | ||
| 94 | public static String stringaVuoiDavveroIniziare = "Vuoi davvero iniziare una nuova partita?"; | ||
| 95 | public static String stringaVuoiDavveroUscire = "Vuoi davvero uscire?"; | ||
| 96 | public static String stringaSi = "Si"; | ||
| 97 | public static String stringaNo = "No"; | ||
| 98 | public static String stringaOpzioni = "Opzioni..."; | ||
| 99 | public static String stringaEsci = "Esci"; | ||
| 100 | public static String stringaImpossibileConfigurare = "Impossibile modificare il file di configurazione.\nSegnalare il bug a: sebastiano@luganega.org\n\nEccezione:\n"; | ||
| 101 | public static String stringaLingua = "Lingua"; | ||
| 102 | public static String stringaAnnulla = "Annulla"; | ||
| 103 | public static String stringaIt = "Italiano"; | ||
| 104 | public static String stringaLa = "Latino"; | ||
| 105 | public static String stringaBL = "Dialetto Bellunese"; | ||
| 106 | public static String stringaBV = "Dialetto Basso Veneto"; | ||
| 107 | public static String stringaEN = "Inglese"; | ||
| 108 | public static String stringaModificaOpzioni = "Modifica Opzioni"; | ||
| 109 | public static String stringaInformazioni = "Informazioni"; | ||
| 110 | public static String stringaInformazioni2 = "JBriscola e' un gioco di briscola per pc scritto in java ideato\ne realizzato da Sebastiano Tronto. Il gioco viene rilasciato sotto licenza GNU/Gpl versione 2 o successive; questo permette\npotenzialmente a chiunque di modificare il gioco partendo dal codice sorgente del programma. Se non avete ricevuto i sorgenti\nassieme al gioco, potete richiedermeli con un'e-mail a sebastiano@luganega.org.\n\nJBriscola version " + version + "\nCopyright 2009 Sebastiano Tronto, license GNU/Gpl 2.0 or later\nE-mail: sebastiano@luganega.org"; | ||
| 111 | public static String stringaSuono = "Effetti Sonori"; | ||
| 112 | public static String stringaPunteggio = "Punteggio"; | ||
| 113 | public static String stringaCartePassate = "Carte Passate"; | ||
| 114 | public static String stringaSfondo = "Sfondo"; | ||
| 115 | public static String stringaTasti = "Tasti rapidi"; | ||
| 116 | public static String stringaAggiornamenti = "Cerca aggiornamenti"; | ||
| 117 | public static String stringaTrucchi = "Trucchi"; | ||
| 118 | public static String stringaInserisciCodice = "Inserisci il codice:"; | ||
| 119 | public static String stringaTruccoAttivato = "Trucco attivato!"; | ||
| 120 | public static String stringaTruccoSbagliato = "Trucco non valido"; | ||
| 121 | public static String stringaCheCartaVuoi = "E allora che carta vuoi?"; | ||
| 122 | public static String stringaAggiornamentiSi = "Aggiornamento disponibile: "; | ||
| 123 | public static String stringaAggiornamentiNo = "Nessun aggiornamento disponibile"; | ||
| 124 | public static String stringaScarica = "E' possibile scaricare la versione più recente\ndal sito http://porkynator.altervista.org/programmi.html"; | ||
| 125 | public static String stringaNoInternet = "Errore: nessuna connessione internet"; | ||
| 126 | public static String stringaTasti2 = "1 Gioca la prima carta\n2 Gioca la seconda carta\n3 Gioca la terza carta\nF1 Visualizza questo messaggio\nF2 " + stringaNuovaPartita + "\nF3 " + stringaOpzioni + "\nF4 " + stringaPunteggio + "\nF5 " + stringaCartePassate + "\nF6 " + stringaInformazioni + "\nF7 " + stringaAggiornamenti + "\nF8 " + stringaNuovaPartitaAiTrenta + "\nF9 " + stringaTrucchi + "\nq " + stringaEsci; | ||
| 127 | |||
| 128 | public static void main( String args[] ) { | ||
| 129 | |||
| 130 | /* Chiama il metodo settaOpzioni per leggere le impostazioni | ||
| 131 | * dell'utente da un eventuale file di configurazione */ | ||
| 132 | settaOpzioni(); | ||
| 133 | |||
| 134 | /* Crea la finestra principale del gioco e la posiziona al centro | ||
| 135 | * dello schermo. */ | ||
| 136 | frame = new Frame(); | ||
| 137 | frame.setDefaultCloseOperation( JFrame.DO_NOTHING_ON_CLOSE ); | ||
| 138 | frame.setResizable( false ); | ||
| 139 | frame.setSize( 600, 600 ); | ||
| 140 | frame.setLocation( (Toolkit.getDefaultToolkit().getScreenSize().width - 600) / 2, (Toolkit.getDefaultToolkit().getScreenSize().height - 600) / 2); | ||
| 141 | frame.setVisible( true ); | ||
| 142 | } | ||
| 143 | |||
| 144 | /* Algoritmo per mischiare il mazzo: prende due carte a caso e le | ||
| 145 | * inverte di posto, utilizzando una variabile aux. Ripete il procedimento | ||
| 146 | * per 391 volte. */ | ||
| 147 | public void mischia() { | ||
| 148 | |||
| 149 | ImageIcon aux; | ||
| 150 | |||
| 151 | mano = 0; | ||
| 152 | punteggio = 0; | ||
| 153 | punteggioCPU = 0; | ||
| 154 | cartaDaPescare = 6; | ||
| 155 | frame.mazzo = true; | ||
| 156 | toccaAllaCPU = false; | ||
| 157 | CPUHaGiocato = false; | ||
| 158 | haGiocatoPrima = true; | ||
| 159 | frame.mazzo = true; | ||
| 160 | |||
| 161 | /* Inizializza l'array di carte mescolate ordinato */ | ||
| 162 | for ( int i = 0, k = 0; i < 10; i++ ) | ||
| 163 | for ( int j = 0; j < 4; j++, k++ ) | ||
| 164 | frame.arrayCarteMescolate[k] = frame.arrayCarte[i][j]; | ||
| 165 | |||
| 166 | /* Mescola le carte utilizzando il metodo sopra citato */ | ||
| 167 | for ( int i = 0; i < 391; i++ ) { | ||
| 168 | double a = Math.random() * 40; | ||
| 169 | int x = (int) a; | ||
| 170 | double b = Math.random() * 40; | ||
| 171 | int y = (int) b; | ||
| 172 | aux = frame.arrayCarteMescolate[x]; | ||
| 173 | frame.arrayCarteMescolate[x] = frame.arrayCarteMescolate[y]; | ||
| 174 | frame.arrayCarteMescolate[y] = aux; | ||
| 175 | } | ||
| 176 | |||
| 177 | /* Imposta il seme della briscola */ | ||
| 178 | semeBriscola = seme( frame.arrayCarteMescolate[39] ); | ||
| 179 | |||
| 180 | /* Distribuisce le carte */ | ||
| 181 | frame.carteInMano[0] = frame.arrayCarteMescolate[0]; | ||
| 182 | frame.carteInMano[1] = frame.arrayCarteMescolate[1]; | ||
| 183 | frame.carteInMano[2] = frame.arrayCarteMescolate[2]; | ||
| 184 | frame.carteCPU[0] = frame.arrayCarteMescolate[3]; | ||
| 185 | frame.carteCPU[1] = frame.arrayCarteMescolate[4]; | ||
| 186 | frame.carteCPU[2] = frame.arrayCarteMescolate[5]; | ||
| 187 | frame.ultimaCarta = frame.arrayCarteMescolate[39]; | ||
| 188 | frame.giocata[0] = null; | ||
| 189 | frame.giocata[1] = null; | ||
| 190 | } | ||
| 191 | |||
| 192 | /* Viene chiamato a fine partita. */ | ||
| 193 | public void pulisciTavolo() { | ||
| 194 | |||
| 195 | punteggio = 0; | ||
| 196 | punteggioCPU = 0; | ||
| 197 | cartaDaPescare = 6; | ||
| 198 | toccaAllaCPU = false; | ||
| 199 | CPUHaGiocato = false; | ||
| 200 | haGiocatoPrima = true; | ||
| 201 | |||
| 202 | frame.mazzo = false; | ||
| 203 | frame.ultimaCarta = null; | ||
| 204 | for ( int i = 0; i < 3; i++ ) { | ||
| 205 | frame.carteCPU[i] = null; | ||
| 206 | frame.carteInMano[i] = null; | ||
| 207 | } | ||
| 208 | |||
| 209 | for ( int i = 0; i < 40; i++ ) | ||
| 210 | frame.arrayCartePassate[i] = null; | ||
| 211 | |||
| 212 | frame.pannello.repaint(); | ||
| 213 | frame.repaint(); | ||
| 214 | |||
| 215 | } | ||
| 216 | |||
| 217 | /* Fa giocare la CPU. Questo metodo contiene l'intelligenza artificiale | ||
| 218 | * del gioco. Ho preferito non commentare molto il corpo del metodo per | ||
| 219 | * due motivi; il primo è che abbastanza intuitivo: basta sapere che i | ||
| 220 | * vari metodi vaiLiscio(), vaiTaglio() ecc... tentano di fare ciò che | ||
| 221 | * ovviamente dice il loro nome, se ci riescono restituiscono true, | ||
| 222 | * in caso contrario false.*/ | ||
| 223 | public void giocaCPU() { | ||
| 224 | |||
| 225 | /* Nelle prime 16 mani ragiona in maniera diversa*/ | ||
| 226 | if ( mano < 16 ) { | ||
| 227 | |||
| 228 | /* Valuta cosa fare se il giocatore non ha ancora giocato. */ | ||
| 229 | if ( !haGiocato() ) { | ||
| 230 | if ( vaiPuntiConCarichiPassati() ); | ||
| 231 | else if ( vaiLiscioConCarichiPassati() ); | ||
| 232 | else if ( vaiLiscio() ); | ||
| 233 | else if ( vaiPunti() ); | ||
| 234 | else if ( vaiTaglio() ); | ||
| 235 | else if ( vaiBriscolaAlta() ); | ||
| 236 | else if ( vaiCarico() ); | ||
| 237 | else if ( vaiTre() ); | ||
| 238 | else if ( vaiAsso() ); | ||
| 239 | else; | ||
| 240 | } | ||
| 241 | |||
| 242 | /* Valuta cosa fare quando invece il giocatore ha giocato */ | ||
| 243 | else { | ||
| 244 | if ( haLisciato() ) { | ||
| 245 | if ( vaiSopra() ); | ||
| 246 | else if ( vaiLiscioConCarichiInGioco() ); | ||
| 247 | else if ( vaiLiscio() ); | ||
| 248 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 249 | else if ( vaiPunti() ); | ||
| 250 | else if ( vaiTaglio() ); | ||
| 251 | else if ( vaiTre() ); | ||
| 252 | else if ( vaiBriscolaAlta() ); | ||
| 253 | else if ( vaiCarico() ); | ||
| 254 | else if ( vaiAsso() ); | ||
| 255 | } else if ( haMessoPunti() ) { | ||
| 256 | if ( vaiSopra() ); | ||
| 257 | else if ( vaiLiscioConCarichiInGioco() ); | ||
| 258 | else if ( vaiLiscio() ); | ||
| 259 | else if ( vaiTaglio() ); | ||
| 260 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 261 | else if ( vaiPunti() ); | ||
| 262 | else if ( vaiTre() ); | ||
| 263 | else if ( vaiBriscolaAlta() ); | ||
| 264 | else if ( vaiCarico() ); | ||
| 265 | else if ( vaiAsso() ); | ||
| 266 | } else if ( haTagliato() ) { | ||
| 267 | if ( vaiLiscioConCarichiInGioco() ); | ||
| 268 | else if ( vaiLiscio() ); | ||
| 269 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 270 | else if ( vaiPunti() ); | ||
| 271 | else if ( vaiTaglio() ); | ||
| 272 | else if ( vaiTre() ); | ||
| 273 | else if ( vaiBriscolaAlta() ); | ||
| 274 | else if ( vaiCarico() ); | ||
| 275 | else if ( vaiAsso() ); | ||
| 276 | } else if ( haMessoBriscolaAlta() ) { | ||
| 277 | if ( vaiLiscioConCarichiInGioco() ); | ||
| 278 | else if ( vaiLiscio() ); | ||
| 279 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 280 | else if ( vaiPunti() ); | ||
| 281 | else if ( vaiTre() ); | ||
| 282 | else if ( vaiTaglio() ); | ||
| 283 | else if ( vaiBriscolaAlta() ); | ||
| 284 | else if ( vaiCarico() ); | ||
| 285 | else if ( vaiAsso() ); | ||
| 286 | } else if ( haMessoTre() ) { | ||
| 287 | if ( vaiAsso() ); | ||
| 288 | else if ( vaiLiscioConCarichiInGioco() ); | ||
| 289 | else if ( vaiLiscio() ); | ||
| 290 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 291 | else if ( vaiPunti() ); | ||
| 292 | else if ( vaiTaglio() ); | ||
| 293 | else if ( vaiBriscolaAlta() ); | ||
| 294 | else if ( vaiCarico() ); | ||
| 295 | } else if ( haMessoAsso() ) { | ||
| 296 | if ( vaiLiscioConCarichiInGioco() ); | ||
| 297 | else if ( vaiLiscio() ); | ||
| 298 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 299 | else if ( vaiPunti() ); | ||
| 300 | else if ( vaiTaglio() ); | ||
| 301 | else if ( vaiBriscolaAlta() ); | ||
| 302 | else if ( vaiCarico() ); | ||
| 303 | else if ( vaiTre() ); | ||
| 304 | } else if ( haCaricato() ) { | ||
| 305 | if ( vaiSopra() ); | ||
| 306 | else if ( vaiTre() ); | ||
| 307 | else if ( vaiBriscolaAlta() ); | ||
| 308 | else if ( vaiTaglio() ); | ||
| 309 | else if ( vaiAsso() ); | ||
| 310 | else if ( vaiLiscioConCarichiInGioco() ); | ||
| 311 | else if ( vaiLiscio() ); | ||
| 312 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 313 | else if ( vaiPunti() ); | ||
| 314 | else if ( vaiCarico() ); | ||
| 315 | } | ||
| 316 | } | ||
| 317 | } | ||
| 318 | |||
| 319 | /* Nella penultima mano (prima di pescare l'ultima carta) */ | ||
| 320 | else if ( mano == 16 ) { | ||
| 321 | |||
| 322 | /* Valuta cosa fare se il giocatore non ha ancora giocato. */ | ||
| 323 | if ( !haGiocato() ) { | ||
| 324 | if ( valore( frame.ultimaCarta ) == TRE || valore( frame.ultimaCarta ) == ASSO ) { | ||
| 325 | |||
| 326 | if ( vaiLiscioConCarichiInGioco() ); | ||
| 327 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 328 | else if ( vaiCarico() ); | ||
| 329 | else if ( vaiPunti() ); | ||
| 330 | else if ( vaiLiscio() ); | ||
| 331 | else if ( vaiTaglio() ); | ||
| 332 | else if ( vaiBriscolaAlta() ); | ||
| 333 | else if ( vaiTre() ); | ||
| 334 | else if ( vaiAsso() ); | ||
| 335 | else; | ||
| 336 | } else { | ||
| 337 | if ( vaiPuntiConCarichiPassati() ); | ||
| 338 | else if ( vaiLiscioConCarichiPassati() ); | ||
| 339 | else if ( vaiLiscio() ); | ||
| 340 | else if ( vaiPunti() ); | ||
| 341 | else if ( vaiTaglio() ); | ||
| 342 | else if ( vaiBriscolaAlta() ); | ||
| 343 | else if ( vaiCarico() ); | ||
| 344 | else if ( vaiTre() ); | ||
| 345 | else if ( vaiAsso() ); | ||
| 346 | else; | ||
| 347 | } | ||
| 348 | } | ||
| 349 | |||
| 350 | /* Valuta cosa fare quando invece il giocatore ha giocato */ | ||
| 351 | else { | ||
| 352 | if ( valore( frame.ultimaCarta ) == TRE || valore( frame.ultimaCarta ) == ASSO ) { | ||
| 353 | if ( haCaricato() ) { | ||
| 354 | if ( vaiSopra() ); | ||
| 355 | else if ( vaiLiscioConCarichiInGioco() ); | ||
| 356 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 357 | else if ( vaiLiscio() ); | ||
| 358 | else if ( vaiPunti() ); | ||
| 359 | else if ( vaiTre() ); | ||
| 360 | else if ( vaiTaglio() ); | ||
| 361 | else if ( vaiBriscolaAlta() ); | ||
| 362 | else if ( vaiAsso() ); | ||
| 363 | else if ( vaiCarico() ); | ||
| 364 | } | ||
| 365 | } else { | ||
| 366 | if ( haLisciato() ) { | ||
| 367 | if ( vaiSopra() ); | ||
| 368 | else if ( vaiLiscioConCarichiInGioco() ); | ||
| 369 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 370 | else if ( vaiLiscio() ); | ||
| 371 | else if ( vaiPunti() ); | ||
| 372 | else if ( vaiTaglio() ); | ||
| 373 | else if ( vaiTre() ); | ||
| 374 | else if ( vaiBriscolaAlta() ); | ||
| 375 | else if ( vaiCarico() ); | ||
| 376 | else if ( vaiAsso() ); | ||
| 377 | } else if ( haMessoPunti() ) { | ||
| 378 | if ( vaiSopra() ); | ||
| 379 | else if ( vaiLiscioConCarichiInGioco() ); | ||
| 380 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 381 | else if ( vaiLiscio() ); | ||
| 382 | else if ( vaiTaglio() ); | ||
| 383 | else if ( vaiPunti() ); | ||
| 384 | else if ( vaiTre() ); | ||
| 385 | else if ( vaiBriscolaAlta() ); | ||
| 386 | else if ( vaiCarico() ); | ||
| 387 | else if ( vaiAsso() ); | ||
| 388 | } else if ( haTagliato() ) { | ||
| 389 | if ( vaiLiscioConCarichiInGioco() ); | ||
| 390 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 391 | else if ( vaiLiscio() ); | ||
| 392 | else if ( vaiPunti() ); | ||
| 393 | else if ( vaiTaglio() ); | ||
| 394 | else if ( vaiTre() ); | ||
| 395 | else if ( vaiBriscolaAlta() ); | ||
| 396 | else if ( vaiCarico() ); | ||
| 397 | else if ( vaiAsso() ); | ||
| 398 | } else if ( haMessoBriscolaAlta() ) { | ||
| 399 | if ( vaiLiscioConCarichiInGioco() ); | ||
| 400 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 401 | else if ( vaiLiscio() ); | ||
| 402 | else if ( vaiPunti() ); | ||
| 403 | else if ( vaiTre() ); | ||
| 404 | else if ( vaiTaglio() ); | ||
| 405 | else if ( vaiBriscolaAlta() ); | ||
| 406 | else if ( vaiCarico() ); | ||
| 407 | else if ( vaiAsso() ); | ||
| 408 | } else if ( haMessoTre() ) { | ||
| 409 | if ( vaiAsso() ); | ||
| 410 | else if ( vaiLiscioConCarichiInGioco() ); | ||
| 411 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 412 | else if ( vaiLiscio() ); | ||
| 413 | else if ( vaiPunti() ); | ||
| 414 | else if ( vaiTaglio() ); | ||
| 415 | else if ( vaiBriscolaAlta() ); | ||
| 416 | else if ( vaiCarico() ); | ||
| 417 | } else if ( haMessoAsso() ) { | ||
| 418 | if ( vaiLiscioConCarichiInGioco() ); | ||
| 419 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 420 | else if ( vaiLiscio() ); | ||
| 421 | else if ( vaiPunti() ); | ||
| 422 | else if ( vaiTaglio() ); | ||
| 423 | else if ( vaiBriscolaAlta() ); | ||
| 424 | else if ( vaiCarico() ); | ||
| 425 | else if ( vaiTre() ); | ||
| 426 | } else if ( haCaricato() ) { | ||
| 427 | if ( vaiSopra() ); | ||
| 428 | else if ( vaiTre() ); | ||
| 429 | else if ( vaiBriscolaAlta() ); | ||
| 430 | else if ( vaiAsso() ); | ||
| 431 | else if ( vaiTaglio() ); | ||
| 432 | else if ( vaiLiscioConCarichiInGioco() ); | ||
| 433 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 434 | else if ( vaiLiscio() ); | ||
| 435 | else if ( vaiPunti() ); | ||
| 436 | else if ( vaiCarico() ); | ||
| 437 | } | ||
| 438 | } | ||
| 439 | } | ||
| 440 | |||
| 441 | } else if ( mano == 17 ) { | ||
| 442 | /* AVVISO: nelle ultime 3 mani, la CPU "guarda" le carte al giocatore; | ||
| 443 | * Questa non è una scorrettezza, ma semplicemente un metodo per sem- | ||
| 444 | * plificare i passaggi: il computer potrebbe comunque dedurre le carte | ||
| 445 | * che ha in mano il giocatore controllando le proprie carte e quelle | ||
| 446 | * che sono già passate. */ | ||
| 447 | |||
| 448 | /* Valuta cosa fare se il giocatore non ha ancora giocato. */ | ||
| 449 | if ( !haGiocato() ) { | ||
| 450 | if ( hoLaBriscolaPiuAltaInGioco() && hoLaSecondaBriscolaPiuAltaInGioco() ) | ||
| 451 | vaiSecondaBriscolaPiuAltaInGioco(); | ||
| 452 | else { | ||
| 453 | if ( vaiLiscioConCarichiPassati() ); | ||
| 454 | else if ( vaiPuntiConCarichiPassati() ); | ||
| 455 | else if ( vaiLiscio() ); | ||
| 456 | else if ( vaiPunti() ); | ||
| 457 | else if ( vaiTaglio() ); | ||
| 458 | else if ( vaiBriscolaAlta() ); | ||
| 459 | else if ( vaiCarico() ); | ||
| 460 | else if ( vaiTre() ); | ||
| 461 | } | ||
| 462 | } | ||
| 463 | |||
| 464 | /* Valuta cosa fare quando invece il giocatore ha giocato */ | ||
| 465 | else { | ||
| 466 | if ( haLisciato() ) { | ||
| 467 | if ( vaiSopra() ); | ||
| 468 | else if ( vaiLiscioConCarichiInGioco() ); | ||
| 469 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 470 | else if ( vaiLiscio() ); | ||
| 471 | else if ( vaiPunti() ); | ||
| 472 | else if ( vaiTaglio() ); | ||
| 473 | else if ( vaiTre() ); | ||
| 474 | else if ( vaiBriscolaAlta() ); | ||
| 475 | else if ( vaiCarico() ); | ||
| 476 | else if ( vaiAsso() ); | ||
| 477 | } else if ( haMessoPunti() ) { | ||
| 478 | if ( vaiSopra() ); | ||
| 479 | else if ( vaiLiscioConCarichiInGioco() ); | ||
| 480 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 481 | else if ( vaiLiscio() ); | ||
| 482 | else if ( vaiTaglio() ); | ||
| 483 | else if ( vaiPunti() ); | ||
| 484 | else if ( vaiTre() ); | ||
| 485 | else if ( vaiBriscolaAlta() ); | ||
| 486 | else if ( vaiCarico() ); | ||
| 487 | else if ( vaiAsso() ); | ||
| 488 | } else if ( haTagliato() ) { | ||
| 489 | if ( vaiLiscioConCarichiInGioco() ); | ||
| 490 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 491 | else if ( vaiLiscio() ); | ||
| 492 | else if ( vaiPunti() ); | ||
| 493 | else if ( vaiTaglio() ); | ||
| 494 | else if ( vaiTre() ); | ||
| 495 | else if ( vaiBriscolaAlta() ); | ||
| 496 | else if ( vaiCarico() ); | ||
| 497 | else if ( vaiAsso() ); | ||
| 498 | } else if ( haMessoBriscolaAlta() ) { | ||
| 499 | if ( vaiLiscioConCarichiInGioco() ); | ||
| 500 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 501 | else if ( vaiLiscio() ); | ||
| 502 | else if ( vaiPunti() ); | ||
| 503 | else if ( vaiTre() ); | ||
| 504 | else if ( vaiTaglio() ); | ||
| 505 | else if ( vaiBriscolaAlta() ); | ||
| 506 | else if ( vaiCarico() ); | ||
| 507 | else if ( vaiAsso() ); | ||
| 508 | } else if ( haMessoTre() ) { | ||
| 509 | if ( vaiAsso() ); | ||
| 510 | else if ( vaiLiscioConCarichiInGioco() ); | ||
| 511 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 512 | else if ( vaiLiscio() ); | ||
| 513 | else if ( vaiPunti() ); | ||
| 514 | else if ( vaiTaglio() ); | ||
| 515 | else if ( vaiBriscolaAlta() ); | ||
| 516 | else if ( vaiCarico() ); | ||
| 517 | } else if ( haMessoAsso() ) { | ||
| 518 | if ( vaiLiscioConCarichiInGioco() ); | ||
| 519 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 520 | else if ( vaiLiscio() ); | ||
| 521 | else if ( vaiPunti() ); | ||
| 522 | else if ( vaiTaglio() ); | ||
| 523 | else if ( vaiBriscolaAlta() ); | ||
| 524 | else if ( vaiCarico() ); | ||
| 525 | else if ( vaiTre() ); | ||
| 526 | } else if ( haCaricato() ) { | ||
| 527 | if ( vaiSopra() ); | ||
| 528 | else if ( piuAltaInGioco() == ASSO && luiHaLaBriscolaPiuAltaInGioco() && hoTre() ) | ||
| 529 | vaiTre(); | ||
| 530 | else if ( vaiTaglio() ); | ||
| 531 | else if ( vaiBriscolaAlta() ); | ||
| 532 | else if ( piuAltaInGioco() == ASSO && !luiHaLaSecondaBriscolaPiuAltaInGioco() && hoAsso() ) | ||
| 533 | vaiAsso(); | ||
| 534 | else if ( vaiTre() ); | ||
| 535 | else if ( vaiAsso() ); | ||
| 536 | else if ( vaiLiscioConCarichiInGioco() ); | ||
| 537 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 538 | else if ( vaiLiscio() ); | ||
| 539 | else if ( vaiPunti() ); | ||
| 540 | else if ( vaiCarico() ); | ||
| 541 | } | ||
| 542 | } | ||
| 543 | |||
| 544 | } else if ( mano == 18 ) { | ||
| 545 | |||
| 546 | /* Valuta cosa fare se il giocatore non ha ancora giocato. */ | ||
| 547 | if ( !haGiocato() ) { | ||
| 548 | if ( hoLaBriscolaPiuAltaInGioco() ) | ||
| 549 | vaiBriscolaPiuAltaInGioco(); | ||
| 550 | else | ||
| 551 | if ( hoLaSecondaBriscolaPiuAltaInGioco() ) | ||
| 552 | vaiNon( secondaPiuAltaInGioco(), semeBriscola ); | ||
| 553 | else | ||
| 554 | if ( luiHaTutteBriscole() ) | ||
| 555 | vaiPrima(); | ||
| 556 | else if ( vaiTaglio() ); | ||
| 557 | else if ( vaiBriscolaAlta() ); | ||
| 558 | else if ( vaiLiscioConCarichiPassati() ); | ||
| 559 | else if ( vaiPuntiConCarichiPassati() ); | ||
| 560 | else if ( vaiLiscio() ); | ||
| 561 | else if ( vaiPunti() ); | ||
| 562 | else if ( vaiCarico() ); | ||
| 563 | else if ( vaiTre() ); | ||
| 564 | } | ||
| 565 | |||
| 566 | /* Valuta cosa fare quando invece il giocatore ha giocato */ | ||
| 567 | else { | ||
| 568 | if ( haLisciato() ) { | ||
| 569 | if ( luiHaLaBriscolaPiuAltaInGioco() && hoLaSecondaBriscolaPiuAltaInGioco() ) | ||
| 570 | vaiSecondaBriscolaPiuAltaInGioco(); | ||
| 571 | else if ( vaiSopra() ); | ||
| 572 | else if ( vaiLiscioConCarichiInGioco() ); | ||
| 573 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 574 | else if ( vaiLiscio() ); | ||
| 575 | else if ( vaiPunti() ); | ||
| 576 | else if ( vaiTaglio() ); | ||
| 577 | else if ( vaiTre() ); | ||
| 578 | else if ( vaiBriscolaAlta() ); | ||
| 579 | else if ( vaiCarico() ); | ||
| 580 | else if ( vaiAsso() ); | ||
| 581 | } else if ( haMessoPunti() ) { | ||
| 582 | if ( luiHaLaBriscolaPiuAltaInGioco() && hoLaSecondaBriscolaPiuAltaInGioco() ) | ||
| 583 | vaiSecondaBriscolaPiuAltaInGioco(); | ||
| 584 | else if ( vaiSopra() ); | ||
| 585 | else if ( vaiLiscioConCarichiInGioco() ); | ||
| 586 | else if ( vaiLiscio() ); | ||
| 587 | else if ( vaiTaglio() ); | ||
| 588 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 589 | else if ( vaiPunti() ); | ||
| 590 | else if ( vaiTre() ); | ||
| 591 | else if ( vaiBriscolaAlta() ); | ||
| 592 | else if ( vaiCarico() ); | ||
| 593 | else if ( vaiAsso() ); | ||
| 594 | } else if ( haTagliato() ) { | ||
| 595 | if ( luiHaLaBriscolaPiuAltaInGioco() && hoLaSecondaBriscolaPiuAltaInGioco() ) | ||
| 596 | vaiSecondaBriscolaPiuAltaInGioco(); | ||
| 597 | else if ( vaiLiscioConCarichiInGioco() ); | ||
| 598 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 599 | else if ( vaiLiscio() ); | ||
| 600 | else if ( vaiPunti() ); | ||
| 601 | else if ( vaiTaglio() ); | ||
| 602 | else if ( vaiTre() ); | ||
| 603 | else if ( vaiBriscolaAlta() ); | ||
| 604 | else if ( vaiCarico() ); | ||
| 605 | else if ( vaiAsso() ); | ||
| 606 | } else if ( haMessoBriscolaAlta() ) { | ||
| 607 | if ( luiHaLaBriscolaPiuAltaInGioco() && hoLaSecondaBriscolaPiuAltaInGioco() ) | ||
| 608 | vaiSecondaBriscolaPiuAltaInGioco(); | ||
| 609 | else if ( vaiLiscioConCarichiInGioco() ); | ||
| 610 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 611 | else if ( vaiLiscio() ); | ||
| 612 | else if ( vaiPunti() ); | ||
| 613 | else if ( vaiTre() ); | ||
| 614 | else if ( vaiTaglio() ); | ||
| 615 | else if ( vaiSopra() ); | ||
| 616 | else if ( vaiBriscolaAlta() ); | ||
| 617 | else if ( vaiAsso() ); | ||
| 618 | else if ( vaiCarico() ); | ||
| 619 | } else if ( haMessoTre() ) { | ||
| 620 | if ( vaiAsso() ); | ||
| 621 | else if ( vaiLiscioConCarichiInGioco() ); | ||
| 622 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 623 | else if ( vaiLiscio() ); | ||
| 624 | else if ( vaiPunti() ); | ||
| 625 | else if ( vaiTaglio() ); | ||
| 626 | else if ( vaiBriscolaAlta() ); | ||
| 627 | else if ( vaiCarico() ); | ||
| 628 | } else if ( haMessoAsso() ) { | ||
| 629 | if ( vaiLiscioConCarichiInGioco() ); | ||
| 630 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 631 | else if ( vaiLiscio() ); | ||
| 632 | else if ( vaiPunti() ); | ||
| 633 | else if ( vaiTaglio() ); | ||
| 634 | else if ( vaiBriscolaAlta() ); | ||
| 635 | else if ( vaiCarico() ); | ||
| 636 | else if ( vaiTre() ); | ||
| 637 | } else if ( haCaricato() ) { | ||
| 638 | if ( vaiSopra() ); | ||
| 639 | else if ( luiHaLaBriscolaPiuAltaInGioco() && hoLaSecondaBriscolaPiuAltaInGioco() ) | ||
| 640 | vaiSecondaBriscolaPiuAltaInGioco(); | ||
| 641 | else if ( vaiTre() ); | ||
| 642 | else if ( vaiBriscolaAlta() ); | ||
| 643 | else if ( vaiAsso() ); | ||
| 644 | else if ( vaiTaglio() ); | ||
| 645 | else if ( vaiLiscioConCarichiInGioco() ); | ||
| 646 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 647 | else if ( vaiLiscio() ); | ||
| 648 | else if ( vaiPunti() ); | ||
| 649 | else if ( vaiCarico() ); | ||
| 650 | } | ||
| 651 | } | ||
| 652 | |||
| 653 | /* All'ultima mano è inutile ragionare, dato che ha una sola carta */ | ||
| 654 | } else vaiPrima(); | ||
| 655 | |||
| 656 | /* Gioca la carta e aggiorna la finestra con il metodo repaint() */ | ||
| 657 | frame.giocata[1] = frame.carteCPU[cartaDaGiocare]; | ||
| 658 | frame.carteCPU[cartaDaGiocare] = null; | ||
| 659 | frame.pannello.repaint(); | ||
| 660 | |||
| 661 | CPUHaGiocato = true; | ||
| 662 | |||
| 663 | if ( !haGiocato() ) | ||
| 664 | toccaAllaCPU = false; | ||
| 665 | } | ||
| 666 | |||
| 667 | /* Fa giocare una partita ai 30. È analogo al metodo precedente, cambia | ||
| 668 | * solo la tecnica di gioco, quindi non è commentato. */ | ||
| 669 | public void giocaCPUAiTrenta() { | ||
| 670 | |||
| 671 | if ( punteggio <= 20 ) { | ||
| 672 | |||
| 673 | if ( !haGiocato() ) { | ||
| 674 | if ( vaiPuntiConCarichiPassati() ); | ||
| 675 | else if ( vaiPunti() ); | ||
| 676 | else if ( vaiLiscioConCarichiPassati() ); | ||
| 677 | else if ( vaiLiscio() ); | ||
| 678 | else if ( vaiTaglio() ); | ||
| 679 | else if ( vaiBriscolaAlta() ); | ||
| 680 | else if ( vaiCarico() ); | ||
| 681 | else if ( vaiTre() ); | ||
| 682 | else if ( vaiAsso() ); | ||
| 683 | else; | ||
| 684 | } | ||
| 685 | |||
| 686 | /* Valuta cosa fare quando invece il giocatore ha giocato */ | ||
| 687 | else { | ||
| 688 | if ( haLisciato() ) { | ||
| 689 | if ( vaiSopra() ); | ||
| 690 | else if ( vaiLiscioConCarichiInGioco() ); | ||
| 691 | else if ( vaiLiscio() ); | ||
| 692 | else if ( vaiTre() ); | ||
| 693 | else if ( vaiBriscolaAlta() ); | ||
| 694 | else if ( vaiTaglio() ); | ||
| 695 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 696 | else if ( vaiPunti() ); | ||
| 697 | else if ( vaiAsso() ); | ||
| 698 | else if ( vaiCarico() ); | ||
| 699 | } else if ( haMessoPunti() ) { | ||
| 700 | if ( vaiSopra() ); | ||
| 701 | else if ( vaiTre() ); | ||
| 702 | else if ( vaiBriscolaAlta() ); | ||
| 703 | else if ( vaiTaglio() ); | ||
| 704 | else if ( vaiLiscioConCarichiInGioco() ); | ||
| 705 | else if ( vaiLiscio() ); | ||
| 706 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 707 | else if ( vaiPunti() ); | ||
| 708 | else if ( vaiAsso() ); | ||
| 709 | else if ( vaiCarico() ); | ||
| 710 | } else if ( haTagliato() ) { | ||
| 711 | if ( vaiLiscioConCarichiInGioco() ); | ||
| 712 | else if ( vaiLiscio() ); | ||
| 713 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 714 | else if ( vaiPunti() ); | ||
| 715 | else if ( vaiTaglio() ); | ||
| 716 | else if ( vaiTre() ); | ||
| 717 | else if ( vaiBriscolaAlta() ); | ||
| 718 | else if ( vaiAsso() ); | ||
| 719 | else if ( vaiCarico() ); | ||
| 720 | } else if ( haMessoBriscolaAlta() ) { | ||
| 721 | if ( vaiLiscioConCarichiInGioco() ); | ||
| 722 | else if ( vaiLiscio() ); | ||
| 723 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 724 | else if ( vaiPunti() ); | ||
| 725 | else if ( vaiTre() ); | ||
| 726 | else if ( vaiTaglio() ); | ||
| 727 | else if ( vaiBriscolaAlta() ); | ||
| 728 | else if ( vaiAsso() ); | ||
| 729 | else if ( vaiCarico() ); | ||
| 730 | } else if ( haMessoTre() ) { | ||
| 731 | if ( vaiAsso() ); | ||
| 732 | else if ( vaiLiscioConCarichiInGioco() ); | ||
| 733 | else if ( vaiLiscio() ); | ||
| 734 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 735 | else if ( vaiPunti() ); | ||
| 736 | else if ( vaiTaglio() ); | ||
| 737 | else if ( vaiBriscolaAlta() ); | ||
| 738 | else if ( vaiCarico() ); | ||
| 739 | } else if ( haMessoAsso() ) { | ||
| 740 | if ( vaiLiscioConCarichiInGioco() ); | ||
| 741 | else if ( vaiLiscio() ); | ||
| 742 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 743 | else if ( vaiPunti() ); | ||
| 744 | else if ( vaiTaglio() ); | ||
| 745 | else if ( vaiBriscolaAlta() ); | ||
| 746 | else if ( vaiCarico() ); | ||
| 747 | else if ( vaiTre() ); | ||
| 748 | } else if ( haCaricato() ) { | ||
| 749 | if ( vaiSopra() ); | ||
| 750 | else if ( vaiTre() ); | ||
| 751 | else if ( vaiBriscolaAlta() ); | ||
| 752 | else if ( vaiTaglio() ); | ||
| 753 | else if ( vaiAsso() ); | ||
| 754 | else if ( vaiLiscioConCarichiInGioco() ); | ||
| 755 | else if ( vaiLiscio() ); | ||
| 756 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 757 | else if ( vaiPunti() ); | ||
| 758 | else if ( vaiCarico() ); | ||
| 759 | } | ||
| 760 | } | ||
| 761 | } | ||
| 762 | |||
| 763 | else { | ||
| 764 | |||
| 765 | if ( !haGiocato() ) { | ||
| 766 | if ( vaiLiscioConCarichiPassati() ); | ||
| 767 | else if ( vaiLiscio() ); | ||
| 768 | else if ( vaiPuntiConCarichiPassati() ); | ||
| 769 | else if ( vaiPunti() ); | ||
| 770 | else if ( vaiTaglio() ); | ||
| 771 | else if ( vaiBriscolaAlta() ); | ||
| 772 | else if ( vaiCarico() ); | ||
| 773 | else if ( vaiTre() ); | ||
| 774 | else if ( vaiAsso() ); | ||
| 775 | else; | ||
| 776 | } | ||
| 777 | |||
| 778 | /* Valuta cosa fare quando invece il giocatore ha giocato */ | ||
| 779 | else { | ||
| 780 | if ( haLisciato() ) { | ||
| 781 | if ( vaiSopra() ); | ||
| 782 | else if ( vaiLiscioConCarichiInGioco() ); | ||
| 783 | else if ( vaiLiscio() ); | ||
| 784 | else if ( vaiTre() ); | ||
| 785 | else if ( vaiBriscolaAlta() ); | ||
| 786 | else if ( vaiTaglio() ); | ||
| 787 | else if ( vaiAsso() ); | ||
| 788 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 789 | else if ( vaiPunti() ); | ||
| 790 | else if ( vaiCarico() ); | ||
| 791 | } else if ( haMessoPunti() ) { | ||
| 792 | if ( vaiSopra() ); | ||
| 793 | else if ( vaiTre() ); | ||
| 794 | else if ( vaiBriscolaAlta() ); | ||
| 795 | else if ( vaiTaglio() ); | ||
| 796 | else if ( vaiAsso() ); | ||
| 797 | else if ( vaiLiscioConCarichiInGioco() ); | ||
| 798 | else if ( vaiLiscio() ); | ||
| 799 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 800 | else if ( vaiPunti() ); | ||
| 801 | else if ( vaiCarico() ); | ||
| 802 | } else if ( haTagliato() ) { | ||
| 803 | if ( vaiLiscioConCarichiInGioco() ); | ||
| 804 | else if ( vaiLiscio() ); | ||
| 805 | else if ( vaiTaglio() ); | ||
| 806 | else if ( vaiTre() ); | ||
| 807 | else if ( vaiBriscolaAlta() ); | ||
| 808 | else if ( vaiAsso() ); | ||
| 809 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 810 | else if ( vaiPunti() ); | ||
| 811 | else if ( vaiCarico() ); | ||
| 812 | } else if ( haMessoBriscolaAlta() ) { | ||
| 813 | if ( vaiLiscioConCarichiInGioco() ); | ||
| 814 | else if ( vaiLiscio() ); | ||
| 815 | else if ( vaiTre() ); | ||
| 816 | else if ( vaiTaglio() ); | ||
| 817 | else if ( vaiAsso() ); | ||
| 818 | else if ( vaiBriscolaAlta() ); | ||
| 819 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 820 | else if ( vaiPunti() ); | ||
| 821 | else if ( vaiCarico() ); | ||
| 822 | } else if ( haMessoTre() ) { | ||
| 823 | if ( vaiAsso() ); | ||
| 824 | else if ( vaiLiscioConCarichiInGioco() ); | ||
| 825 | else if ( vaiLiscio() ); | ||
| 826 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 827 | else if ( vaiPunti() ); | ||
| 828 | else if ( vaiTaglio() ); | ||
| 829 | else if ( vaiBriscolaAlta() ); | ||
| 830 | else if ( vaiCarico() ); | ||
| 831 | } else if ( haMessoAsso() ) { | ||
| 832 | if ( vaiLiscioConCarichiInGioco() ); | ||
| 833 | else if ( vaiLiscio() ); | ||
| 834 | else if ( vaiTaglio() ); | ||
| 835 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 836 | else if ( vaiPunti() ); | ||
| 837 | else if ( vaiBriscolaAlta() ); | ||
| 838 | else if ( vaiCarico() ); | ||
| 839 | else if ( vaiTre() ); | ||
| 840 | } else if ( haCaricato() ) { | ||
| 841 | if ( vaiSopra() ); | ||
| 842 | else if ( vaiTre() ); | ||
| 843 | else if ( vaiBriscolaAlta() ); | ||
| 844 | else if ( vaiTaglio() ); | ||
| 845 | else if ( vaiAsso() ); | ||
| 846 | else if ( vaiLiscioConCarichiInGioco() ); | ||
| 847 | else if ( vaiLiscio() ); | ||
| 848 | else if ( vaiPuntiConCarichiInGioco() ); | ||
| 849 | else if ( vaiPunti() ); | ||
| 850 | else if ( vaiCarico() ); | ||
| 851 | } | ||
| 852 | } | ||
| 853 | } | ||
| 854 | |||
| 855 | /* Gioca la carta e aggiorna la finestra con il metodo repaint() */ | ||
| 856 | frame.giocata[1] = frame.carteCPU[cartaDaGiocare]; | ||
| 857 | frame.carteCPU[cartaDaGiocare] = null; | ||
| 858 | frame.pannello.repaint(); | ||
| 859 | |||
| 860 | CPUHaGiocato = true; | ||
| 861 | |||
| 862 | if ( !haGiocato() ) | ||
| 863 | toccaAllaCPU = false; | ||
| 864 | } | ||
| 865 | |||
| 866 | /* Determina se ha preso la CPU o il giocatore*/ | ||
| 867 | public void chiPrende() { | ||
| 868 | |||
| 869 | /* Chiama il metodo giocatorePrende( boolean giocatore ) con parametro | ||
| 870 | * true se ha preso il giocatore, false se ha preso la CPU */ | ||
| 871 | giocatorePrende( ( (seme( frame.giocata[0] ) == semeBriscola) && (seme( frame.giocata[1] ) != semeBriscola) ) | ||
| 872 | || ( (seme( frame.giocata[0] ) == seme( frame.giocata[1] )) && laPrimaEPiuAlta( valore( frame.giocata[0] ), valore( frame.giocata[1] )) ) | ||
| 873 | || ( (seme( frame.giocata[1] ) != semeBriscola) && (seme( frame.giocata[0] ) != seme( frame.giocata[1] )) && haGiocatoPrima ) ); | ||
| 874 | } | ||
| 875 | |||
| 876 | /* Confronta due carte per decidere quale ha più valore di presa. | ||
| 877 | * Restituisce true se è la prima, false se è la seconda */ | ||
| 878 | public boolean laPrimaEPiuAlta( int prima, int seconda ) { | ||
| 879 | int a, b; | ||
| 880 | switch ( prima ) { | ||
| 881 | case 0: | ||
| 882 | a = 10; | ||
| 883 | break; | ||
| 884 | case 1: | ||
| 885 | a = 12; | ||
| 886 | break; | ||
| 887 | case 3: | ||
| 888 | a = 11; | ||
| 889 | break; | ||
| 890 | default: | ||
| 891 | a = prima; | ||
| 892 | break; | ||
| 893 | } | ||
| 894 | switch ( seconda ) { | ||
| 895 | case 0: | ||
| 896 | b = 10; | ||
| 897 | break; | ||
| 898 | case 1: | ||
| 899 | b = 12; | ||
| 900 | break; | ||
| 901 | case 3: | ||
| 902 | b = 11; | ||
| 903 | break; | ||
| 904 | default: | ||
| 905 | b = seconda; | ||
| 906 | break; | ||
| 907 | } | ||
| 908 | return a > b; | ||
| 909 | } | ||
| 910 | |||
| 911 | /* Viene chiamato con parametro true se ha preso il giocatore, false se | ||
| 912 | * ha preso la CPU */ | ||
| 913 | public void giocatorePrende( boolean giocatore ) { | ||
| 914 | if ( giocatore ) { | ||
| 915 | toccaAllaCPU = CPUHaGiocato = false; | ||
| 916 | haGiocatoPrima = true; | ||
| 917 | } | ||
| 918 | else { | ||
| 919 | toccaAllaCPU = true; | ||
| 920 | CPUHaGiocato = haGiocatoPrima = false; | ||
| 921 | } | ||
| 922 | daiPunti( giocatore ); | ||
| 923 | } | ||
| 924 | |||
| 925 | /* Da i punti (true al giocatore, false alla CPU) e fa pescare le carte*/ | ||
| 926 | public void daiPunti( boolean giocatore ) { | ||
| 927 | |||
| 928 | int punti = 0; | ||
| 929 | |||
| 930 | switch( valore( frame.giocata[0] ) ) { | ||
| 931 | case 0: | ||
| 932 | punti += 4; | ||
| 933 | break; | ||
| 934 | case 1: | ||
| 935 | punti += 11; | ||
| 936 | break; | ||
| 937 | case 3: | ||
| 938 | punti += 10; | ||
| 939 | break; | ||
| 940 | case 8: | ||
| 941 | punti += 2; | ||
| 942 | break; | ||
| 943 | case 9: | ||
| 944 | punti += 3; | ||
| 945 | break; | ||
| 946 | default: | ||
| 947 | break; | ||
| 948 | } | ||
| 949 | switch( valore( frame.giocata[1] ) ) { | ||
| 950 | case 0: | ||
| 951 | punti += 4; | ||
| 952 | break; | ||
| 953 | case 1: | ||
| 954 | punti += 11; | ||
| 955 | break; | ||
| 956 | case 3: | ||
| 957 | punti += 10; | ||
| 958 | break; | ||
| 959 | case 8: | ||
| 960 | punti += 2; | ||
| 961 | break; | ||
| 962 | case 9: | ||
| 963 | punti += 3; | ||
| 964 | break; | ||
| 965 | default: | ||
| 966 | break; | ||
| 967 | } | ||
| 968 | |||
| 969 | frame.giocata[0] = frame.giocata[1] = null; | ||
| 970 | |||
| 971 | if ( giocatore ) { | ||
| 972 | punteggio += punti; | ||
| 973 | if ( mano < 18 ) { | ||
| 974 | if ( frame.carteInMano[0] == null ) | ||
| 975 | frame.carteInMano[0] = frame.arrayCarteMescolate[cartaDaPescare]; | ||
| 976 | if ( frame.carteInMano[1] == null ) | ||
| 977 | frame.carteInMano[1] = frame.arrayCarteMescolate[cartaDaPescare]; | ||
| 978 | if ( frame.carteInMano[2] == null ) | ||
| 979 | frame.carteInMano[2] = frame.arrayCarteMescolate[cartaDaPescare]; | ||
| 980 | cartaDaPescare++; | ||
| 981 | if ( frame.carteCPU[0] == null ) | ||
| 982 | frame.carteCPU[0] = frame.arrayCarteMescolate[cartaDaPescare]; | ||
| 983 | if ( frame.carteCPU[1] == null ) | ||
| 984 | frame.carteCPU[1] = frame.arrayCarteMescolate[cartaDaPescare]; | ||
| 985 | if ( frame.carteCPU[2] == null ) | ||
| 986 | frame.carteCPU[2] = frame.arrayCarteMescolate[cartaDaPescare]; | ||
| 987 | cartaDaPescare++; | ||
| 988 | } | ||
| 989 | } | ||
| 990 | |||
| 991 | else { | ||
| 992 | punteggioCPU += punti; | ||
| 993 | if ( mano < 18 ) { | ||
| 994 | if ( frame.carteCPU[0] == null ) | ||
| 995 | frame.carteCPU[0] = frame.arrayCarteMescolate[cartaDaPescare]; | ||
| 996 | if ( frame.carteCPU[1] == null ) | ||
| 997 | frame.carteCPU[1] = frame.arrayCarteMescolate[cartaDaPescare]; | ||
| 998 | if ( frame.carteCPU[2] == null ) | ||
| 999 | frame.carteCPU[2] = frame.arrayCarteMescolate[cartaDaPescare]; | ||
| 1000 | cartaDaPescare++; | ||
| 1001 | if ( frame.carteInMano[0] == null ) | ||
| 1002 | frame.carteInMano[0] = frame.arrayCarteMescolate[cartaDaPescare]; | ||
| 1003 | if ( frame.carteInMano[1] == null ) | ||
| 1004 | frame.carteInMano[1] = frame.arrayCarteMescolate[cartaDaPescare]; | ||
| 1005 | if ( frame.carteInMano[2] == null ) | ||
| 1006 | frame.carteInMano[2] = frame.arrayCarteMescolate[cartaDaPescare]; | ||
| 1007 | cartaDaPescare++; | ||
| 1008 | } | ||
| 1009 | } | ||
| 1010 | |||
| 1011 | /* Aggiorna la finestra */ | ||
| 1012 | frame.pannello.repaint(); | ||
| 1013 | frame.repaint(); | ||
| 1014 | } | ||
| 1015 | |||
| 1016 | /* Ritorna true se il giocatore ha giocato */ | ||
| 1017 | public boolean haGiocato() { | ||
| 1018 | return frame.giocata[0] != null; | ||
| 1019 | } | ||
| 1020 | |||
| 1021 | /* Vari metodi che determinano che tipo di carta ha giocato il giocatore.*/ | ||
| 1022 | public boolean haLisciato() { | ||
| 1023 | return ( (haGiocato()) && (seme( frame.giocata[0] ) != semeBriscola) && | ||
| 1024 | (valore( frame.giocata[0] ) != RE ) && (valore( frame.giocata[0] ) != ASSO ) && | ||
| 1025 | (valore( frame.giocata[0] ) != TRE ) && (valore( frame.giocata[0] ) < FANTE ) ); | ||
| 1026 | } | ||
| 1027 | |||
| 1028 | public boolean haMessoPunti() { | ||
| 1029 | return ( (haGiocato()) && (seme( frame.giocata[0] ) != semeBriscola) && | ||
| 1030 | ( (valore( frame.giocata[0] ) == RE ) || (valore( frame.giocata[0] ) == FANTE ) || | ||
| 1031 | (valore( frame.giocata[0] ) == CAVALLO ) ) ); | ||
| 1032 | } | ||
| 1033 | |||
| 1034 | public boolean haTagliato() { | ||
| 1035 | return ( (haGiocato()) && (seme( frame.giocata[0] ) == semeBriscola) && | ||
| 1036 | (valore( frame.giocata[0] ) == RE) && (valore( frame.giocata[0] ) != ASSO) && | ||
| 1037 | (valore( frame.giocata[0] ) == TRE) && (valore( frame.giocata[0] ) <= SETTE) ); | ||
| 1038 | } | ||
| 1039 | |||
| 1040 | public boolean haMessoBriscolaAlta() { | ||
| 1041 | return ( (haGiocato()) && (seme( frame.giocata[0] ) == semeBriscola) && | ||
| 1042 | ( (valore( frame.giocata[0] ) == RE ) || (valore( frame.giocata[0] ) == FANTE ) || | ||
| 1043 | (valore( frame.giocata[0] ) == CAVALLO ) ) ); | ||
| 1044 | } | ||
| 1045 | |||
| 1046 | public boolean haMessoTre() { | ||
| 1047 | return ( (haGiocato()) && (seme( frame.giocata[0] ) == semeBriscola) && | ||
| 1048 | (valore( frame.giocata[0] ) == TRE) ); | ||
| 1049 | } | ||
| 1050 | |||
| 1051 | public boolean haMessoAsso() { | ||
| 1052 | return ( (haGiocato()) && (seme( frame.giocata[0] ) == semeBriscola) && | ||
| 1053 | (valore( frame.giocata[0] ) == ASSO) ); | ||
| 1054 | } | ||
| 1055 | |||
| 1056 | public boolean haCaricato() { | ||
| 1057 | return ( (haGiocato()) && (seme( frame.giocata[0] ) != semeBriscola) && | ||
| 1058 | ( (valore( frame.giocata[0] ) == ASSO) || (valore( frame.giocata[0] ) == TRE) ) ); | ||
| 1059 | } | ||
| 1060 | |||
| 1061 | /* I metodi seguenti cercano di andare liscio - dare punti - mettere | ||
| 1062 | * un taglio - ecc... e restituiscono true se hanno avuto successo, | ||
| 1063 | * false altrimenti. Le varianti -ConCarichiPassati e -ConCarichiInGioco | ||
| 1064 | * cercano, rispettivamente, di giocare un seme i cui carichi siano già | ||
| 1065 | * passati o ancora in gioco.*/ | ||
| 1066 | public boolean vaiLiscio() { | ||
| 1067 | for ( int i = 0; i < 3; i++ ) { | ||
| 1068 | if ( frame.carteCPU[i] != null ) { | ||
| 1069 | if ( (seme( frame.carteCPU[i] ) != semeBriscola) && | ||
| 1070 | (valore( frame.carteCPU[i] ) != RE) && (valore( frame.carteCPU[i] ) != ASSO) && | ||
| 1071 | (valore( frame.carteCPU[i] ) != TRE) && (valore( frame.carteCPU[i] ) < FANTE) ) { | ||
| 1072 | cartaDaGiocare = i; | ||
| 1073 | return true; | ||
| 1074 | } | ||
| 1075 | } | ||
| 1076 | } | ||
| 1077 | |||
| 1078 | return false; | ||
| 1079 | } | ||
| 1080 | |||
| 1081 | public boolean vaiLiscioConCarichiPassati() { | ||
| 1082 | for ( int i = 0; i < 3; i++ ) { | ||
| 1083 | if ( frame.carteCPU[i] != null ) { | ||
| 1084 | if ( (seme( frame.carteCPU[i] ) != semeBriscola) && | ||
| 1085 | (valore( frame.carteCPU[i] ) != RE) && (valore( frame.carteCPU[i] ) != ASSO) && | ||
| 1086 | (valore( frame.carteCPU[i] ) != TRE) && (valore( frame.carteCPU[i] ) < FANTE) | ||
| 1087 | && sonoPassatiICarichi( seme( frame.carteCPU[i] ) ) ) { | ||
| 1088 | cartaDaGiocare = i; | ||
| 1089 | return true; | ||
| 1090 | } else if ( (seme( frame.carteCPU[i] ) != semeBriscola) && | ||
| 1091 | (valore( frame.carteCPU[i] ) != RE) && (valore( frame.carteCPU[i] ) != ASSO) && | ||
| 1092 | (valore( frame.carteCPU[i] ) != TRE) && (valore( frame.carteCPU[i] ) < FANTE) | ||
| 1093 | && ePassato( ASSO, seme( frame.carteCPU[i] ) ) ) { | ||
| 1094 | cartaDaGiocare = i; | ||
| 1095 | return true; | ||
| 1096 | } else if ( (seme( frame.carteCPU[i] ) != semeBriscola) && | ||
| 1097 | (valore( frame.carteCPU[i] ) != RE) && (valore( frame.carteCPU[i] ) != ASSO) && | ||
| 1098 | (valore( frame.carteCPU[i] ) != TRE) && (valore( frame.carteCPU[i] ) < FANTE) | ||
| 1099 | && ePassato( TRE, seme( frame.carteCPU[i] ) ) ) { | ||
| 1100 | cartaDaGiocare = i; | ||
| 1101 | return true; | ||
| 1102 | } | ||
| 1103 | } | ||
| 1104 | } | ||
| 1105 | |||
| 1106 | return false; | ||
| 1107 | } | ||
| 1108 | |||
| 1109 | public boolean vaiLiscioConCarichiInGioco() { | ||
| 1110 | for ( int i = 0; i < 3; i++ ) { | ||
| 1111 | if ( frame.carteCPU[i] != null ) { | ||
| 1112 | if ( (seme( frame.carteCPU[i] ) != semeBriscola) && | ||
| 1113 | (valore( frame.carteCPU[i] ) != RE) && (valore( frame.carteCPU[i] ) != ASSO) && | ||
| 1114 | (valore( frame.carteCPU[i] ) != TRE) && (valore( frame.carteCPU[i] ) < FANTE) | ||
| 1115 | && !sonoPassatiICarichi( seme( frame.carteCPU[i] ) ) ) { | ||
| 1116 | cartaDaGiocare = i; | ||
| 1117 | return true; | ||
| 1118 | } else if ( (seme( frame.carteCPU[i] ) != semeBriscola) && | ||
| 1119 | (valore( frame.carteCPU[i] ) != RE) && (valore( frame.carteCPU[i] ) != ASSO) && | ||
| 1120 | (valore( frame.carteCPU[i] ) != TRE) && (valore( frame.carteCPU[i] ) < FANTE) | ||
| 1121 | && !ePassato( ASSO, seme( frame.carteCPU[i] ) ) ) { | ||
| 1122 | cartaDaGiocare = i; | ||
| 1123 | return true; | ||
| 1124 | } else if ( (seme( frame.carteCPU[i] ) != semeBriscola) && | ||
| 1125 | (valore( frame.carteCPU[i] ) != RE) && (valore( frame.carteCPU[i] ) != ASSO) && | ||
| 1126 | (valore( frame.carteCPU[i] ) != TRE) && (valore( frame.carteCPU[i] ) < FANTE) | ||
| 1127 | && !ePassato( TRE, seme( frame.carteCPU[i] ) ) ) { | ||
| 1128 | cartaDaGiocare = i; | ||
| 1129 | return true; | ||
| 1130 | } | ||
| 1131 | } | ||
| 1132 | } | ||
| 1133 | |||
| 1134 | return false; | ||
| 1135 | } | ||
| 1136 | |||
| 1137 | public boolean vaiPunti() { | ||
| 1138 | /* Cerca di dare punti, cercando di darne il meno possibile (meglio | ||
| 1139 | * un fante di re). */ | ||
| 1140 | for ( int i = 0; i < 3; i++ ) { | ||
| 1141 | if ( frame.carteCPU[i] != null ) { | ||
| 1142 | if ( (seme( frame.carteCPU[i] ) != semeBriscola) && (valore( frame.carteCPU[i] ) == FANTE ) ) { | ||
| 1143 | cartaDaGiocare = i; | ||
| 1144 | return true; | ||
| 1145 | } | ||
| 1146 | } | ||
| 1147 | } | ||
| 1148 | |||
| 1149 | for ( int i = 0; i < 3; i++ ) { | ||
| 1150 | if ( frame.carteCPU[i] != null ) { | ||
| 1151 | if ( (seme( frame.carteCPU[i] ) != semeBriscola) && (valore( frame.carteCPU[i] ) == CAVALLO ) ) { | ||
| 1152 | cartaDaGiocare = i; | ||
| 1153 | return true; | ||
| 1154 | } | ||
| 1155 | } | ||
| 1156 | } | ||
| 1157 | |||
| 1158 | for ( int i = 0; i < 3; i++ ) { | ||
| 1159 | if ( frame.carteCPU[i] != null ) { | ||
| 1160 | if ( (seme( frame.carteCPU[i] ) != semeBriscola) && (valore( frame.carteCPU[i] ) == RE ) ) { | ||
| 1161 | cartaDaGiocare = i; | ||
| 1162 | return true; | ||
| 1163 | } | ||
| 1164 | } | ||
| 1165 | } | ||
| 1166 | |||
| 1167 | return false; | ||
| 1168 | } | ||
| 1169 | |||
| 1170 | public boolean vaiPuntiConCarichiPassati() { | ||
| 1171 | for ( int i = 0; i < 3; i++ ) { | ||
| 1172 | if ( frame.carteCPU[i] != null ) { | ||
| 1173 | if ( (seme( frame.carteCPU[i] ) != semeBriscola) && (valore( frame.carteCPU[i] ) == FANTE ) | ||
| 1174 | && sonoPassatiICarichi( seme( frame.carteCPU[i] ) ) ) { | ||
| 1175 | cartaDaGiocare = i; | ||
| 1176 | return true; | ||
| 1177 | } else if ( (seme( frame.carteCPU[i] ) != semeBriscola) && (valore( frame.carteCPU[i] ) == FANTE ) | ||
| 1178 | && ePassato( ASSO, seme( frame.carteCPU[i] ) ) ) { | ||
| 1179 | cartaDaGiocare = i; | ||
| 1180 | return true; | ||
| 1181 | } else if ( (seme( frame.carteCPU[i] ) != semeBriscola) && (valore( frame.carteCPU[i] ) == FANTE ) | ||
| 1182 | && ePassato( TRE, seme( frame.carteCPU[i] ) ) ) { | ||
| 1183 | cartaDaGiocare = i; | ||
| 1184 | return true; | ||
| 1185 | } | ||
| 1186 | } | ||
| 1187 | } | ||
| 1188 | for ( int i = 0; i < 3; i++ ) { | ||
| 1189 | if ( frame.carteCPU[i] != null ) { | ||
| 1190 | if ( (seme( frame.carteCPU[i] ) != semeBriscola) && (valore( frame.carteCPU[i] ) == CAVALLO ) | ||
| 1191 | && sonoPassatiICarichi( seme( frame.carteCPU[i] ) ) ) { | ||
| 1192 | cartaDaGiocare = i; | ||
| 1193 | return true; | ||
| 1194 | } else if ( (seme( frame.carteCPU[i] ) != semeBriscola) && (valore( frame.carteCPU[i] ) == CAVALLO ) | ||
| 1195 | && ePassato( ASSO, seme( frame.carteCPU[i] ) ) ) { | ||
| 1196 | cartaDaGiocare = i; | ||
| 1197 | return true; | ||
| 1198 | } else if ( (seme( frame.carteCPU[i] ) != semeBriscola) && (valore( frame.carteCPU[i] ) == CAVALLO ) | ||
| 1199 | && ePassato( TRE, seme( frame.carteCPU[i] ) ) ) { | ||
| 1200 | cartaDaGiocare = i; | ||
| 1201 | return true; | ||
| 1202 | } | ||
| 1203 | } | ||
| 1204 | } | ||
| 1205 | for ( int i = 0; i < 3; i++ ) { | ||
| 1206 | if ( frame.carteCPU[i] != null ) { | ||
| 1207 | if ( (seme( frame.carteCPU[i] ) != semeBriscola) && (valore( frame.carteCPU[i] ) == RE ) | ||
| 1208 | && sonoPassatiICarichi( seme( frame.carteCPU[i] ) ) ) { | ||
| 1209 | cartaDaGiocare = i; | ||
| 1210 | return true; | ||
| 1211 | } else if ( (seme( frame.carteCPU[i] ) != semeBriscola) && (valore( frame.carteCPU[i] ) == RE ) | ||
| 1212 | && ePassato( ASSO, seme( frame.carteCPU[i] ) ) ) { | ||
| 1213 | cartaDaGiocare = i; | ||
| 1214 | return true; | ||
| 1215 | } else if ( (seme( frame.carteCPU[i] ) != semeBriscola) && (valore( frame.carteCPU[i] ) == RE ) | ||
| 1216 | && ePassato( TRE, seme( frame.carteCPU[i] ) ) ) { | ||
| 1217 | cartaDaGiocare = i; | ||
| 1218 | return true; | ||
| 1219 | } | ||
| 1220 | } | ||
| 1221 | } | ||
| 1222 | |||
| 1223 | return false; | ||
| 1224 | } | ||
| 1225 | |||
| 1226 | public boolean vaiPuntiConCarichiInGioco() { | ||
| 1227 | for ( int i = 0; i < 3; i++ ) { | ||
| 1228 | if ( frame.carteCPU[i] != null ) { | ||
| 1229 | if ( (seme( frame.carteCPU[i] ) != semeBriscola) && (valore( frame.carteCPU[i] ) == FANTE ) | ||
| 1230 | && !sonoPassatiICarichi( seme( frame.carteCPU[i] ) ) ) { | ||
| 1231 | cartaDaGiocare = i; | ||
| 1232 | return true; | ||
| 1233 | } else if ( (seme( frame.carteCPU[i] ) != semeBriscola) && (valore( frame.carteCPU[i] ) == FANTE ) | ||
| 1234 | && !ePassato( ASSO, seme( frame.carteCPU[i] ) ) ) { | ||
| 1235 | cartaDaGiocare = i; | ||
| 1236 | return true; | ||
| 1237 | } else if ( (seme( frame.carteCPU[i] ) != semeBriscola) && (valore( frame.carteCPU[i] ) == FANTE ) | ||
| 1238 | && !ePassato( TRE, seme( frame.carteCPU[i] ) ) ) { | ||
| 1239 | cartaDaGiocare = i; | ||
| 1240 | return true; | ||
| 1241 | } | ||
| 1242 | } | ||
| 1243 | } | ||
| 1244 | for ( int i = 0; i < 3; i++ ) { | ||
| 1245 | if ( frame.carteCPU[i] != null ) { | ||
| 1246 | if ( (seme( frame.carteCPU[i] ) != semeBriscola) && (valore( frame.carteCPU[i] ) == CAVALLO ) | ||
| 1247 | && !sonoPassatiICarichi( seme( frame.carteCPU[i] ) ) ) { | ||
| 1248 | cartaDaGiocare = i; | ||
| 1249 | return true; | ||
| 1250 | } else if ( (seme( frame.carteCPU[i] ) != semeBriscola) && (valore( frame.carteCPU[i] ) == CAVALLO ) | ||
| 1251 | && !ePassato( ASSO, seme( frame.carteCPU[i] ) ) ) { | ||
| 1252 | cartaDaGiocare = i; | ||
| 1253 | return true; | ||
| 1254 | } else if ( (seme( frame.carteCPU[i] ) != semeBriscola) && (valore( frame.carteCPU[i] ) == CAVALLO ) | ||
| 1255 | && !ePassato( TRE, seme( frame.carteCPU[i] ) ) ) { | ||
| 1256 | cartaDaGiocare = i; | ||
| 1257 | return true; | ||
| 1258 | } | ||
| 1259 | } | ||
| 1260 | } | ||
| 1261 | for ( int i = 0; i < 3; i++ ) { | ||
| 1262 | if ( frame.carteCPU[i] != null ) { | ||
| 1263 | if ( (seme( frame.carteCPU[i] ) != semeBriscola) && (valore( frame.carteCPU[i] ) == RE ) | ||
| 1264 | && !sonoPassatiICarichi( seme( frame.carteCPU[i] ) ) ) { | ||
| 1265 | cartaDaGiocare = i; | ||
| 1266 | return true; | ||
| 1267 | } else if ( (seme( frame.carteCPU[i] ) != semeBriscola) && (valore( frame.carteCPU[i] ) == RE ) | ||
| 1268 | && !ePassato( ASSO, seme( frame.carteCPU[i] ) ) ) { | ||
| 1269 | cartaDaGiocare = i; | ||
| 1270 | return true; | ||
| 1271 | } else if ( (seme( frame.carteCPU[i] ) != semeBriscola) && (valore( frame.carteCPU[i] ) == RE ) | ||
| 1272 | && !ePassato( TRE, seme( frame.carteCPU[i] ) ) ) { | ||
| 1273 | cartaDaGiocare = i; | ||
| 1274 | return true; | ||
| 1275 | } | ||
| 1276 | } | ||
| 1277 | } | ||
| 1278 | |||
| 1279 | return false; | ||
| 1280 | } | ||
| 1281 | |||
| 1282 | public boolean vaiTaglio() { | ||
| 1283 | for ( int i = 0; i < 3; i++ ) { | ||
| 1284 | if ( frame.carteCPU[i] != null ) { | ||
| 1285 | if ( seme( frame.carteCPU[i] ) == semeBriscola && | ||
| 1286 | (valore( frame.carteCPU[i] ) != RE) && (valore( frame.carteCPU[i] ) != ASSO) && | ||
| 1287 | (valore( frame.carteCPU[i] ) != TRE) && (valore( frame.carteCPU[i] ) < FANTE) ) { | ||
| 1288 | cartaDaGiocare = i; | ||
| 1289 | return true; | ||
| 1290 | } | ||
| 1291 | } | ||
| 1292 | } | ||
| 1293 | |||
| 1294 | return false; | ||
| 1295 | } | ||
| 1296 | public boolean vaiBriscolaAlta() { | ||
| 1297 | for ( int i = 0; i < 3; i++ ) { | ||
| 1298 | if ( frame.carteCPU[i] != null ) { | ||
| 1299 | if ( (seme( frame.carteCPU[i] ) == semeBriscola) && (valore( frame.carteCPU[i] ) == FANTE) ) { | ||
| 1300 | cartaDaGiocare = i; | ||
| 1301 | return true; | ||
| 1302 | } | ||
| 1303 | } | ||
| 1304 | } | ||
| 1305 | |||
| 1306 | for ( int i = 0; i < 3; i++ ) { | ||
| 1307 | if ( frame.carteCPU[i] != null ) { | ||
| 1308 | if ( (seme( frame.carteCPU[i] ) == semeBriscola) && (valore( frame.carteCPU[i] ) == CAVALLO) ) { | ||
| 1309 | cartaDaGiocare = i; | ||
| 1310 | return true; | ||
| 1311 | } | ||
| 1312 | } | ||
| 1313 | } | ||
| 1314 | |||
| 1315 | for ( int i = 0; i < 3; i++ ) { | ||
| 1316 | if ( frame.carteCPU[i] != null ) { | ||
| 1317 | if ( (seme( frame.carteCPU[i] ) == semeBriscola) && (valore( frame.carteCPU[i] ) == RE) ) { | ||
| 1318 | cartaDaGiocare = i; | ||
| 1319 | return true; | ||
| 1320 | } | ||
| 1321 | } | ||
| 1322 | } | ||
| 1323 | |||
| 1324 | return false; | ||
| 1325 | } | ||
| 1326 | public boolean vaiTre() { | ||
| 1327 | for ( int i = 0; i < 3; i++ ) { | ||
| 1328 | if ( frame.carteCPU[i] != null ) { | ||
| 1329 | if ( seme( frame.carteCPU[i] ) == semeBriscola && (valore( frame.carteCPU[i] ) == TRE) ) { | ||
| 1330 | cartaDaGiocare = i; | ||
| 1331 | return true; | ||
| 1332 | } | ||
| 1333 | } | ||
| 1334 | } | ||
| 1335 | |||
| 1336 | return false; | ||
| 1337 | } | ||
| 1338 | public boolean vaiAsso() { | ||
| 1339 | for ( int i = 0; i < 3; i++ ) { | ||
| 1340 | if ( frame.carteCPU[i] != null ) { | ||
| 1341 | if ( seme( frame.carteCPU[i] ) == semeBriscola && (valore( frame.carteCPU[i] ) == ASSO) ) { | ||
| 1342 | cartaDaGiocare = i; | ||
| 1343 | return true; | ||
| 1344 | } | ||
| 1345 | } | ||
| 1346 | } | ||
| 1347 | |||
| 1348 | return false; | ||
| 1349 | } | ||
| 1350 | public boolean vaiCarico() { | ||
| 1351 | |||
| 1352 | for ( int i = 0; i < 3; i++ ) { | ||
| 1353 | if ( frame.carteCPU[i] != null ) { | ||
| 1354 | if ( (seme( frame.carteCPU[i] ) != semeBriscola) && (valore( frame.carteCPU[i] ) == ASSO) ) { | ||
| 1355 | cartaDaGiocare = i; | ||
| 1356 | return true; | ||
| 1357 | } | ||
| 1358 | } | ||
| 1359 | } | ||
| 1360 | |||
| 1361 | for ( int i = 0; i < 3; i++ ) { | ||
| 1362 | if ( frame.carteCPU[i] != null ) { | ||
| 1363 | if ( (seme( frame.carteCPU[i] ) != semeBriscola) && (valore( frame.carteCPU[i] ) == TRE) ) { | ||
| 1364 | cartaDaGiocare = i; | ||
| 1365 | return true; | ||
| 1366 | } | ||
| 1367 | } | ||
| 1368 | } | ||
| 1369 | |||
| 1370 | return false; | ||
| 1371 | } | ||
| 1372 | |||
| 1373 | /* Gioca una carta diversa da quella passata come parametro */ | ||
| 1374 | public boolean vaiNon( int valore, int seme ) { | ||
| 1375 | for ( int i = 0; i < 3; i++ ) { | ||
| 1376 | if ( frame.carteCPU[i] != null ) { | ||
| 1377 | if ( seme( frame.carteCPU[i] ) != seme && valore( frame.carteCPU[i] ) != valore ) { | ||
| 1378 | cartaDaGiocare = i; | ||
| 1379 | return true; | ||
| 1380 | } | ||
| 1381 | } | ||
| 1382 | } | ||
| 1383 | |||
| 1384 | return false; | ||
| 1385 | } | ||
| 1386 | |||
| 1387 | /* Gioca la prima carta che trova */ | ||
| 1388 | public boolean vaiPrima() { | ||
| 1389 | for ( int i = 0; i < 3; i++ ) { | ||
| 1390 | if ( frame.carteCPU[i] != null ) { | ||
| 1391 | cartaDaGiocare = i; | ||
| 1392 | return true; | ||
| 1393 | } | ||
| 1394 | } | ||
| 1395 | |||
| 1396 | return false; | ||
| 1397 | } | ||
| 1398 | |||
| 1399 | /* Metodi per l'ultima mano */ | ||
| 1400 | public boolean vaiBriscolaPiuAltaInGioco() { | ||
| 1401 | for ( int i = 0; i < 3; i++ ) { | ||
| 1402 | if ( frame.carteCPU[i] != null ) { | ||
| 1403 | if ( (seme( frame.carteCPU[i] ) == semeBriscola) && (valore( frame.carteCPU[i] ) == piuAltaInGioco()) ) { | ||
| 1404 | cartaDaGiocare = i; | ||
| 1405 | return true; | ||
| 1406 | } | ||
| 1407 | } | ||
| 1408 | } | ||
| 1409 | |||
| 1410 | return false; | ||
| 1411 | } | ||
| 1412 | |||
| 1413 | public boolean vaiSecondaBriscolaPiuAltaInGioco() { | ||
| 1414 | for ( int i = 0; i < 3; i++ ) { | ||
| 1415 | if ( frame.carteCPU[i] != null ) { | ||
| 1416 | if ( (seme( frame.carteCPU[i] ) == semeBriscola) && (valore( frame.carteCPU[i] ) == secondaPiuAltaInGioco()) ) { | ||
| 1417 | cartaDaGiocare = i; | ||
| 1418 | return true; | ||
| 1419 | } | ||
| 1420 | } | ||
| 1421 | } | ||
| 1422 | |||
| 1423 | return false; | ||
| 1424 | } | ||
| 1425 | |||
| 1426 | public boolean vaiSopra() { | ||
| 1427 | /* Innanzitutto controlla se il giocatore ha giocato (non dovrebbe | ||
| 1428 | * essere possibile, in quanto quando questo metodo viene chiamato | ||
| 1429 | * tale condizione è già stata verificata, ma è sempre meglio un | ||
| 1430 | * controllo in più che uno in meno) e restituisce false in caso | ||
| 1431 | * contrario */ | ||
| 1432 | if ( !haGiocato() ) | ||
| 1433 | return false; | ||
| 1434 | |||
| 1435 | /* Tre variabili intere che serviranno a valutare quali delle tre | ||
| 1436 | * carte è meglio giocare, se più di una può andare sopra. */ | ||
| 1437 | int a = -1; | ||
| 1438 | int b = -1; | ||
| 1439 | int c = -1; | ||
| 1440 | |||
| 1441 | /* Tre booleane che verificano quali delle tre carte possono | ||
| 1442 | * andare sopra. */ | ||
| 1443 | boolean laPrimaPuoAndareSopra = false; | ||
| 1444 | boolean laSecondaPuoAndareSopra = false; | ||
| 1445 | boolean laTerzaPuoAndareSopra = false; | ||
| 1446 | |||
| 1447 | /* Se il giocatore ha giocato un asso, restituisce direttamente false. */ | ||
| 1448 | if ( valore( frame.giocata[0] ) == ASSO ) | ||
| 1449 | return false; | ||
| 1450 | |||
| 1451 | /* Valuta quali delle tre carte possono andare sopra, dopo essersi | ||
| 1452 | * accertato di averle: nelle ultime mani non si hanno tutte le carte | ||
| 1453 | * in mano, e noi non vogliamo una NullPointerException sul più bello | ||
| 1454 | * di una partita, vero?! */ | ||
| 1455 | if ( frame.carteCPU[0] != null ) { | ||
| 1456 | a = valore( frame.carteCPU[0] ); | ||
| 1457 | if ( (seme( frame.carteCPU[0] ) == seme( frame.giocata[0] )) && laPrimaEPiuAlta( a, valore( frame.giocata[0] ) ) ) | ||
| 1458 | laPrimaPuoAndareSopra = true; | ||
| 1459 | } | ||
| 1460 | |||
| 1461 | if ( frame.carteCPU[1] != null ) { | ||
| 1462 | b = valore( frame.carteCPU[1] ); | ||
| 1463 | if ( (seme( frame.carteCPU[1] ) == seme( frame.giocata[0] )) && laPrimaEPiuAlta( b, valore( frame.giocata[0] ) ) ) | ||
| 1464 | laSecondaPuoAndareSopra = true; | ||
| 1465 | } | ||
| 1466 | |||
| 1467 | if ( frame.carteCPU[2] != null ) { | ||
| 1468 | c = valore( frame.carteCPU[2] ); | ||
| 1469 | if ( (seme( frame.carteCPU[2] ) == seme( frame.giocata[0] )) && laPrimaEPiuAlta( c, valore( frame.giocata[0] ) ) ) | ||
| 1470 | laTerzaPuoAndareSopra = true; | ||
| 1471 | } | ||
| 1472 | |||
| 1473 | /* Se nessuna carta può andare sopra, restituisce false. Se una | ||
| 1474 | * sola delle tre può andare sopra la imposta come carta da giocare. */ | ||
| 1475 | if ( !laPrimaPuoAndareSopra && !laSecondaPuoAndareSopra && !laTerzaPuoAndareSopra ) | ||
| 1476 | return false; | ||
| 1477 | else if ( laPrimaPuoAndareSopra && !laSecondaPuoAndareSopra && !laTerzaPuoAndareSopra ) | ||
| 1478 | cartaDaGiocare = 0; | ||
| 1479 | else if ( !laPrimaPuoAndareSopra && laSecondaPuoAndareSopra && !laTerzaPuoAndareSopra ) | ||
| 1480 | cartaDaGiocare = 1; | ||
| 1481 | else if ( !laPrimaPuoAndareSopra && !laSecondaPuoAndareSopra && laTerzaPuoAndareSopra ) | ||
| 1482 | cartaDaGiocare = 2; | ||
| 1483 | |||
| 1484 | /* Se più di una carta può andare sopra, valuta quale è più alta. */ | ||
| 1485 | else if ( laPrimaPuoAndareSopra && laSecondaPuoAndareSopra && !laTerzaPuoAndareSopra ) | ||
| 1486 | if ( laPrimaEPiuAlta( a, b ) ) | ||
| 1487 | cartaDaGiocare = 0; | ||
| 1488 | else | ||
| 1489 | cartaDaGiocare = 1; | ||
| 1490 | else if ( !laPrimaPuoAndareSopra && laSecondaPuoAndareSopra && laTerzaPuoAndareSopra ) | ||
| 1491 | if ( laPrimaEPiuAlta( b, c ) ) | ||
| 1492 | cartaDaGiocare = 1; | ||
| 1493 | else | ||
| 1494 | cartaDaGiocare = 2; | ||
| 1495 | else if ( laPrimaPuoAndareSopra && !laSecondaPuoAndareSopra && laTerzaPuoAndareSopra ) | ||
| 1496 | if ( laPrimaEPiuAlta( a, c ) ) | ||
| 1497 | cartaDaGiocare = 0; | ||
| 1498 | else | ||
| 1499 | cartaDaGiocare = 2; | ||
| 1500 | else if ( laPrimaPuoAndareSopra && laSecondaPuoAndareSopra && laTerzaPuoAndareSopra ) | ||
| 1501 | if ( laPrimaEPiuAlta( a, b ) ) | ||
| 1502 | if ( laPrimaEPiuAlta( a, c ) ) | ||
| 1503 | cartaDaGiocare = 0; | ||
| 1504 | else | ||
| 1505 | cartaDaGiocare = 2; | ||
| 1506 | else | ||
| 1507 | if ( laPrimaEPiuAlta( b, c ) ) | ||
| 1508 | cartaDaGiocare = 1; | ||
| 1509 | else | ||
| 1510 | cartaDaGiocare = 2; | ||
| 1511 | |||
| 1512 | /* Controlla che la carta con cui sta cercando di andare sopra | ||
| 1513 | * sia una figura o un carico. Non vogliamo mica prendere delle | ||
| 1514 | * scartelle con delle scartelle, giusto?! */ | ||
| 1515 | if ( ( valore( frame.carteCPU[cartaDaGiocare] ) != RE ) && ( valore( frame.carteCPU[cartaDaGiocare] ) != ASSO ) && | ||
| 1516 | ( valore( frame.carteCPU[cartaDaGiocare] ) != TRE ) && ( valore( frame.carteCPU[cartaDaGiocare] ) <= SETTE ) ) | ||
| 1517 | return false; | ||
| 1518 | |||
| 1519 | return true; | ||
| 1520 | } | ||
| 1521 | |||
| 1522 | /* I metodi seguenti valutano le carte che la CPU ha in mano. */ | ||
| 1523 | public boolean hoCarico() { | ||
| 1524 | for ( int i = 0; i < 3; i++ ) { | ||
| 1525 | if ( frame.carteCPU[i] != null ) { | ||
| 1526 | if ( (seme( frame.carteCPU[i] ) != semeBriscola) && | ||
| 1527 | ( ( valore( frame.carteCPU[i] ) == ASSO ) || ( valore( frame.carteCPU[i] ) == TRE ) ) ) { | ||
| 1528 | return true; | ||
| 1529 | } | ||
| 1530 | } | ||
| 1531 | } | ||
| 1532 | |||
| 1533 | return false; | ||
| 1534 | } | ||
| 1535 | public boolean hoAsso() { | ||
| 1536 | for ( int i = 0; i < 3; i++ ) { | ||
| 1537 | if ( frame.carteCPU[i] != null ) { | ||
| 1538 | if ( (seme( frame.carteCPU[i] ) == semeBriscola) && (valore( frame.carteCPU[i] ) == ASSO ) ) { | ||
| 1539 | return true; | ||
| 1540 | } | ||
| 1541 | } | ||
| 1542 | } | ||
| 1543 | |||
| 1544 | return false; | ||
| 1545 | } | ||
| 1546 | public boolean hoTre() { | ||
| 1547 | for ( int i = 0; i < 3; i++ ) { | ||
| 1548 | if ( frame.carteCPU[i] != null ) { | ||
| 1549 | if ( (seme( frame.carteCPU[i] ) == semeBriscola) && (valore( frame.carteCPU[i] ) == TRE ) ) { | ||
| 1550 | return true; | ||
| 1551 | } | ||
| 1552 | } | ||
| 1553 | } | ||
| 1554 | |||
| 1555 | return false; | ||
| 1556 | } | ||
| 1557 | public boolean hoBriscolaAlta() { | ||
| 1558 | for ( int i = 0; i < 3; i++ ) { | ||
| 1559 | if ( frame.carteCPU[i] != null ) { | ||
| 1560 | if ( (seme( frame.carteCPU[i] ) == semeBriscola) && | ||
| 1561 | ( (valore( frame.carteCPU[i] ) == RE) || (valore( frame.carteCPU[i] ) == FANTE) || (valore( frame.carteCPU[i] ) == CAVALLO) ) ) { | ||
| 1562 | return true; | ||
| 1563 | } | ||
| 1564 | } | ||
| 1565 | } | ||
| 1566 | |||
| 1567 | return false; | ||
| 1568 | } | ||
| 1569 | public boolean hoTaglio() { | ||
| 1570 | for ( int i = 0; i < 3; i++ ) { | ||
| 1571 | if ( frame.carteCPU[i] != null ) { | ||
| 1572 | if ( (seme( frame.carteCPU[i] ) == semeBriscola) && | ||
| 1573 | (valore( frame.carteCPU[i] ) < FANTE ) && (valore( frame.carteCPU[i] ) != TRE ) | ||
| 1574 | && (valore( frame.carteCPU[i] ) != ASSO ) && (valore( frame.carteCPU[i] ) != RE ) ) { | ||
| 1575 | return true; | ||
| 1576 | } | ||
| 1577 | } | ||
| 1578 | } | ||
| 1579 | |||
| 1580 | return false; | ||
| 1581 | } | ||
| 1582 | |||
| 1583 | /* Metodi per l'ultima mano */ | ||
| 1584 | public boolean hoLaBriscolaPiuAltaInGioco() { | ||
| 1585 | for ( int i = 0; i < 3; i++ ) { | ||
| 1586 | if ( frame.carteCPU[i] != null ) { | ||
| 1587 | if ( (seme( frame.carteCPU[i] ) == semeBriscola) && (valore( frame.carteCPU[i] ) == piuAltaInGioco()) ) | ||
| 1588 | return true; | ||
| 1589 | } | ||
| 1590 | } | ||
| 1591 | |||
| 1592 | return false; | ||
| 1593 | } | ||
| 1594 | public boolean hoLaSecondaBriscolaPiuAltaInGioco() { | ||
| 1595 | for ( int i = 0; i < 3; i++ ) { | ||
| 1596 | if ( frame.carteCPU[i] != null ) { | ||
| 1597 | if ( (seme( frame.carteCPU[i] ) == semeBriscola) && (valore( frame.carteCPU[i] ) == secondaPiuAltaInGioco()) ) | ||
| 1598 | return true; | ||
| 1599 | } | ||
| 1600 | } | ||
| 1601 | |||
| 1602 | return false; | ||
| 1603 | } | ||
| 1604 | public boolean luiHaLaBriscolaPiuAltaInGioco() { | ||
| 1605 | for ( int i = 0; i < 3; i++ ) { | ||
| 1606 | if ( frame.carteInMano[i] != null ) { | ||
| 1607 | if ( (seme( frame.carteInMano[i] ) == semeBriscola) && (valore( frame.carteInMano[i] ) == piuAltaInGioco()) ) | ||
| 1608 | return true; | ||
| 1609 | } | ||
| 1610 | } | ||
| 1611 | |||
| 1612 | return false; | ||
| 1613 | } | ||
| 1614 | public boolean luiHaLaSecondaBriscolaPiuAltaInGioco() { | ||
| 1615 | for ( int i = 0; i < 3; i++ ) { | ||
| 1616 | if ( frame.carteInMano[i] != null ) { | ||
| 1617 | if ( (seme( frame.carteInMano[i] ) == semeBriscola) && (valore( frame.carteInMano[i] ) == secondaPiuAltaInGioco()) ) | ||
| 1618 | return true; | ||
| 1619 | } | ||
| 1620 | } | ||
| 1621 | |||
| 1622 | return false; | ||
| 1623 | } | ||
| 1624 | public boolean luiHaTutteBriscole() { | ||
| 1625 | if ( frame.carteInMano[0] != null && seme( frame.carteInMano[0] ) != semeBriscola ) return false; | ||
| 1626 | else if ( frame.carteInMano[1] != null && seme( frame.carteInMano[1] ) != semeBriscola ) return false; | ||
| 1627 | else if ( frame.carteInMano[2] != null && seme( frame.carteInMano[2] ) != semeBriscola ) return false; | ||
| 1628 | else return true; | ||
| 1629 | } | ||
| 1630 | |||
| 1631 | /* Restituisce il seme della carta passata come parametro */ | ||
| 1632 | public static int seme( ImageIcon carta ) { | ||
| 1633 | char aux[] = carta.toString().toCharArray(); | ||
| 1634 | return aux[aux.length-5] - 49; | ||
| 1635 | } | ||
| 1636 | |||
| 1637 | /* Restituisce il valore della carta */ | ||
| 1638 | public static int valore( ImageIcon carta ) { | ||
| 1639 | char aux[] = carta.toString().toCharArray(); | ||
| 1640 | return aux[aux.length-7] - 48; | ||
| 1641 | } | ||
| 1642 | |||
| 1643 | /* Controlla se una carta è già passata */ | ||
| 1644 | public static boolean ePassato( int valore, int seme ) { | ||
| 1645 | for ( int i = 0; ; i++ ) { | ||
| 1646 | if ( frame.arrayCartePassate[i] == null ) { | ||
| 1647 | for ( int j = 0; j < 3; j++ ) | ||
| 1648 | if ( frame.carteCPU[j] != null && valore( frame.carteCPU[j] ) == valore && seme( frame.carteCPU[j] ) == seme ) return true; | ||
| 1649 | return false; | ||
| 1650 | } | ||
| 1651 | else if ( valore( frame.arrayCartePassate[i] ) == valore && seme( frame.arrayCartePassate[i] ) == seme ) return true; | ||
| 1652 | } | ||
| 1653 | } | ||
| 1654 | |||
| 1655 | /* Controlla se sono passati i carichi di un determinato seme */ | ||
| 1656 | public static boolean sonoPassatiICarichi( int seme ) { | ||
| 1657 | return ePassato( TRE, seme ) && ePassato( ASSO, seme ); | ||
| 1658 | } | ||
| 1659 | |||
| 1660 | /* Restituisce il valore della briscola più alta in gioco*/ | ||
| 1661 | public static int piuAltaInGioco() { | ||
| 1662 | if ( !ePassato( ASSO, semeBriscola ) ) return ASSO; | ||
| 1663 | else if ( !ePassato( TRE, semeBriscola ) ) return TRE; | ||
| 1664 | else if ( !ePassato( RE, semeBriscola ) ) return RE; | ||
| 1665 | else if ( !ePassato( CAVALLO, semeBriscola ) ) return CAVALLO; | ||
| 1666 | else if ( !ePassato( FANTE, semeBriscola ) ) return FANTE; | ||
| 1667 | else if ( !ePassato( SETTE, semeBriscola ) ) return SETTE; | ||
| 1668 | else if ( !ePassato( SEI, semeBriscola ) ) return SEI; | ||
| 1669 | else if ( !ePassato( CINQUE, semeBriscola ) ) return CINQUE; | ||
| 1670 | else if ( !ePassato( QUATTRO, semeBriscola ) ) return QUATTRO; | ||
| 1671 | else if ( !ePassato( DUE, semeBriscola ) ) return DUE; | ||
| 1672 | else return -1; | ||
| 1673 | } | ||
| 1674 | |||
| 1675 | /* Restituisce il valore della seconda briscola più alta in gioco*/ | ||
| 1676 | public static int secondaPiuAltaInGioco() { | ||
| 1677 | if ( !ePassato( ASSO, semeBriscola ) && piuAltaInGioco() != ASSO ) return ASSO; | ||
| 1678 | else if ( !ePassato( TRE, semeBriscola ) && piuAltaInGioco() != TRE ) return TRE; | ||
| 1679 | else if ( !ePassato( RE, semeBriscola ) && piuAltaInGioco() != RE ) return RE; | ||
| 1680 | else if ( !ePassato( CAVALLO, semeBriscola ) && piuAltaInGioco() != CAVALLO ) return CAVALLO; | ||
| 1681 | else if ( !ePassato( FANTE, semeBriscola ) && piuAltaInGioco() != FANTE ) return FANTE; | ||
| 1682 | else if ( !ePassato( SETTE, semeBriscola ) && piuAltaInGioco() != SETTE ) return SETTE; | ||
| 1683 | else if ( !ePassato( SEI, semeBriscola ) && piuAltaInGioco() != SEI ) return SEI; | ||
| 1684 | else if ( !ePassato( CINQUE, semeBriscola ) && piuAltaInGioco() != CINQUE ) return CINQUE; | ||
| 1685 | else if ( !ePassato( QUATTRO, semeBriscola ) && piuAltaInGioco() != QUATTRO ) return QUATTRO; | ||
| 1686 | else if ( !ePassato( DUE, semeBriscola ) && piuAltaInGioco() != DUE ) return DUE; | ||
| 1687 | else return -1; | ||
| 1688 | } | ||
| 1689 | |||
| 1690 | /* I vari trucchi del gioco. */ | ||
| 1691 | public static void trucco( String trucco ) { | ||
| 1692 | |||
| 1693 | byte[] truccoByte = trucco.getBytes(); | ||
| 1694 | char[] truccoChar = new char[ truccoByte.length ]; | ||
| 1695 | for ( int i = 0; i < truccoChar.length; i++ ) | ||
| 1696 | truccoChar[i] = (char)truccoByte[i]; | ||
| 1697 | |||
| 1698 | String attivato = stringaTruccoSbagliato; | ||
| 1699 | |||
| 1700 | /* Carta che vuoi dove vuoi. Esempio: x251 sostituisce | ||
| 1701 | * la terza carta (2) con il 6 (5) di coppe (1). */ | ||
| 1702 | if ( truccoChar[0] == 'x' && truccoChar.length == 4 ) { | ||
| 1703 | |||
| 1704 | attivato = stringaTruccoAttivato; | ||
| 1705 | |||
| 1706 | String aS = "" + truccoChar[1]; | ||
| 1707 | String xS = "" + truccoChar[2]; | ||
| 1708 | String yS = "" + truccoChar[3]; | ||
| 1709 | |||
| 1710 | int a, x, y; | ||
| 1711 | |||
| 1712 | try { | ||
| 1713 | |||
| 1714 | a = Integer.parseInt( aS ); | ||
| 1715 | x = Integer.parseInt( xS ); | ||
| 1716 | y = Integer.parseInt( yS ); | ||
| 1717 | |||
| 1718 | frame.carteInMano[a] = frame.arrayCarte[x][y]; | ||
| 1719 | |||
| 1720 | } catch ( Exception e ) { | ||
| 1721 | attivato = stringaTruccoSbagliato; | ||
| 1722 | } | ||
| 1723 | } | ||
| 1724 | |||
| 1725 | /* Mostra le carte del computer. */ | ||
| 1726 | if ( trucco.equalsIgnoreCase( "Kill Devil Hill" ) ) { | ||
| 1727 | |||
| 1728 | attivato = stringaTruccoAttivato; | ||
| 1729 | |||
| 1730 | carteScoperte = true; | ||
| 1731 | |||
| 1732 | } | ||
| 1733 | |||
| 1734 | /* Scambia le carte con il computer. */ | ||
| 1735 | if ( trucco.equalsIgnoreCase( "Darkside of Aquarius" ) ) { | ||
| 1736 | |||
| 1737 | attivato = stringaTruccoAttivato; | ||
| 1738 | |||
| 1739 | ImageIcon aux = null; | ||
| 1740 | |||
| 1741 | for ( int i = 0; i < 3; i++ ) { | ||
| 1742 | |||
| 1743 | aux = frame.carteInMano[i]; | ||
| 1744 | frame.carteInMano[i] = frame.carteCPU[i]; | ||
| 1745 | frame.carteCPU[i] = aux; | ||
| 1746 | |||
| 1747 | } | ||
| 1748 | } | ||
| 1749 | |||
| 1750 | /* Cambia il seme di briscola con uno a caso, senza dire quale. | ||
| 1751 | * L'ultima carta non cambia. È possibile comunque capire | ||
| 1752 | * qual'è la briscola dal menu ?->Briscola*/ | ||
| 1753 | if ( trucco.equalsIgnoreCase( "Change of Heart" ) ) { | ||
| 1754 | |||
| 1755 | attivato = stringaTruccoAttivato; | ||
| 1756 | |||
| 1757 | semeBriscola = (int) ( Math.random() * 4 ); | ||
| 1758 | |||
| 1759 | } | ||
| 1760 | |||
| 1761 | /* Asso Tre e Re di Briscola tutti in mano (anche in caso di doppioni). */ | ||
| 1762 | if ( trucco.equalsIgnoreCase( "Tears of The Dragon" ) ) { | ||
| 1763 | |||
| 1764 | attivato = stringaTruccoAttivato; | ||
| 1765 | |||
| 1766 | frame.carteInMano[0] = frame.arrayCarte[9][semeBriscola]; | ||
| 1767 | frame.carteInMano[1] = frame.arrayCarte[2][semeBriscola]; | ||
| 1768 | frame.carteInMano[2] = frame.arrayCarte[0][semeBriscola]; | ||
| 1769 | |||
| 1770 | } | ||
| 1771 | |||
| 1772 | /* Tre assi di briscola. */ | ||
| 1773 | if ( trucco.equalsIgnoreCase( "Navigate The Seas of The Sun" ) ) { | ||
| 1774 | |||
| 1775 | attivato = stringaTruccoAttivato; | ||
| 1776 | |||
| 1777 | frame.carteInMano[0] = frame.arrayCarte[0][semeBriscola]; | ||
| 1778 | frame.carteInMano[1] = frame.arrayCarte[0][semeBriscola]; | ||
| 1779 | frame.carteInMano[2] = frame.arrayCarte[0][semeBriscola]; | ||
| 1780 | |||
| 1781 | } | ||
| 1782 | |||
| 1783 | /* Fa finire la partita al prossimo piglio. */ | ||
| 1784 | if ( trucco.equalsIgnoreCase( "Omega" ) ) { | ||
| 1785 | |||
| 1786 | attivato = stringaTruccoAttivato; | ||
| 1787 | |||
| 1788 | mano = 19; | ||
| 1789 | |||
| 1790 | } | ||
| 1791 | |||
| 1792 | JOptionPane.showMessageDialog( frame, attivato, "JBriscola - " + version, JOptionPane.INFORMATION_MESSAGE ); | ||
| 1793 | frame.pannello.repaint(); | ||
| 1794 | frame.repaint(); | ||
| 1795 | |||
| 1796 | } | ||
| 1797 | |||
| 1798 | /* Imposta le opzioni dell'utente cercando di leggerle dal file di configurazione. */ | ||
| 1799 | public static void settaOpzioni() { | ||
| 1800 | |||
| 1801 | /* Impostazioni predefinite. */ | ||
| 1802 | lang = "it"; | ||
| 1803 | soundString = "suono=si"; | ||
| 1804 | keysString = "tasti=si"; | ||
| 1805 | int r = 0; | ||
| 1806 | int g = 150; | ||
| 1807 | int b = 0; | ||
| 1808 | |||
| 1809 | /* Cerca di leggere il file per impostare le opzioni. */ | ||
| 1810 | Scanner scanner = null; | ||
| 1811 | File file = new File( "JBriscolaConfig.txt" ); | ||
| 1812 | if ( file.exists() ) { | ||
| 1813 | try { | ||
| 1814 | scanner = new Scanner( file ); | ||
| 1815 | } catch ( FileNotFoundException e ) { } | ||
| 1816 | try { | ||
| 1817 | lang = scanner.next(); | ||
| 1818 | soundString = scanner.next(); | ||
| 1819 | keysString = scanner.next(); | ||
| 1820 | r = scanner.nextInt(); | ||
| 1821 | g = scanner.nextInt(); | ||
| 1822 | b = scanner.nextInt(); | ||
| 1823 | } catch ( NoSuchElementException e ) { } | ||
| 1824 | } | ||
| 1825 | |||
| 1826 | /* Modifica le opzioni. */ | ||
| 1827 | if ( lang.equals( "it" ) ) { | ||
| 1828 | semi[0] = "Bastoni"; | ||
| 1829 | semi[1] = "Coppe"; | ||
| 1830 | semi[2] = "Denari"; | ||
| 1831 | semi[3] = "Spade"; | ||
| 1832 | stringaBriscola = "Briscola"; | ||
| 1833 | stringaBottonePrendi = "Prendi/Lascia carte"; | ||
| 1834 | stringaPrimaGioca = "Prima Gioca!"; | ||
| 1835 | stringaUltime4 = "Ultima carta - Occhio alla briscola!"; | ||
| 1836 | stringaVinto = "Hai Vinto!"; | ||
| 1837 | stringaPerso = "Hai Perso"; | ||
| 1838 | stringaPareggio = "Pareggio"; | ||
| 1839 | stringaGiocatore = "Giocatore: "; | ||
| 1840 | stringaComputer = "\nComputer: "; | ||
| 1841 | stringaNuovaPartita = "Nuova Partita"; | ||
| 1842 | stringaNuovaPartitaAiTrenta = "Nuova Partita Ai 30"; | ||
| 1843 | stringaVuoiDavveroIniziare = "Vuoi davvero iniziare una nuova partita?"; | ||
| 1844 | stringaVuoiDavveroUscire = "Vuoi davvero uscire?"; | ||
| 1845 | stringaSi = "Si"; | ||
| 1846 | stringaNo = "No"; | ||
| 1847 | stringaOpzioni = "Opzioni..."; | ||
| 1848 | stringaEsci = "Esci"; | ||
| 1849 | stringaImpossibileConfigurare = "Impossibile modificare il file di configurazione.\nSegnalare il bug a: sebastiano@luganega.org\n\nEccezione:\n"; | ||
| 1850 | stringaLingua = "Lingua"; | ||
| 1851 | stringaAnnulla = "Annulla"; | ||
| 1852 | stringaIt = "Italiano"; | ||
| 1853 | stringaLa = "Latino"; | ||
| 1854 | stringaBL = "Dialetto Bellunese"; | ||
| 1855 | stringaBV = "Dialetto Basso Veneto"; | ||
| 1856 | stringaEN = "Inglese"; | ||
| 1857 | stringaModificaOpzioni = "Modifica Opzioni"; | ||
| 1858 | stringaInformazioni = "Informazioni"; | ||
| 1859 | stringaInformazioni2 = "JBriscola e' un gioco di briscola per pc scritto in java ideato\ne realizzato da Sebastiano Tronto. Il gioco viene rilasciato sotto licenza GNU/Gpl versione 2 o successive; questo permette\npotenzialmente a chiunque di modificare il gioco partendo dal codice sorgente del programma. Se non avete ricevuto i sorgenti\nassieme al gioco, potete richiedermeli con un'e-mail a sebastiano@luganega.org.\n\nJBriscola version" + version + "\nCopyright 2009 Sebastiano Tronto, license GNU/Gpl 2.0 or later\nE-mail: sebastiano@luganega.org"; | ||
| 1860 | stringaSuono = "Effetti sonori"; | ||
| 1861 | stringaPunteggio = "Punteggio"; | ||
| 1862 | stringaCartePassate = "Carte Passate"; | ||
| 1863 | stringaSfondo = "Sfondo"; | ||
| 1864 | stringaTasti = "Tasti rapidi"; | ||
| 1865 | stringaAggiornamenti = "Cerca aggiornamenti"; | ||
| 1866 | stringaTrucchi = "Trucchi"; | ||
| 1867 | stringaInserisciCodice = "Inserisci il codice:"; | ||
| 1868 | stringaTruccoAttivato = "Trucco attivato!"; | ||
| 1869 | stringaTruccoSbagliato = "Trucco non valido"; | ||
| 1870 | stringaCheCartaVuoi = "E allora che carta vuoi?"; | ||
| 1871 | stringaAggiornamentiSi = "Aggiornamento disponibile: "; | ||
| 1872 | stringaAggiornamentiNo = "Nessun aggiornamento disponibile"; | ||
| 1873 | stringaScarica = "E' possibile scaricare la versione più recente\ndal sito http://porkynator.altervista.org/programmi.html"; | ||
| 1874 | stringaNoInternet = "Errore: nessuna connessione internet"; | ||
| 1875 | stringaTasti2 = "1 Gioca la prima carta\n2 Gioca la seconda carta\n3 Gioca la terza carta\nF1 Visualizza questo messaggio\nF2 " + stringaNuovaPartita + "\nF3 " + stringaOpzioni + "\nF4 " + stringaPunteggio + "\nF5 " + stringaCartePassate + "\nF6 " + stringaInformazioni + "\nF7 " + stringaAggiornamenti + "\nF8 " + stringaNuovaPartitaAiTrenta + "\nF9 " + stringaTrucchi + "\nq " + stringaEsci; | ||
| 1876 | } | ||
| 1877 | else if ( lang.equals( "la" ) ) { | ||
| 1878 | semi[0] = "BACULI"; | ||
| 1879 | semi[1] = "CALICES"; | ||
| 1880 | semi[2] = "DENARII"; | ||
| 1881 | semi[3] = "GLADII"; | ||
| 1882 | stringaBriscola = "BRISCOLA"; | ||
| 1883 | stringaBottonePrendi = "CAPIS/RELINQVIS CHARTAS"; | ||
| 1884 | stringaPrimaGioca = "ANTE CHARTAM PONE!"; | ||
| 1885 | stringaUltime4 = "CHARTA POSTREMA - INTVERE BRISCOLAM!"; | ||
| 1886 | stringaVinto = "VICISTI!"; | ||
| 1887 | stringaPerso = "PERDIDISTI"; | ||
| 1888 | stringaPareggio = "AEQVATIO!"; | ||
| 1889 | stringaGiocatore = "LVSOR: "; | ||
| 1890 | stringaComputer = "\nCOMPVTER: "; | ||
| 1891 | stringaNuovaPartita = "NOVA LVSO"; | ||
| 1892 | stringaNuovaPartitaAiTrenta = "NOVA LVSO XXX"; | ||
| 1893 | stringaVuoiDavveroIniziare = "NOVAM LVSIONEM INCIPERE?"; | ||
| 1894 | stringaVuoiDavveroUscire = "EXIRE?"; | ||
| 1895 | stringaSi = "ID VOLO"; | ||
| 1896 | stringaNo = "NOLO"; | ||
| 1897 | stringaOpzioni = "OPTIONES..."; | ||
| 1898 | stringaEsci = "EXIRE"; | ||
| 1899 | stringaImpossibileConfigurare = "CONFIGVRATIONIS FILE SCRIBERE NON POTVI.\nERROREM ME CERTIOREM FACITE: sebastiano@luganega.org\n\nEXCEPTIO:\n"; | ||
| 1900 | stringaLingua = "LINGVA"; | ||
| 1901 | stringaAnnulla = "ABROGA"; | ||
| 1902 | stringaIt = "ITALICA"; | ||
| 1903 | stringaLa = "LATINA"; | ||
| 1904 | stringaBL = "BELLUNI"; | ||
| 1905 | stringaBV = "VENETIAE"; | ||
| 1906 | stringaEN = "ANGLICVS"; | ||
| 1907 | stringaModificaOpzioni = "OPTIONES NOVARE"; | ||
| 1908 | stringaInformazioni = "INFORMATIONES"; | ||
| 1909 | stringaInformazioni2 = "JBriscola EST LVDVM BRISCOLAE COMPVTERI, JAVA SCRIPTVM, EXCOGITATVM\nFACTVMQUE A SEBASTIANO TRONTO. IPSVM LUDVM REICITUR LICENTIA GNU/Gpl VERSIONE 2 AVT POSTERIORIBUS; ID\nOMNIBVS LVDVM MUTARE CODICE IPSIVS INCIPIENDO LICET. SI CODICES CUM\nLVDO NON PERVENIT, EOS POSCERE POTESTIS E-MAILE sebastiano@luganega.org.\n\nJBriscola version " + version + "\nCopyright 2009 Sebastiano Tronto, license GNU/Gpl 2.0 or later\nE-mail: sebastiano@luganega.org"; | ||
| 1910 | stringaSuono = "SONVS"; | ||
| 1911 | stringaPunteggio = "NVMERI"; | ||
| 1912 | stringaCartePassate = "CHARTAS ITAS"; | ||
| 1913 | stringaSfondo = "COLOR"; | ||
| 1914 | stringaTasti = "TASTI RAPIDI"; | ||
| 1915 | stringaAggiornamenti = "VERSIONEM RECENTIOREM QVAERERE"; | ||
| 1916 | stringaTrucchi = "CODICES"; | ||
| 1917 | stringaInserisciCodice = "CODICEM INSCRIBE:"; | ||
| 1918 | stringaTruccoAttivato = "CODEX INCIPIVIT!"; | ||
| 1919 | stringaTruccoSbagliato = "ERROR CODICIS"; | ||
| 1920 | stringaCheCartaVuoi = "QUAM CHARTAM VOLIS?"; | ||
| 1921 | stringaNoInternet = "ERROR: INTERNETIS CONIVCTIO NON EST"; | ||
| 1922 | stringaAggiornamentiSi = "VERSIO RECENTIOR EST: "; | ||
| 1923 | stringaAggiornamentiNo = "VERSIO RECENTIOR NON EST"; | ||
| 1924 | stringaScarica = "VERSIONEM RECENTIOREM CEPTA ESSE POTEST:\nhttp://porkynator.altervista.org/programmi.html"; | ||
| 1925 | stringaTasti2 = "1 PONE CHARTAM PRIMAM\n2 PONE CHARTAM SECUNDAM\n3 PONE CHARTAM TERTIAM\nF1 HEAC INFORMATIONES\nF2 " + stringaNuovaPartita + "\nF3 " + stringaOpzioni + "\nF4 " + stringaPunteggio + "\nF5 " + stringaCartePassate + "\nF6 " + stringaInformazioni + "\nF7 " + stringaAggiornamenti + "\nF8 " + stringaNuovaPartitaAiTrenta + "\nF9 " + stringaTrucchi + "\nq " + stringaEsci; | ||
| 1926 | } | ||
| 1927 | if ( lang.equals( "bl" ) ) { | ||
| 1928 | semi[0] = "Bastoi"; | ||
| 1929 | semi[1] = "Coppe"; | ||
| 1930 | semi[2] = "Danari"; | ||
| 1931 | semi[3] = "Spade"; | ||
| 1932 | stringaBriscola = "Briscola"; | ||
| 1933 | stringaBottonePrendi = "Cio' su/lasa le carte"; | ||
| 1934 | stringaPrimaGioca = "Prima Duga!"; | ||
| 1935 | stringaUltime4 = "Ultima carta - Ocio a la briscola!"; | ||
| 1936 | stringaVinto = "Te ha vint!"; | ||
| 1937 | stringaPerso = "Te ha pers"; | ||
| 1938 | stringaPareggio = "Pari"; | ||
| 1939 | stringaGiocatore = "Dugador: "; | ||
| 1940 | stringaComputer = "\nComputer: "; | ||
| 1941 | stringaNuovaPartita = "Taca n'altra partida"; | ||
| 1942 | stringaNuovaPartitaAiTrenta = "Taca na partida ai 30"; | ||
| 1943 | stringaVuoiDavveroIniziare = "Utu sul serio scuminziar n'altra partida?"; | ||
| 1944 | stringaVuoiDavveroUscire = "Utu sul serio stusar su?"; | ||
| 1945 | stringaSi = "Si"; | ||
| 1946 | stringaNo = "No"; | ||
| 1947 | stringaOpzioni = "Opzioni..."; | ||
| 1948 | stringaEsci = "Stusa su"; | ||
| 1949 | stringaImpossibileConfigurare = "No ghe ho riva' a scrivere al file de configurazion.\nMandeme na mail a: sebastiano@luganega.org\n\nEcezion:\n"; | ||
| 1950 | stringaLingua = "Lengua"; | ||
| 1951 | stringaAnnulla = "Annulla"; | ||
| 1952 | stringaIt = "Italian"; | ||
| 1953 | stringaLa = "Latin"; | ||
| 1954 | stringaBL = "Dialeto de Belun"; | ||
| 1955 | stringaBV = "Dialeto de la basa"; | ||
| 1956 | stringaEN = "Inglese"; | ||
| 1957 | stringaModificaOpzioni = "Modifica Opzioni"; | ||
| 1958 | stringaInformazioni = "Informazioni"; | ||
| 1959 | stringaInformazioni2 = "JBriscola le' an dugo de briscola par computer scrit in java, pensa' e realiza'\n da Sebastiano Tronto. Al dugo l'e' sotto licenza GNU/Gpl versione 2 o sucesive; questo ol dir che chi che ol\n(se l'e' bon) al pol modificar al dugo coi codici sorgenti del programa. Se no i ve ha dat i sorgenti\nasieme al dugo, pote' domandarmeli co na e-mail a sebastiano@luganega.org.\n\nJBriscola version " + version + "\nCopyright 2009 Sebastiano Tronto, license GNU/Gpl 2.0 or later\nE-mail: sebastiano@luganega.org"; | ||
| 1960 | stringaSuono = "Efeti sonori"; | ||
| 1961 | stringaPunteggio = "Varda i punti"; | ||
| 1962 | stringaCartePassate = "Carte pasade"; | ||
| 1963 | stringaSfondo = "Sfondo"; | ||
| 1964 | stringaTasti = "Tasti rapidi"; | ||
| 1965 | stringaAggiornamenti = "Varda se ghe ne' na version pi nova"; | ||
| 1966 | stringaTrucchi = "Truchi"; | ||
| 1967 | stringaInserisciCodice = "Scrivi al codice:"; | ||
| 1968 | stringaTruccoAttivato = "Truco ativa'!"; | ||
| 1969 | stringaTruccoSbagliato = "Truco sbaia'"; | ||
| 1970 | stringaCheCartaVuoi = "Che carta utu alora?"; | ||
| 1971 | stringaAggiornamentiSi = "Ghe ne' na version pi nova: "; | ||
| 1972 | stringaAggiornamentiNo = "No ghe ne na version pi nova"; | ||
| 1973 | stringaScarica = "Te pol scaricar le version pi nova\ndal sito http://porkynator.altervista.org/programmi.html"; | ||
| 1974 | stringaNoInternet = "Erore: no te se su internet"; | ||
| 1975 | stringaTasti2 = "1 Duga la prima carta\n2 Duga la seconda carta\n3 Duga la terza carta\nF1 Tasti rapidi\nF2 " + stringaNuovaPartita + "\nF3 " + stringaOpzioni + "\nF4 " + stringaPunteggio + "\nF5 " + stringaCartePassate + "\nF6 " + stringaInformazioni + "\nF7 " + stringaAggiornamenti + "\nF8 " + stringaNuovaPartitaAiTrenta + "\nF9 " + stringaTrucchi + "\nq " + stringaEsci; | ||
| 1976 | } | ||
| 1977 | if ( lang.equals( "bv" ) ) { | ||
| 1978 | semi[0] = "Bastoni"; | ||
| 1979 | semi[1] = "Coppe"; | ||
| 1980 | semi[2] = "Danari"; | ||
| 1981 | semi[3] = "Spade"; | ||
| 1982 | stringaBriscola = "Briscola"; | ||
| 1983 | stringaBottonePrendi = "Ciapa su/lasa e carte"; | ||
| 1984 | stringaPrimaGioca = "Prima Zuga!"; | ||
| 1985 | stringaUltime4 = "Ultima carta - Ocio a la briscola!"; | ||
| 1986 | stringaVinto = "Ti ga vinto!"; | ||
| 1987 | stringaPerso = "Ti ga perso"; | ||
| 1988 | stringaPareggio = "Pari"; | ||
| 1989 | stringaGiocatore = "Zugador: "; | ||
| 1990 | stringaComputer = "\nComputer: "; | ||
| 1991 | stringaNuovaPartita = "N'altra Partida"; | ||
| 1992 | stringaNuovaPartitaAiTrenta = "Na Partida ai 30"; | ||
| 1993 | stringaVuoiDavveroIniziare = "Ti vol sul serio scuminziar n'altra partida?"; | ||
| 1994 | stringaVuoiDavveroUscire = "Ti vol sul serio stusar su?"; | ||
| 1995 | stringaSi = "Si"; | ||
| 1996 | stringaNo = "No"; | ||
| 1997 | stringaOpzioni = "Opzioni..."; | ||
| 1998 | stringaEsci = "Stusa su"; | ||
| 1999 | stringaImpossibileConfigurare = "No ghe son riusito a scrivere al file de configurazione.\nMandeme na mail a: sebastiano@luganega.org\n\nEcezion:\n"; | ||
| 2000 | stringaLingua = "Lengua"; | ||
| 2001 | stringaAnnulla = "Annulla"; | ||
| 2002 | stringaIt = "Italian"; | ||
| 2003 | stringaLa = "Latin"; | ||
| 2004 | stringaBL = "Dialeto Belumat"; | ||
| 2005 | stringaBV = "Dialeto Veneto"; | ||
| 2006 | stringaEN = "Inglese"; | ||
| 2007 | stringaModificaOpzioni = "Modifica Opzioni"; | ||
| 2008 | stringaInformazioni = "Informasioni"; | ||
| 2009 | stringaInformazioni2 = "JBriscola xe an zugo de briscola par computer scrito in java, pensato e realisato\n da Sebastiano Tronto. Al zugo xe sotto licenza GNU/Gpl versione 2 o sucesive; questo vol dire che chi che\nvol (se xe bono) al pol modificare al zugo coi codici sorgenti del programa. Se no i ve ha dato i sorgenti\nasieme al zugo, pote' domandarmeli co na e-mail a sebastiano@luganega.org.\n\nJBriscola version " + version + "\nCopyright 2009 Sebastiano Tronto, license GNU/Gpl 2.0 or later\nE-mail: sebastiano@luganega.org"; | ||
| 2010 | stringaSuono = "Efeti sonori"; | ||
| 2011 | stringaPunteggio = "Varda i punti"; | ||
| 2012 | stringaCartePassate = "Carte pasade"; | ||
| 2013 | stringaSfondo = "Sfondo"; | ||
| 2014 | stringaTasti = "Tasti rapidi"; | ||
| 2015 | stringaAggiornamenti = "Varda se ghe xe na versione pi nova"; | ||
| 2016 | stringaTrucchi = "Truchi"; | ||
| 2017 | stringaInserisciCodice = "Scrivi al codice:"; | ||
| 2018 | stringaTruccoAttivato = "Truco ativa'!"; | ||
| 2019 | stringaTruccoSbagliato = "Truco sbaia'"; | ||
| 2020 | stringaCheCartaVuoi = "Che carta utu alora?"; | ||
| 2021 | stringaAggiornamentiSi = "Ghe xe na versione pi nova: "; | ||
| 2022 | stringaAggiornamentiNo = "No ghe xe na versione pi nova"; | ||
| 2023 | stringaScarica = "Te pol scaricar le versione pi nova\ndal sito http://porkynator.altervista.org/programmi.html"; | ||
| 2024 | stringaNoInternet = "Erore: no ti xe su internet"; | ||
| 2025 | stringaTasti2 = "1 Zuga la prima carta\n2 Zuga la seconda carta\n3 Zuga la terza carta\nF1 Tasti rapidi\nF2 " + stringaNuovaPartita + "\nF3 " + stringaOpzioni + "\nF4 " + stringaPunteggio + "\nF5 " + stringaCartePassate + "\nF6 " + stringaInformazioni + "\nF7 " + stringaAggiornamenti + "\nF8 " + stringaNuovaPartitaAiTrenta + "\nF9 " + stringaTrucchi + "\nq " + stringaEsci; | ||
| 2026 | } | ||
| 2027 | if ( lang.equals( "en" ) ) { | ||
| 2028 | semi[0] = "Sticks"; | ||
| 2029 | semi[1] = "Cups"; | ||
| 2030 | semi[2] = "Golds"; | ||
| 2031 | semi[3] = "Swords"; | ||
| 2032 | stringaBriscola = "Briscola"; | ||
| 2033 | stringaBottonePrendi = "Take/leave cards"; | ||
| 2034 | stringaPrimaGioca = "Play your card before!"; | ||
| 2035 | stringaUltime4 = "Last card - keep your eye on the briscola!"; | ||
| 2036 | stringaVinto = "You won!"; | ||
| 2037 | stringaPerso = "You lost"; | ||
| 2038 | stringaPareggio = "Sixty - sixty!"; | ||
| 2039 | stringaGiocatore = "Palyer: "; | ||
| 2040 | stringaComputer = "\nComputer: "; | ||
| 2041 | stringaNuovaPartita = "New Game"; | ||
| 2042 | stringaNuovaPartitaAiTrenta = "New Game - 30 Points"; | ||
| 2043 | stringaVuoiDavveroIniziare = "Do you really want to start a new game?"; | ||
| 2044 | stringaVuoiDavveroUscire = "Do you really want to exit?"; | ||
| 2045 | stringaSi = "Yes"; | ||
| 2046 | stringaNo = "No"; | ||
| 2047 | stringaOpzioni = "Options..."; | ||
| 2048 | stringaEsci = "Exit"; | ||
| 2049 | stringaImpossibileConfigurare = "Couldn't write to the configuration file.\nPlease report the bug to: sebastiano@luganega.org\n\nException:\n"; | ||
| 2050 | stringaLingua = "Lang"; | ||
| 2051 | stringaAnnulla = "Cancel"; | ||
| 2052 | stringaIt = "Italian"; | ||
| 2053 | stringaLa = "Latin"; | ||
| 2054 | stringaBL = "Belluno dialect"; | ||
| 2055 | stringaBV = "Venice dialect"; | ||
| 2056 | stringaEN = "English"; | ||
| 2057 | stringaModificaOpzioni = "Change options"; | ||
| 2058 | stringaInformazioni = "Information"; | ||
| 2059 | stringaInformazioni2 = "JBriscola is a briscola pc game written in java, meant\nand made by Sebastiano Tronto. The game is protected by the GNU/General public licence version 2 or later.\n\nJBriscola version" + version + "\nCopyright 2009 Sebastiano Tronto, license GNU/Gpl 2.0 or later\nE-mail: sebastiano@luganega.org"; | ||
| 2060 | stringaSuono = "Sound"; | ||
| 2061 | stringaPunteggio = "Score"; | ||
| 2062 | stringaCartePassate = "Played cards"; | ||
| 2063 | stringaSfondo = "Background"; | ||
| 2064 | stringaTasti = "Hot keys"; | ||
| 2065 | stringaAggiornamenti = "Check updates"; | ||
| 2066 | stringaTrucchi = "Cheats"; | ||
| 2067 | stringaInserisciCodice = "Insert cheat:"; | ||
| 2068 | stringaTruccoAttivato = "Cheat actived!"; | ||
| 2069 | stringaTruccoSbagliato = "Wrong cheat"; | ||
| 2070 | stringaCheCartaVuoi = "So what card do you want?"; | ||
| 2071 | stringaAggiornamentiSi = "Update available: "; | ||
| 2072 | stringaAggiornamentiNo = "No updates available"; | ||
| 2073 | stringaScarica = "You can get the latest version from the site\nhttp://porkynator.altervista.org/programmi.html"; | ||
| 2074 | stringaNoInternet = "Error: no internet connection"; | ||
| 2075 | stringaTasti2 = "1 Play the first card\n2 Play the second card\n3 Play the third card\nF1 Get this message\nF2 " + stringaNuovaPartita + "\nF3 " + stringaOpzioni + "\nF4 " + stringaPunteggio + "\nF5 " + stringaCartePassate + "\nF6 " + stringaInformazioni + "\nF7 " + stringaAggiornamenti + "\nF8 " + stringaNuovaPartitaAiTrenta + "\nF9 " + stringaTrucchi + "\nq " + stringaEsci; | ||
| 2076 | } | ||
| 2077 | sound = ( soundString.equals( "suono=si" ) ); | ||
| 2078 | keys = ( keysString.equals( "tasti=si" ) ); | ||
| 2079 | color = new Color( r, g, b ); | ||
| 2080 | if ( frame != null ) { | ||
| 2081 | frame.pannello.repaint(); | ||
| 2082 | frame.pannello2.repaint(); | ||
| 2083 | frame.repaint(); | ||
| 2084 | } | ||
| 2085 | } | ||
| 2086 | } | ||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/OptionFrame.java b/JBriscola/all_versions/0.3/0.3.2/src/OptionFrame.java new file mode 100755 index 0000000..30359f0 --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/OptionFrame.java | |||
| @@ -0,0 +1,169 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2009-2010 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 | |||
| 29 | public static Main main = new Main(); | ||
| 30 | public static Formatter formatter; | ||
| 31 | public static JButton ok, annulla, scegliColore; | ||
| 32 | public static JLabel lingua, sfondo; | ||
| 33 | public static JComboBox selezionaLingua; | ||
| 34 | public static JCheckBox suono, tastiRapidi; | ||
| 35 | public static JPanel[] pannello = new JPanel[6]; | ||
| 36 | |||
| 37 | public OptionFrame() { | ||
| 38 | |||
| 39 | super( "JBriscola - " + main.stringaModificaOpzioni ); | ||
| 40 | |||
| 41 | ok = new JButton( "OK" ); | ||
| 42 | ok.addActionListener( new ActionListener() { | ||
| 43 | |||
| 44 | /* Quando le modifiche vengono confermate premendo ok, viene scritto | ||
| 45 | * il file di configurazione (o aggiornato) se possibile, e modificate | ||
| 46 | * le impostazioni attuali. */ | ||
| 47 | public void actionPerformed( ActionEvent e ) { | ||
| 48 | |||
| 49 | try { | ||
| 50 | formatter = new Formatter( "JBriscolaConfig.txt" ); | ||
| 51 | } catch ( Exception ex ) { | ||
| 52 | JOptionPane.showMessageDialog( OptionFrame.this, main.stringaImpossibileConfigurare + ex, "JBriscola - " + main.version, JOptionPane.ERROR_MESSAGE ); | ||
| 53 | } | ||
| 54 | |||
| 55 | String lang; | ||
| 56 | |||
| 57 | switch ( selezionaLingua.getSelectedIndex() ) { | ||
| 58 | case 0: | ||
| 59 | lang = "it"; | ||
| 60 | break; | ||
| 61 | case 1: | ||
| 62 | lang = "la"; | ||
| 63 | break; | ||
| 64 | case 2: | ||
| 65 | lang = "bl"; | ||
| 66 | break; | ||
| 67 | case 3: | ||
| 68 | lang = "bv"; | ||
| 69 | break; | ||
| 70 | case 4: | ||
| 71 | lang = "en"; | ||
| 72 | break; | ||
| 73 | default: | ||
| 74 | lang = "it"; | ||
| 75 | break; | ||
| 76 | } | ||
| 77 | |||
| 78 | String suonosiono, tastisiono; | ||
| 79 | |||
| 80 | if ( suono.isSelected() ) | ||
| 81 | suonosiono = "suono=si"; | ||
| 82 | else | ||
| 83 | suonosiono = "suono=no"; | ||
| 84 | if ( tastiRapidi.isSelected() ) | ||
| 85 | tastisiono = "tasti=si"; | ||
| 86 | else | ||
| 87 | tastisiono = "tasti=no"; | ||
| 88 | |||
| 89 | formatter.format( lang ); | ||
| 90 | formatter.format( "\n" ); | ||
| 91 | formatter.format( suonosiono ); | ||
| 92 | formatter.format( "\n" ); | ||
| 93 | formatter.format( tastisiono ); | ||
| 94 | formatter.format( "\n" ); | ||
| 95 | formatter.format( main.color.getRed() + " " + main.color.getGreen() + " " + main.color.getBlue() ); | ||
| 96 | formatter.close(); | ||
| 97 | |||
| 98 | main.settaOpzioni(); | ||
| 99 | |||
| 100 | OptionFrame.this.dispose(); | ||
| 101 | } | ||
| 102 | }); | ||
| 103 | |||
| 104 | annulla = new JButton( main.stringaAnnulla ); | ||
| 105 | annulla.addActionListener( new ActionListener() { | ||
| 106 | /* Se l'utente annulla viene chiusa la finestra senza fare nulla. */ | ||
| 107 | public void actionPerformed( ActionEvent e ) { | ||
| 108 | OptionFrame.this.dispose(); | ||
| 109 | } | ||
| 110 | }); | ||
| 111 | |||
| 112 | scegliColore = new JButton( " " ); | ||
| 113 | scegliColore.setBackground( main.color ); | ||
| 114 | scegliColore.addActionListener( new ActionListener() { | ||
| 115 | /* Permette di scegliere il colore dello sfondo. */ | ||
| 116 | public void actionPerformed( ActionEvent e ) { | ||
| 117 | Color colore = JColorChooser.showDialog( OptionFrame.this, "JBriscola " + main.version, main.color ); | ||
| 118 | if ( colore != null ) | ||
| 119 | main.color = colore; | ||
| 120 | OptionFrame.scegliColore.setBackground( main.color ); | ||
| 121 | } | ||
| 122 | } ); | ||
| 123 | |||
| 124 | /* Vengono impostati e disegnati i vari componenti. */ | ||
| 125 | lingua = new JLabel( main.stringaLingua ); | ||
| 126 | sfondo = new JLabel( main.stringaSfondo ); | ||
| 127 | String[] lingueDaSelezionare = { main.stringaIt, main.stringaLa, main.stringaBL, main.stringaBV, main.stringaEN }; | ||
| 128 | selezionaLingua = new JComboBox( lingueDaSelezionare ); | ||
| 129 | int linguaPreselezionata = 0; | ||
| 130 | |||
| 131 | if ( main.lang.equals( "it" ) ) | ||
| 132 | linguaPreselezionata = 0; | ||
| 133 | else if ( main.lang.equals( "la" ) ) | ||
| 134 | linguaPreselezionata = 1; | ||
| 135 | else if ( main.lang.equals( "bl" ) ) | ||
| 136 | linguaPreselezionata = 2; | ||
| 137 | else if ( main.lang.equals( "bv" ) ) | ||
| 138 | linguaPreselezionata = 3; | ||
| 139 | else if ( main.lang.equals( "en" ) ) | ||
| 140 | linguaPreselezionata = 4; | ||
| 141 | |||
| 142 | selezionaLingua.setSelectedIndex( linguaPreselezionata ); | ||
| 143 | suono = new JCheckBox( main.stringaSuono ); | ||
| 144 | suono.setSelected( main.sound ); | ||
| 145 | tastiRapidi = new JCheckBox( main.stringaTasti ); | ||
| 146 | tastiRapidi.setSelected( main.keys ); | ||
| 147 | |||
| 148 | pannello[0] = new JPanel( new GridLayout( 4, 1 ) ); | ||
| 149 | pannello[1] = new JPanel( new FlowLayout() ); | ||
| 150 | pannello[2] = new JPanel( new FlowLayout() ); | ||
| 151 | pannello[3] = new JPanel( new FlowLayout() ); | ||
| 152 | pannello[4] = new JPanel( new FlowLayout() ); | ||
| 153 | pannello[5] = new JPanel( new FlowLayout() ); | ||
| 154 | pannello[5].add( ok ); | ||
| 155 | pannello[5].add( annulla ); | ||
| 156 | pannello[4].add( sfondo ); | ||
| 157 | pannello[4].add( scegliColore ); | ||
| 158 | pannello[3].add( tastiRapidi ); | ||
| 159 | pannello[2].add( suono ); | ||
| 160 | pannello[1].add( lingua ); | ||
| 161 | pannello[1].add( selezionaLingua ); | ||
| 162 | pannello[0].add( pannello[1] ); | ||
| 163 | pannello[0].add( pannello[2] ); | ||
| 164 | pannello[0].add( pannello[3] ); | ||
| 165 | pannello[0].add( pannello[4] ); | ||
| 166 | add( pannello[0], BorderLayout.CENTER ); | ||
| 167 | add( pannello[5], BorderLayout.SOUTH ); | ||
| 168 | } | ||
| 169 | } | ||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/Pannello.java b/JBriscola/all_versions/0.3/0.3.2/src/Pannello.java new file mode 100755 index 0000000..1dde670 --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/Pannello.java | |||
| @@ -0,0 +1,88 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2009-2010 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 | |||
| 25 | /* Questa classe dispone semplicemente le carte | ||
| 26 | * sulla finestra e imposta la sfondo. */ | ||
| 27 | public class Pannello extends JPanel { | ||
| 28 | |||
| 29 | public static Main main; | ||
| 30 | |||
| 31 | public static Color color; | ||
| 32 | |||
| 33 | public Pannello() { } | ||
| 34 | |||
| 35 | public void paint( Graphics g ) { | ||
| 36 | |||
| 37 | super.paint( g ); | ||
| 38 | |||
| 39 | setBackground( main.color ); | ||
| 40 | |||
| 41 | if ( main.frame.ultimaCarta != null ) | ||
| 42 | main.frame.ultimaCarta.paintIcon( this, g, 50, 180 ); | ||
| 43 | |||
| 44 | if ( main.frame.mazzo ) | ||
| 45 | main.frame.retro2.paintIcon( this, g, 17, 256 ); | ||
| 46 | |||
| 47 | if ( main.carteScoperte ) { | ||
| 48 | |||
| 49 | if ( main.frame.carteCPU[0] != null ) | ||
| 50 | main.frame.carteCPU[0].paintIcon( this, g, 230, 5 ); | ||
| 51 | |||
| 52 | if ( main.frame.carteCPU[1] != null ) | ||
| 53 | main.frame.carteCPU[1].paintIcon( this, g, 300, 5 ); | ||
| 54 | |||
| 55 | if ( main.frame.carteCPU[2] != null ) | ||
| 56 | main.frame.carteCPU[2].paintIcon( this, g, 370, 5 ); | ||
| 57 | |||
| 58 | } else { | ||
| 59 | |||
| 60 | if ( main.frame.carteCPU[0] != null ) | ||
| 61 | main.frame.retro1.paintIcon( this, g, 230, 5 ); | ||
| 62 | |||
| 63 | if ( main.frame.carteCPU[1] != null ) | ||
| 64 | main.frame.retro1.paintIcon( this, g, 300, 5 ); | ||
| 65 | |||
| 66 | if ( main.frame.carteCPU[2] != null ) | ||
| 67 | main.frame.retro1.paintIcon( this, g, 370, 5 ); | ||
| 68 | |||
| 69 | } | ||
| 70 | |||
| 71 | if ( main.frame.carteInMano[0] != null ) | ||
| 72 | main.frame.carteInMano[0].paintIcon( this, g, 230, 340 ); | ||
| 73 | |||
| 74 | if ( main.frame.carteInMano[1] != null ) | ||
| 75 | main.frame.carteInMano[1].paintIcon( this, g, 300, 340 ); | ||
| 76 | |||
| 77 | if ( main.frame.carteInMano[2] != null ) | ||
| 78 | main.frame.carteInMano[2].paintIcon( this, g, 370, 340 ); | ||
| 79 | |||
| 80 | if ( main.frame.giocata[0] != null ) | ||
| 81 | main.frame.giocata[0].paintIcon( this, g, 250, 200 ); | ||
| 82 | |||
| 83 | if ( main.frame.giocata[1] != null ) | ||
| 84 | main.frame.giocata[1].paintIcon( this, g, 325, 150 ); | ||
| 85 | |||
| 86 | } | ||
| 87 | } | ||
| 88 | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/PannelloCartePassate.java b/JBriscola/all_versions/0.3/0.3.2/src/PannelloCartePassate.java new file mode 100755 index 0000000..fef9666 --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/PannelloCartePassate.java | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2009-2010 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 | |||
| 25 | public class PannelloCartePassate extends JPanel { | ||
| 26 | |||
| 27 | public static int posto[][] = new int[40][2]; | ||
| 28 | |||
| 29 | public static Main main; | ||
| 30 | |||
| 31 | public PannelloCartePassate() { } | ||
| 32 | |||
| 33 | public void paint( Graphics g ) { | ||
| 34 | |||
| 35 | super.paint( g ); | ||
| 36 | |||
| 37 | for( int i = 0; i < 40; i++ ) { | ||
| 38 | posto[i][0] = ( i % 10 ) * 70; | ||
| 39 | posto[i][1] = ( i / 10 ) * 136; | ||
| 40 | } | ||
| 41 | |||
| 42 | for ( int i = 0; i < main.mano*2; i++ ) | ||
| 43 | if ( main.frame.arrayCartePassate[i] != null ) | ||
| 44 | main.frame.arrayCartePassate[i].paintIcon( this, g, posto[i][0], posto[i][1] ); | ||
| 45 | |||
| 46 | |||
| 47 | } | ||
| 48 | |||
| 49 | } | ||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/1-1.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/1-1.jpg new file mode 100755 index 0000000..ae43510 --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/1-1.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/1-2.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/1-2.jpg new file mode 100755 index 0000000..3f7c75a --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/1-2.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/1-3.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/1-3.jpg new file mode 100755 index 0000000..9e1ead7 --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/1-3.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/1-4.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/1-4.jpg new file mode 100755 index 0000000..710f879 --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/1-4.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/10-1.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/10-1.jpg new file mode 100755 index 0000000..9aba45a --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/10-1.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/10-2.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/10-2.jpg new file mode 100755 index 0000000..037eeb7 --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/10-2.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/10-3.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/10-3.jpg new file mode 100755 index 0000000..8780b72 --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/10-3.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/10-4.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/10-4.jpg new file mode 100755 index 0000000..587dc0f --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/10-4.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/2-1.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/2-1.jpg new file mode 100755 index 0000000..5dcb7db --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/2-1.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/2-2.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/2-2.jpg new file mode 100755 index 0000000..ea9eeb7 --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/2-2.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/2-3.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/2-3.jpg new file mode 100755 index 0000000..8cb22dd --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/2-3.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/2-4.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/2-4.jpg new file mode 100755 index 0000000..b3e7898 --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/2-4.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/3-1.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/3-1.jpg new file mode 100755 index 0000000..dcb435c --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/3-1.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/3-2.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/3-2.jpg new file mode 100755 index 0000000..1e5b6ec --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/3-2.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/3-3.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/3-3.jpg new file mode 100755 index 0000000..9202cfe --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/3-3.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/3-4.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/3-4.jpg new file mode 100755 index 0000000..5436a8d --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/3-4.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/4-1.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/4-1.jpg new file mode 100755 index 0000000..3bab6d5 --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/4-1.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/4-2.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/4-2.jpg new file mode 100755 index 0000000..b4901a6 --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/4-2.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/4-3.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/4-3.jpg new file mode 100755 index 0000000..d754ad8 --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/4-3.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/4-4.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/4-4.jpg new file mode 100755 index 0000000..3a54b96 --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/4-4.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/5-1.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/5-1.jpg new file mode 100755 index 0000000..3f7ba1f --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/5-1.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/5-2.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/5-2.jpg new file mode 100755 index 0000000..fcacb75 --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/5-2.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/5-3.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/5-3.jpg new file mode 100755 index 0000000..ce32f9f --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/5-3.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/5-4.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/5-4.jpg new file mode 100755 index 0000000..b86b09a --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/5-4.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/6-1.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/6-1.jpg new file mode 100755 index 0000000..f90cd81 --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/6-1.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/6-2.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/6-2.jpg new file mode 100755 index 0000000..cf2a67a --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/6-2.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/6-3.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/6-3.jpg new file mode 100755 index 0000000..2cd2fe2 --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/6-3.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/6-4.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/6-4.jpg new file mode 100755 index 0000000..73f410f --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/6-4.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/7-1.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/7-1.jpg new file mode 100755 index 0000000..08cd397 --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/7-1.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/7-2.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/7-2.jpg new file mode 100755 index 0000000..a168ff8 --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/7-2.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/7-3.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/7-3.jpg new file mode 100755 index 0000000..5cda411 --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/7-3.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/7-4.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/7-4.jpg new file mode 100755 index 0000000..5d63229 --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/7-4.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/8-1.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/8-1.jpg new file mode 100755 index 0000000..a6faa7b --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/8-1.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/8-2.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/8-2.jpg new file mode 100755 index 0000000..0d9edbb --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/8-2.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/8-3.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/8-3.jpg new file mode 100755 index 0000000..91f8354 --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/8-3.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/8-4.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/8-4.jpg new file mode 100755 index 0000000..cc0089c --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/8-4.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/9-1.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/9-1.jpg new file mode 100755 index 0000000..be9c6bf --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/9-1.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/9-2.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/9-2.jpg new file mode 100755 index 0000000..e25da4c --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/9-2.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/9-3.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/9-3.jpg new file mode 100755 index 0000000..cd384f8 --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/9-3.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/9-4.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/9-4.jpg new file mode 100755 index 0000000..441210e --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/9-4.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/Thumbs.db b/JBriscola/all_versions/0.3/0.3.2/src/img/Thumbs.db new file mode 100755 index 0000000..d9b6bc5 --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/Thumbs.db | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/carte.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/carte.jpg new file mode 100755 index 0000000..838ffac --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/carte.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/retro1.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/retro1.jpg new file mode 100755 index 0000000..9651b06 --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/retro1.jpg | |||
| Binary files differ | |||
diff --git a/JBriscola/all_versions/0.3/0.3.2/src/img/retro2.jpg b/JBriscola/all_versions/0.3/0.3.2/src/img/retro2.jpg new file mode 100755 index 0000000..c5d3925 --- /dev/null +++ b/JBriscola/all_versions/0.3/0.3.2/src/img/retro2.jpg | |||
| Binary files differ | |||
