From 7167b4341ef290d56fb96e2af10883a4b925d83b Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Thu, 26 Mar 2026 19:27:18 +0100 Subject: I found my old code! --- .../all_versions/0.1/0.1 Beta 1/src/Frame.java | 159 ++++++++ .../all_versions/0.1/0.1 Beta 1/src/Main.java | 399 +++++++++++++++++++++ .../all_versions/0.1/0.1 Beta 1/src/Pannello.java | 53 +++ 3 files changed, 611 insertions(+) create mode 100755 JBriscola/all_versions/0.1/0.1 Beta 1/src/Frame.java create mode 100755 JBriscola/all_versions/0.1/0.1 Beta 1/src/Main.java create mode 100755 JBriscola/all_versions/0.1/0.1 Beta 1/src/Pannello.java (limited to 'JBriscola/all_versions/0.1/0.1 Beta 1/src') diff --git a/JBriscola/all_versions/0.1/0.1 Beta 1/src/Frame.java b/JBriscola/all_versions/0.1/0.1 Beta 1/src/Frame.java new file mode 100755 index 0000000..452cfe2 --- /dev/null +++ b/JBriscola/all_versions/0.1/0.1 Beta 1/src/Frame.java @@ -0,0 +1,159 @@ +/* +Copyright 2009 Sebastiano Tronto + +This file is part of JBriscola. + + JBriscola is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + JBriscola is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with JBriscola; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; + +public class Frame extends JFrame { + public static boolean mazzo; + public static Main main; + public static Pannello pannello; + public static JButton button; + public static JMenuBar barraMenu; + public static JMenu file; + public static JMenuItem nuovaPartita, esci; + public static ImageIcon retro1, retro2, ultimaCarta; + public static ImageIcon[] giocata = new ImageIcon[2]; + public static ImageIcon[] carteInMano = new ImageIcon[3]; + public static ImageIcon[] carteCPU = new ImageIcon[3]; + public static ImageIcon[] arrayCarteMescolate = new ImageIcon[40]; + public static ImageIcon[][] arrayCarte = new ImageIcon[10][4]; + public Frame() { + super( "Tronto's JBriscola 0.1" ); + mazzo = true; + main = new Main(); + pannello = new Pannello(); + button = new JButton( "Prendi/Lascia carte" ); + button.addActionListener( new ActionListener() { + public void actionPerformed( ActionEvent e ) { + if ( giocata[0] != null && giocata[1] != null ) + main.mano++; + try { + main.chiPrende(); + } catch ( Exception ex ) { + JOptionPane.showMessageDialog( Frame.this, "Prima gioca!" ); + } + if ( main.mano == 16 ) + JOptionPane.showMessageDialog( Frame.this, "Ultime 4 mani - occhio alla briscola!" ); + if ( main.mano == 17 ) { + mazzo = false; + ultimaCarta = null; + pannello.repaint(); + Frame.this.repaint(); + } + if ( main.mano == 20 ) { + String titolo = "Hai vinto!"; + if ( main.punteggio < main.punteggioCPU ) + titolo = "Hai perso"; + if ( main.punteggio == main.punteggioCPU ) + titolo = "Pareggio!"; + JOptionPane.showMessageDialog( Frame.this, "Giocatore: " + main.punteggio + "\nComputer: " + main.punteggioCPU, titolo, JOptionPane.PLAIN_MESSAGE ); + } + } + } ); + barraMenu = new JMenuBar(); + file = new JMenu( "File" ); + nuovaPartita = new JMenuItem( "Nuova Partita" ); + nuovaPartita.addActionListener( new ActionListener() { + public void actionPerformed( ActionEvent e ) { + if ( main.mano == 20 ) { + main.mischia(); + pannello.repaint(); + repaint(); + } + else { + int selezione = JOptionPane.showOptionDialog( Frame.this, "Vuoi davvero iniziare una nuova partita?", "JBriscola 0.1", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, new String[] { "Si", "No" }, "No" ); + if ( selezione == JOptionPane.YES_OPTION ) { + main.mischia(); + pannello.repaint(); + repaint(); + } + } + } + }); + esci = new JMenuItem( "Esci" ); + esci.addActionListener( new ActionListener() { + public void actionPerformed( ActionEvent e ) { + int selezione = JOptionPane.showOptionDialog( Frame.this, "Vuoi davvero uscire?", "JBriscola 0.1", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, new String[] { "Si", "No" }, "No" ); + if ( selezione == JOptionPane.YES_OPTION ) + Frame.this.dispose(); + } + }); + file.add( nuovaPartita ); + file.add( esci ); + barraMenu.add( file ); + setJMenuBar( barraMenu ); + retro1 = new ImageIcon( ClassLoader.getSystemResource( "img/retro1.jpg" ) ); + retro2 = new ImageIcon( ClassLoader.getSystemResource( "img/retro2.jpg" ) ); + for (int i = 0; i < 10; i++) + for (int j = 0; j < 4; j++) + arrayCarte[i][j] = new ImageIcon( ClassLoader.getSystemResource( "img/" + (i+1) + "-" + (j+1) + ".jpg" ) ); + main.mischia(); + setLayout( new BorderLayout() ); + add( pannello, BorderLayout.CENTER ); + add( button, BorderLayout.SOUTH ); + addMouseListener( + new MouseAdapter() { + public void mouseClicked ( MouseEvent e ) { + if ( mettiCarta( e.getX(), e.getY() ) ) { + if ( !main.CPUHaGiocato ) + main.giocaCPU(); + } + } + } + ); + addWindowListener( + new WindowAdapter() { + public void windowClosing( WindowEvent e ) { + int selezione = JOptionPane.showOptionDialog( Frame.this, "Vuoi davvero uscire?", "JBriscola 0.1", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, new String[] { "Si", "No" }, "No" ); + if ( selezione == JOptionPane.YES_OPTION ) + System.exit( 0 ); + } + } + ); + } + public boolean mettiCarta( int x, int y ) { + if ( !main.toccaAllaCPU && giocata[0] == null ) { + if ( x > 230 && x < 290 && y > 340 && y < 566 ) { + giocata[0] = carteInMano[0]; + carteInMano[0] = null; + pannello.repaint(); + return true; + } + if ( x > 300 && x < 360 && y > 340 && y < 566 ) { + giocata[0] = carteInMano[1]; + carteInMano[1] = null; + pannello.repaint(); + return true; + } + if ( x > 370 && x < 430 && y > 340 && y < 566 ) { + giocata[0] = carteInMano[2]; + carteInMano[2] = null; + pannello.repaint(); + return true; + } + } + return false; + } +} + + diff --git a/JBriscola/all_versions/0.1/0.1 Beta 1/src/Main.java b/JBriscola/all_versions/0.1/0.1 Beta 1/src/Main.java new file mode 100755 index 0000000..f844dd8 --- /dev/null +++ b/JBriscola/all_versions/0.1/0.1 Beta 1/src/Main.java @@ -0,0 +1,399 @@ +/* +Copyright 2009 Sebastiano Tronto + +This file is part of JBriscola. + + JBriscola is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + JBriscola is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with JBriscola; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + +import javax.swing.*; + +public class Main { + public static int semeBriscola, punteggio, punteggioCPU, mano, cartaDaPescare, cartaDaGiocare; + public static boolean toccaAllaCPU = false; + public static boolean CPUHaGiocato = false; + public static boolean haGiocatoPrima = true; + public static Frame frame; + public static void main( String args[] ) { + frame = new Frame(); + frame.setDefaultCloseOperation( JFrame.DO_NOTHING_ON_CLOSE ); + frame.setVisible( true ); + frame.setResizable( false ); + frame.setSize( 600, 600 ); + } + public void mischia() { + mano = 0; + punteggio = 0; + punteggioCPU = 0; + cartaDaPescare = 6; + ImageIcon aux; + frame.mazzo = true; + toccaAllaCPU = false; + CPUHaGiocato = false; + haGiocatoPrima = true; + for ( int i = 0, k = 0; i < 10; i++ ) + for ( int j = 0; j < 4; j++, k++ ) + frame.arrayCarteMescolate[k] = frame.arrayCarte[i][j]; + for ( int i = 0; i < 391; i++ ) { + double a = Math.random() * 40; + int x = (int) a; + double b = Math.random() * 40; + int y = (int) b; + aux = frame.arrayCarteMescolate[x]; + frame.arrayCarteMescolate[x] = frame.arrayCarteMescolate[y]; + frame.arrayCarteMescolate[y] = aux; + } + char auxChar[] = frame.arrayCarteMescolate[39].toString().toCharArray(); + semeBriscola = auxChar[auxChar.length-5] - 49; + frame.carteInMano[0] = frame.arrayCarteMescolate[0]; + frame.carteInMano[1] = frame.arrayCarteMescolate[1]; + frame.carteInMano[2] = frame.arrayCarteMescolate[2]; + frame.carteCPU[0] = frame.arrayCarteMescolate[3]; + frame.carteCPU[1] = frame.arrayCarteMescolate[4]; + frame.carteCPU[2] = frame.arrayCarteMescolate[5]; + frame.ultimaCarta = frame.arrayCarteMescolate[39]; + frame.giocata[0] = null; + frame.giocata[1] = null; + } + public void giocaCPU() { + if ( frame.giocata[0] == null ) { + if ( vaiLiscio() ); + else if ( vaiPunti() ); + else if ( vaiBriscola() ); + else if ( vaiCarico() ); + else; + } + else { + if ( haLisciato() || haMessoPunti() ) { + if ( vaiSopra() ); + else if ( vaiLiscio() ); + else if ( vaiPunti() ); + else if ( vaiBriscola() ); + else if ( vaiCarico() ); + else System.out.println("Ha lisciato e non so cosa fare"); + } else if ( haMessoBriscola() ) { + if ( vaiLiscio() ); + else if ( vaiPunti() ); + else if ( vaiBriscola() ); + else if ( vaiCarico() ); + else System.out.println("Ha messo una briscola e non so cosa fare"); + } else if ( haCaricato() ) { + if ( vaiSopra() ); + else if ( vaiBriscola() ); + else if ( vaiLiscio() ); + else if ( vaiPunti() ); + else if ( vaiCarico() ); + else System.out.println("Ha caricato e non so cosa fare"); + } else System.out.println("Non so cosa ha fatto"); + } + frame.giocata[1] = frame.carteCPU[cartaDaGiocare]; + frame.carteCPU[cartaDaGiocare] = null; + frame.pannello.repaint(); + CPUHaGiocato = true; + if ( frame.giocata[0] == null ) + toccaAllaCPU = false; + } + public void chiPrende() { + char aux[], auxCPU[]; + aux = frame.giocata[0].toString().toCharArray(); + auxCPU = frame.giocata[1].toString().toCharArray(); + giocatorePrende( ( (aux[aux.length-5] - 49 == semeBriscola) && (auxCPU[auxCPU.length-5] - 49 != semeBriscola) ) + || ( (aux[aux.length-5] == auxCPU[auxCPU.length-5]) && laPrimaEPiuAlta( aux[aux.length-7] - 48, auxCPU[auxCPU.length-7] - 48 ) ) + || ( (auxCPU[auxCPU.length-5] - 49 != semeBriscola) && (aux[aux.length-5] != auxCPU[auxCPU.length-5]) && haGiocatoPrima ) ); + } + public boolean laPrimaEPiuAlta( int prima, int seconda ) { + int a, b; + switch ( prima ) { + case 0: + a = 10; + break; + case 1: + a = 12; + break; + case 3: + a = 11; + break; + default: + a = prima; + break; + } + switch ( seconda ) { + case 0: + b = 10; + break; + case 1: + b = 12; + break; + case 3: + b = 11; + break; + default: + b = seconda; + break; + } + return a > b; + } + public void giocatorePrende( boolean giocatore ) { + if ( giocatore ) { + toccaAllaCPU = CPUHaGiocato = false; + haGiocatoPrima = true; + } + else { + toccaAllaCPU = true; + CPUHaGiocato = haGiocatoPrima = false; + } + daiPunti( giocatore ); + if ( toccaAllaCPU ) + giocaCPU(); + } + public void daiPunti( boolean giocatore ) { + char aux[], auxCPU[]; + aux = frame.giocata[0].toString().toCharArray(); + auxCPU = frame.giocata[1].toString().toCharArray(); + int punti = 0; + switch( aux[aux.length-7] - 48 ) { + case 0: + punti += 4; + break; + case 1: + punti += 11; + break; + case 3: + punti += 10; + break; + case 8: + punti += 2; + break; + case 9: + punti += 3; + break; + default: + break; + } + switch( auxCPU[auxCPU.length-7] - 48 ) { + case 0: + punti += 4; + break; + case 1: + punti += 11; + break; + case 3: + punti += 10; + break; + case 8: + punti += 2; + break; + case 9: + punti += 3; + break; + default: + break; + } + frame.giocata[0] = frame.giocata[1] = null; + if ( giocatore ) { + punteggio += punti; + if ( mano < 18 ) { + if ( frame.carteInMano[0] == null ) + frame.carteInMano[0] = frame.arrayCarteMescolate[cartaDaPescare]; + if ( frame.carteInMano[1] == null ) + frame.carteInMano[1] = frame.arrayCarteMescolate[cartaDaPescare]; + if ( frame.carteInMano[2] == null ) + frame.carteInMano[2] = frame.arrayCarteMescolate[cartaDaPescare]; + cartaDaPescare++; + if ( frame.carteCPU[0] == null ) + frame.carteCPU[0] = frame.arrayCarteMescolate[cartaDaPescare]; + if ( frame.carteCPU[1] == null ) + frame.carteCPU[1] = frame.arrayCarteMescolate[cartaDaPescare]; + if ( frame.carteCPU[2] == null ) + frame.carteCPU[2] = frame.arrayCarteMescolate[cartaDaPescare]; + cartaDaPescare++; + } + } + else { + punteggioCPU += punti; + if ( mano < 18 ) { + if ( frame.carteCPU[0] == null ) + frame.carteCPU[0] = frame.arrayCarteMescolate[cartaDaPescare]; + if ( frame.carteCPU[1] == null ) + frame.carteCPU[1] = frame.arrayCarteMescolate[cartaDaPescare]; + if ( frame.carteCPU[2] == null ) + frame.carteCPU[2] = frame.arrayCarteMescolate[cartaDaPescare]; + cartaDaPescare++; + if ( frame.carteInMano[0] == null ) + frame.carteInMano[0] = frame.arrayCarteMescolate[cartaDaPescare]; + if ( frame.carteInMano[1] == null ) + frame.carteInMano[1] = frame.arrayCarteMescolate[cartaDaPescare]; + if ( frame.carteInMano[2] == null ) + frame.carteInMano[2] = frame.arrayCarteMescolate[cartaDaPescare]; + cartaDaPescare++; + } + } + frame.pannello.repaint(); + frame.repaint(); + } + public boolean haLisciato() { + char auxCPU[]; + auxCPU = frame.giocata[0].toString().toCharArray(); + return ( (frame.giocata[0] != null) && (auxCPU[auxCPU.length-5] - 49 != semeBriscola) && + (auxCPU[auxCPU.length-7] - 48 != 0 ) && (auxCPU[auxCPU.length-7] - 48 != 1 ) && + (auxCPU[auxCPU.length-7] - 48 != 3 ) && (auxCPU[auxCPU.length-7] - 48 < 8 ) ); + } + public boolean haMessoPunti() { + char auxCPU[]; + auxCPU = frame.giocata[0].toString().toCharArray(); + return ( (frame.giocata[0] != null) && (auxCPU[auxCPU.length-5] - 49 != semeBriscola) && + ( (auxCPU[auxCPU.length-7] - 48 == 0 ) || (auxCPU[auxCPU.length-7] - 48 == 8 ) || + (auxCPU[auxCPU.length-7] - 48 == 9 ) ) ); + } + public boolean haMessoBriscola() { + char auxCPU[]; + auxCPU = frame.giocata[0].toString().toCharArray(); + return ( (frame.giocata[0] != null) && (auxCPU[auxCPU.length-5] - 49 == semeBriscola) ); + } + public boolean haCaricato() { + char auxCPU[]; + auxCPU = frame.giocata[0].toString().toCharArray(); + return ( (frame.giocata[0] != null) && (auxCPU[auxCPU.length-5] - 49 != semeBriscola) && + ( (auxCPU[auxCPU.length-7] - 48 == 1 ) || (auxCPU[auxCPU.length-7] - 48 == 3 ) ) ); + } + public boolean vaiLiscio() { + char auxCPU[]; + for ( int i = 0; i < 3; i++ ) { + if ( frame.carteCPU[i] != null ) { + auxCPU = frame.carteCPU[i].toString().toCharArray(); + if ( (auxCPU[auxCPU.length-5] - 49 != semeBriscola) && + (auxCPU[auxCPU.length-7] - 48 != 0 ) && (auxCPU[auxCPU.length-7] - 48 != 1 ) && + (auxCPU[auxCPU.length-7] - 48 != 3 ) && (auxCPU[auxCPU.length-7] - 48 < 8 ) ) { + cartaDaGiocare = i; + return true; + } + } + } + return false; + } + public boolean vaiPunti() { + char auxCPU[]; + for ( int i = 0; i < 3; i++ ) { + if ( frame.carteCPU[i] != null ) { + auxCPU = frame.carteCPU[i].toString().toCharArray(); + if ( (auxCPU[auxCPU.length-5] - 49 != semeBriscola) && + ( (auxCPU[auxCPU.length-7] - 48 == 0 ) || (auxCPU[auxCPU.length-7] - 48 == 8 ) || + (auxCPU[auxCPU.length-7] - 48 == 9 ) ) ) { + cartaDaGiocare = i; + return true; + } + } + } + return false; + } + public boolean vaiBriscola() { + char auxCPU[]; + for ( int i = 0; i < 3; i++ ) { + if ( frame.carteCPU[i] != null ) { + auxCPU = frame.carteCPU[i].toString().toCharArray(); + if ( auxCPU[auxCPU.length-5] - 49 == semeBriscola ) { + cartaDaGiocare = i; + return true; + } + } + } + return false; + } + public boolean vaiCarico() { + char auxCPU[]; + for ( int i = 0; i < 3; i++ ) { + if ( frame.carteCPU[i] != null ) { + auxCPU = frame.carteCPU[i].toString().toCharArray(); + if ( (auxCPU[auxCPU.length-5] - 49 != semeBriscola) && + ( (auxCPU[auxCPU.length-7] - 48 == 1 ) || (auxCPU[auxCPU.length-7] - 48 == 3 ) ) ) { + cartaDaGiocare = i; + return true; + } + } + } + return false; + } + public boolean vaiSopra() { + if ( frame.giocata[0] == null ) + return false; + int a = -1; + int b = -1; + int c = -1; + boolean laPrimaPuoAndareSopra = false; + boolean laSecondaPuoAndareSopra = false; + boolean laTerzaPuoAndareSopra = false; + char[] auxCPU1 = new char[1024]; + char[] auxCPU2 = new char[1024]; + char[] auxCPU3 = new char[1024]; + char[] aux = frame.giocata[0].toString().toCharArray(); + if ( aux[aux.length-7] - 48 == 1 ) + return false; + if ( frame.carteCPU[0] != null ) { + auxCPU1 = frame.carteCPU[0].toString().toCharArray(); + a = auxCPU1[auxCPU1.length-7] - 48; + } + if ( frame.carteCPU[1] != null ) { + auxCPU2 = frame.carteCPU[1].toString().toCharArray(); + b = auxCPU2[auxCPU2.length-7] - 48; + } + if ( frame.carteCPU[2] != null ) { + auxCPU3 = frame.carteCPU[2].toString().toCharArray(); + c = auxCPU3[auxCPU3.length-7] - 48; + } + if ( (auxCPU1[auxCPU1.length-5] - 49 == aux[aux.length-5] - 49) && laPrimaEPiuAlta( a, aux[aux.length-7] - 48 ) ) + laPrimaPuoAndareSopra = true; + if ( (auxCPU2[auxCPU2.length-5] - 49 == aux[aux.length-5] - 49) && laPrimaEPiuAlta( b, aux[aux.length-7] - 48 ) ) + laSecondaPuoAndareSopra = true; + if ( (auxCPU3[auxCPU3.length-5] - 49 == aux[aux.length-5] - 49) && laPrimaEPiuAlta( c, aux[aux.length-7] - 48 ) ) + laTerzaPuoAndareSopra = true; + if ( !laPrimaPuoAndareSopra && !laSecondaPuoAndareSopra && !laTerzaPuoAndareSopra ) + return false; + else if ( laPrimaPuoAndareSopra && !laSecondaPuoAndareSopra && !laTerzaPuoAndareSopra ) + cartaDaGiocare = 0; + else if ( !laPrimaPuoAndareSopra && laSecondaPuoAndareSopra && !laTerzaPuoAndareSopra ) + cartaDaGiocare = 1; + else if ( !laPrimaPuoAndareSopra && !laSecondaPuoAndareSopra && laTerzaPuoAndareSopra ) + cartaDaGiocare = 2; + else if ( laPrimaPuoAndareSopra && laSecondaPuoAndareSopra && !laTerzaPuoAndareSopra ) + if ( laPrimaEPiuAlta( a, b ) ) + cartaDaGiocare = 0; + else + cartaDaGiocare = 1; + else if ( !laPrimaPuoAndareSopra && laSecondaPuoAndareSopra && laTerzaPuoAndareSopra ) + if ( laPrimaEPiuAlta( b, c ) ) + cartaDaGiocare = 1; + else + cartaDaGiocare = 2; + else if ( laPrimaPuoAndareSopra && !laSecondaPuoAndareSopra && laTerzaPuoAndareSopra ) + if ( laPrimaEPiuAlta( a, c ) ) + cartaDaGiocare = 0; + else + cartaDaGiocare = 2; + else if ( laPrimaPuoAndareSopra && laSecondaPuoAndareSopra && laTerzaPuoAndareSopra ) + if ( laPrimaEPiuAlta( a, b ) ) + if ( laPrimaEPiuAlta( a, c ) ) + cartaDaGiocare = 0; + else + cartaDaGiocare = 2; + else + if ( laPrimaEPiuAlta( b, c ) ) + cartaDaGiocare = 1; + else + cartaDaGiocare = 2; + else cartaDaGiocare = 55; + return true; + } +} diff --git a/JBriscola/all_versions/0.1/0.1 Beta 1/src/Pannello.java b/JBriscola/all_versions/0.1/0.1 Beta 1/src/Pannello.java new file mode 100755 index 0000000..9e73356 --- /dev/null +++ b/JBriscola/all_versions/0.1/0.1 Beta 1/src/Pannello.java @@ -0,0 +1,53 @@ +/* +Copyright 2009 Sebastiano Tronto + +This file is part of JBriscola. + + JBriscola is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + JBriscola is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with JBriscola; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + +import javax.swing.*; +import java.awt.Graphics; + +public class Pannello extends JPanel { + public static Main main; + public Pannello() { + } + public void paint( Graphics g ) { + super.paint( g ); + if ( main.frame.ultimaCarta != null ) + main.frame.ultimaCarta.paintIcon( this, g, 50, 180 ); + if ( main.frame.mazzo ) + main.frame.retro2.paintIcon( this, g, 17, 256 ); + if ( main.frame.carteCPU[0] != null ) + main.frame.retro1.paintIcon( this, g, 230, 5 ); + if ( main.frame.carteCPU[1] != null ) + main.frame.retro1.paintIcon( this, g, 300, 5 ); + if ( main.frame.carteCPU[2] != null ) + main.frame.retro1.paintIcon( this, g, 370, 5 ); + if ( main.frame.carteInMano[0] != null ) + main.frame.carteInMano[0].paintIcon( this, g, 230, 340 ); + if ( main.frame.carteInMano[1] != null ) + main.frame.carteInMano[1].paintIcon( this, g, 300, 340 ); + if ( main.frame.carteInMano[2] != null ) + main.frame.carteInMano[2].paintIcon( this, g, 370, 340 ); + if ( main.frame.giocata[0] != null ) + main.frame.giocata[0].paintIcon( this, g, 250, 200 ); + if ( main.frame.giocata[1] != null ) + main.frame.giocata[1].paintIcon( this, g, 325, 150 ); + } +} + -- cgit v1.3