diff --git a/JDR/src/Presentation/Ajout_Perso.form b/JDR/src/Presentation/Ajout_Perso.form
new file mode 100644
index 0000000..0fd5a36
--- /dev/null
+++ b/JDR/src/Presentation/Ajout_Perso.form
@@ -0,0 +1,297 @@
+
+
+
diff --git a/JDR/src/Presentation/Ajout_Perso.java b/JDR/src/Presentation/Ajout_Perso.java
new file mode 100644
index 0000000..e9f8772
--- /dev/null
+++ b/JDR/src/Presentation/Ajout_Perso.java
@@ -0,0 +1,382 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template
+ */
+package Presentation;
+
+import java.util.Vector;
+import javax.swing.DefaultComboBoxModel;
+import metier.Guerrier;
+import metier.Jeu;
+
+/**
+ *
+ * @author emile.lalorcey
+ */
+public class Ajout_Perso extends javax.swing.JFrame {
+ Jeu leJeu;
+ /**
+ * Creates new form Ajout_Perso
+ */
+ public Ajout_Perso(Jeu jeu) {
+ initComponents();
+ jCBoxChoixType.setModel(new DefaultComboBoxModel(typePerso ()));
+ jCBoximagePerso.setModel(new DefaultComboBoxModel(imagePerso()));
+ leJeu = jeu;
+ }
+
+ /**
+ * This method is called from within the constructor to initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is always
+ * regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ // //GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ jPanel1 = new javax.swing.JPanel();
+ jLnewPlayer = new javax.swing.JLabel();
+ jCBoxChoixType = new javax.swing.JComboBox<>();
+ jTFnomPerso = new javax.swing.JTextField();
+ jLabel1 = new javax.swing.JLabel();
+ jLabel2 = new javax.swing.JLabel();
+ jCBoximagePerso = new javax.swing.JComboBox<>();
+ jLabel3 = new javax.swing.JLabel();
+ jSptsVie = new javax.swing.JSpinner();
+ jLabel4 = new javax.swing.JLabel();
+ jSptsEnergie = new javax.swing.JSpinner();
+ jLabel5 = new javax.swing.JLabel();
+ jLabel6 = new javax.swing.JLabel();
+ jTFarme = new javax.swing.JTextField();
+ jBcreer = new javax.swing.JButton();
+ jMenuBar1 = new javax.swing.JMenuBar();
+ jMenuJeu = new javax.swing.JMenu();
+ jMInewGame = new javax.swing.JMenuItem();
+ jMInewPlayer = new javax.swing.JMenuItem();
+ jMIopenGame = new javax.swing.JMenuItem();
+ jMIsave = new javax.swing.JMenuItem();
+ jMIquit = new javax.swing.JMenuItem();
+ jMenu2 = new javax.swing.JMenu();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+
+ jPanel1.setBackground(new java.awt.Color(102, 0, 0));
+
+ jLnewPlayer.setText("New Player");
+
+ jCBoxChoixType.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
+ jCBoxChoixType.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jCBoxChoixTypeActionPerformed(evt);
+ }
+ });
+
+ jTFnomPerso.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jTFnomPersoActionPerformed(evt);
+ }
+ });
+
+ jLabel1.setText("Type");
+
+ jLabel2.setText("Nom");
+
+ jCBoximagePerso.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
+
+ jLabel3.setText("Image");
+
+ jLabel4.setText("poits de vie");
+ jLabel4.addContainerListener(new java.awt.event.ContainerAdapter() {
+ public void componentAdded(java.awt.event.ContainerEvent evt) {
+ jLabel4ComponentAdded(evt);
+ }
+ });
+
+ jLabel5.setText("poits d'énergie");
+
+ jLabel6.setText("Arme");
+
+ jTFarme.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jTFarmeActionPerformed(evt);
+ }
+ });
+
+ jBcreer.setText("create");
+ jBcreer.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jBcreerActionPerformed(evt);
+ }
+ });
+
+ javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
+ jPanel1.setLayout(jPanel1Layout);
+ jPanel1Layout.setHorizontalGroup(
+ jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(jPanel1Layout.createSequentialGroup()
+ .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(jPanel1Layout.createSequentialGroup()
+ .addGap(36, 36, 36)
+ .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addGroup(jPanel1Layout.createSequentialGroup()
+ .addGap(17, 17, 17)
+ .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(jTFnomPerso, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGroup(jPanel1Layout.createSequentialGroup()
+ .addGap(20, 20, 20)
+ .addComponent(jLabel2))
+ .addComponent(jCBoximagePerso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(jCBoxChoixType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addGap(57, 57, 57)
+ .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(jSptsEnergie, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(jLabel4)
+ .addComponent(jLabel5)
+ .addComponent(jSptsVie, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(jLabel6)
+ .addComponent(jTFarme, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)))
+ .addGroup(jPanel1Layout.createSequentialGroup()
+ .addGap(37, 37, 37)
+ .addComponent(jLabel3))
+ .addGroup(jPanel1Layout.createSequentialGroup()
+ .addGap(100, 100, 100)
+ .addComponent(jLnewPlayer, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addGroup(jPanel1Layout.createSequentialGroup()
+ .addGap(93, 93, 93)
+ .addComponent(jBcreer)))
+ .addContainerGap(47, Short.MAX_VALUE))
+ );
+ jPanel1Layout.setVerticalGroup(
+ jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(jPanel1Layout.createSequentialGroup()
+ .addGap(25, 25, 25)
+ .addComponent(jLnewPlayer, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGap(18, 18, 18)
+ .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(jLabel1)
+ .addComponent(jLabel6))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(jCBoxChoixType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(jTFarme, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addGap(23, 23, 23)
+ .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(jLabel2)
+ .addComponent(jLabel4))
+ .addGap(12, 12, 12)
+ .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(jTFnomPerso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(jSptsVie, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addGap(18, 18, 18)
+ .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(jLabel3)
+ .addComponent(jLabel5))
+ .addGap(5, 5, 5)
+ .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(jCBoximagePerso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(jSptsEnergie, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addGap(18, 18, 18)
+ .addComponent(jBcreer)
+ .addContainerGap(25, Short.MAX_VALUE))
+ );
+
+ jMenuJeu.setText("Jeu");
+
+ jMInewGame.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_DOWN_MASK));
+ jMInewGame.setText("New Game");
+ jMInewGame.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jMInewGameActionPerformed(evt);
+ }
+ });
+ jMenuJeu.add(jMInewGame);
+
+ jMInewPlayer.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ADD, 0));
+ jMInewPlayer.setText("New Player");
+ jMInewPlayer.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jMInewPlayerActionPerformed(evt);
+ }
+ });
+ jMenuJeu.add(jMInewPlayer);
+
+ jMIopenGame.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_DOWN_MASK));
+ jMIopenGame.setText("Open Game");
+ jMenuJeu.add(jMIopenGame);
+
+ jMIsave.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_DOWN_MASK));
+ jMIsave.setText("Save");
+ jMenuJeu.add(jMIsave);
+
+ jMIquit.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Q, java.awt.event.InputEvent.CTRL_DOWN_MASK));
+ jMIquit.setText("Exit");
+ jMIquit.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jMIquitActionPerformed(evt);
+ }
+ });
+ jMenuJeu.add(jMIquit);
+
+ jMenuBar1.add(jMenuJeu);
+
+ jMenu2.setText("Edit");
+ jMenuBar1.add(jMenu2);
+
+ setJMenuBar(jMenuBar1);
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ );
+
+ pack();
+ }// //GEN-END:initComponents
+
+ private void jMInewGameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMInewGameActionPerformed
+ Plateau_de_jeu bidul = new Plateau_de_jeu();
+ }//GEN-LAST:event_jMInewGameActionPerformed
+
+ private void jMInewPlayerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMInewPlayerActionPerformed
+ // TODO add your handling code here:
+ }//GEN-LAST:event_jMInewPlayerActionPerformed
+
+ private void jMIquitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIquitActionPerformed
+ System.exit(0);
+ }//GEN-LAST:event_jMIquitActionPerformed
+
+ private void jCBoxChoixTypeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCBoxChoixTypeActionPerformed
+
+ }//GEN-LAST:event_jCBoxChoixTypeActionPerformed
+
+ private void jTFnomPersoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTFnomPersoActionPerformed
+ // TODO add your handling code here:
+ }//GEN-LAST:event_jTFnomPersoActionPerformed
+
+ private void jLabel4ComponentAdded(java.awt.event.ContainerEvent evt) {//GEN-FIRST:event_jLabel4ComponentAdded
+ // TODO add your handling code here:
+ }//GEN-LAST:event_jLabel4ComponentAdded
+
+ private void jTFarmeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTFarmeActionPerformed
+ // TODO add your handling code here:
+ }//GEN-LAST:event_jTFarmeActionPerformed
+
+ private void jBcreerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBcreerActionPerformed
+
+ switch(jCBoxChoixType.getSelectedItem().toString()){
+ case "Guerrier":
+ leJeu.getmesPersonnages().add(new Guerrier(jTFnomPerso.getText(),
+ ("/img/"+jCBoximagePerso.toString()),
+ (Integer) jSptsEnergie.getValue(),
+ (Integer) jSptsVie.getValue(),
+ jTFarme.getText()));
+ break;
+ case "Sorcier":
+ leJeu.getmesPersonnages().add(new Guerrier(jTFnomPerso.getText(),
+ ("/img/"+jCBoximagePerso.toString()),
+ (Integer) jSptsEnergie.getValue(),
+ (Integer) jSptsVie.getValue(),
+ jTFarme.getText()));
+ break;
+ case "Voleur":
+ leJeu.getmesPersonnages().add(new Guerrier(jTFnomPerso.getText(),
+ ("/img/"+jCBoximagePerso.toString()),
+ (Integer) jSptsEnergie.getValue(),
+ (Integer) jSptsVie.getValue(),
+ jTFarme.getText()));
+ break;
+
+ }
+ System.out.println(leJeu);
+ }//GEN-LAST:event_jBcreerActionPerformed
+
+
+ //---------Initialisation Combo Box
+ private Vector typePerso (){
+ Vector type = new Vector<>();
+ type.add("Guerrier");
+ type.add("Sorcier");
+ type.add("Voleur");
+ return type;
+ }
+
+ private Vector imagePerso(){
+ Vector image = new Vector<>();
+ image.add("Barbare04.jpg");
+ image.add("Guerrier05.jpg");
+ image.add("Guerrier08.jpg");
+ image.add("Guerrier10.jpg");
+ image.add("Guerrier12.jpg");
+ image.add("Simone.jpg");
+ image.add("Sorcier02.jpg");
+ image.add("Sorciere1.jpg");
+ return image;
+ }
+
+ /**
+ * @param args the command line arguments
+ */
+ public static void main(String args[]) {
+ /* Set the Nimbus look and feel */
+ //
+ /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
+ * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
+ */
+ try {
+ for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
+ if ("Nimbus".equals(info.getName())) {
+ javax.swing.UIManager.setLookAndFeel(info.getClassName());
+ break;
+ }
+ }
+ } catch (ClassNotFoundException ex) {
+ java.util.logging.Logger.getLogger(Ajout_Perso.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ } catch (InstantiationException ex) {
+ java.util.logging.Logger.getLogger(Ajout_Perso.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ } catch (IllegalAccessException ex) {
+ java.util.logging.Logger.getLogger(Ajout_Perso.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ } catch (javax.swing.UnsupportedLookAndFeelException ex) {
+ java.util.logging.Logger.getLogger(Ajout_Perso.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ }
+ //
+
+ /* Create and display the form */
+ java.awt.EventQueue.invokeLater(new Runnable() {
+ public void run() {
+ Jeu leJeu = new Jeu();
+ new Ajout_Perso(leJeu).setVisible(true);
+ }
+ });
+ }
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JButton jBcreer;
+ private javax.swing.JComboBox jCBoxChoixType;
+ private javax.swing.JComboBox jCBoximagePerso;
+ private javax.swing.JLabel jLabel1;
+ private javax.swing.JLabel jLabel2;
+ private javax.swing.JLabel jLabel3;
+ private javax.swing.JLabel jLabel4;
+ private javax.swing.JLabel jLabel5;
+ private javax.swing.JLabel jLabel6;
+ private javax.swing.JLabel jLnewPlayer;
+ private javax.swing.JMenuItem jMInewGame;
+ private javax.swing.JMenuItem jMInewPlayer;
+ private javax.swing.JMenuItem jMIopenGame;
+ private javax.swing.JMenuItem jMIquit;
+ private javax.swing.JMenuItem jMIsave;
+ private javax.swing.JMenu jMenu2;
+ private javax.swing.JMenuBar jMenuBar1;
+ private javax.swing.JMenu jMenuJeu;
+ private javax.swing.JPanel jPanel1;
+ private javax.swing.JSpinner jSptsEnergie;
+ private javax.swing.JSpinner jSptsVie;
+ private javax.swing.JTextField jTFarme;
+ private javax.swing.JTextField jTFnomPerso;
+ // End of variables declaration//GEN-END:variables
+}
diff --git a/JDR/src/Presentation/Plateau_de_jeu.form b/JDR/src/Presentation/Plateau_de_jeu.form
index aa78683..57767c0 100644
--- a/JDR/src/Presentation/Plateau_de_jeu.form
+++ b/JDR/src/Presentation/Plateau_de_jeu.form
@@ -62,8 +62,28 @@
@@ -252,16 +272,16 @@
-
-
-
-
-
+
+
+
+
+
@@ -279,6 +299,9 @@
+
+
+
@@ -420,6 +443,9 @@
+
+
+
@@ -484,6 +510,9 @@
+
+
+
diff --git a/JDR/src/Presentation/Plateau_de_jeu.java b/JDR/src/Presentation/Plateau_de_jeu.java
index 6d9e74a..478153b 100644
--- a/JDR/src/Presentation/Plateau_de_jeu.java
+++ b/JDR/src/Presentation/Plateau_de_jeu.java
@@ -65,6 +65,9 @@ public class Plateau_de_jeu extends javax.swing.JFrame {
jMIsave = new javax.swing.JMenuItem();
jMIquit = new javax.swing.JMenuItem();
jMenu2 = new javax.swing.JMenu();
+ jMIaide = new javax.swing.JMenuItem();
+ jMIobjectif = new javax.swing.JMenuItem();
+ jMIapropos = new javax.swing.JMenuItem();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
@@ -87,6 +90,7 @@ public class Plateau_de_jeu extends javax.swing.JFrame {
jLChoixPerso.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/famille_1.jpg"))); // NOI18N
+ jLChoixPersoText.setFont(new java.awt.Font("Wide Latin", 2, 12)); // NOI18N
jLChoixPersoText.setText("Choix Des personnages");
jPCHoixPersoFond.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
@@ -119,6 +123,7 @@ public class Plateau_de_jeu extends javax.swing.JFrame {
jTAAttaquantCaracteristiques.setBackground(new java.awt.Color(102, 0, 0));
jTAAttaquantCaracteristiques.setColumns(20);
+ jTAAttaquantCaracteristiques.setFont(new java.awt.Font("Showcard Gothic", 2, 12)); // NOI18N
jTAAttaquantCaracteristiques.setRows(5);
jTAAttaquantCaracteristiques.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR));
jScrollPane3.setViewportView(jTAAttaquantCaracteristiques);
@@ -153,6 +158,7 @@ public class Plateau_de_jeu extends javax.swing.JFrame {
jTADefenseurCaracteristiques.setBackground(new java.awt.Color(102, 0, 0));
jTADefenseurCaracteristiques.setColumns(20);
+ jTADefenseurCaracteristiques.setFont(new java.awt.Font("Showcard Gothic", 2, 12)); // NOI18N
jTADefenseurCaracteristiques.setRows(5);
jScrollPane4.setViewportView(jTADefenseurCaracteristiques);
@@ -214,14 +220,14 @@ public class Plateau_de_jeu extends javax.swing.JFrame {
jPChoixPerso.setLayout(jPChoixPersoLayout);
jPChoixPersoLayout.setHorizontalGroup(
jPChoixPersoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPChoixPersoLayout.createSequentialGroup()
- .addGap(26, 26, 26)
- .addComponent(jLChoixPersoText, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPChoixPersoLayout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPCHoixPersoFond, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
+ .addGroup(jPChoixPersoLayout.createSequentialGroup()
+ .addGap(26, 26, 26)
+ .addComponent(jLChoixPersoText, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPChoixPersoLayout.setVerticalGroup(
jPChoixPersoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@@ -334,7 +340,22 @@ public class Plateau_de_jeu extends javax.swing.JFrame {
jMenuBar1.add(jMenuJeu);
- jMenu2.setText("Edit");
+ jMenu2.setText("??");
+
+ jMIaide.setText("Aide");
+ jMenu2.add(jMIaide);
+
+ jMIobjectif.setText("Objectif");
+ jMIobjectif.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jMIobjectifActionPerformed(evt);
+ }
+ });
+ jMenu2.add(jMIobjectif);
+
+ jMIapropos.setText("A propos");
+ jMenu2.add(jMIapropos);
+
jMenuBar1.add(jMenu2);
setJMenuBar(jMenuBar1);
@@ -404,17 +425,23 @@ public class Plateau_de_jeu extends javax.swing.JFrame {
}//GEN-LAST:event_jCBoxAttaquantInputMethodTextChanged
private void jMInewPlayerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMInewPlayerActionPerformed
- // TODO add your handling code here:
+ Ajout_Perso perso = new Ajout_Perso(leJeu);
+ perso.setVisible(true);
}//GEN-LAST:event_jMInewPlayerActionPerformed
private void jMInewGameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMInewGameActionPerformed
-
+ Plateau_de_jeu bidul = new Plateau_de_jeu();
+ bidul.setVisible(true);
}//GEN-LAST:event_jMInewGameActionPerformed
private void jMIquitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIquitActionPerformed
-
+ System.exit(0);
}//GEN-LAST:event_jMIquitActionPerformed
+ private void jMIobjectifActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIobjectifActionPerformed
+ // TODO add your handling code here:
+ }//GEN-LAST:event_jMIobjectifActionPerformed
+
private void majStatistiquesPersos(){
@@ -483,8 +510,11 @@ public class Plateau_de_jeu extends javax.swing.JFrame {
private javax.swing.JLabel jLImageAttaquant;
private javax.swing.JLabel jLImageDefenseur;
private javax.swing.JLabel jLImageListePerso;
+ private javax.swing.JMenuItem jMIaide;
+ private javax.swing.JMenuItem jMIapropos;
private javax.swing.JMenuItem jMInewGame;
private javax.swing.JMenuItem jMInewPlayer;
+ private javax.swing.JMenuItem jMIobjectif;
private javax.swing.JMenuItem jMIopenGame;
private javax.swing.JMenuItem jMIquit;
private javax.swing.JMenuItem jMIsave;
diff --git a/JDR/src/metier/Jeu.java b/JDR/src/metier/Jeu.java
index aeb73ab..1e36113 100644
--- a/JDR/src/metier/Jeu.java
+++ b/JDR/src/metier/Jeu.java
@@ -4,6 +4,7 @@
*/
package metier;
+import java.util.ArrayList;
import java.util.Vector;
/**
@@ -12,8 +13,7 @@ import java.util.Vector;
*/
public class Jeu {
String nomJeu = "Jeu de Role" ;
- Personnage[] mesPersonnages = new Personnage[7];
-
+ private ArrayList mesPersonnages;
/********* Constructeurs ********/
@@ -33,8 +33,8 @@ public class Jeu {
* Getteur de mes personnages
* @return mes personnages
*/
- public Personnage[] getmesPersonnages(){
- return this.mesPersonnages;
+ public ArrayList getmesPersonnages(){
+ return mesPersonnages;
}
/********* Setteurs ********/
@@ -46,14 +46,14 @@ public class Jeu {
* Crée les personnages
*/
private void chargerLesPersonnages(){
- mesPersonnages = new Personnage[7];
- mesPersonnages[0] = new Guerrier("Barbare", "", 6, 4, "Hache");
- mesPersonnages[5] = new Guerrier("Garren","Guerrier08.jpg" , 0, 0, "Gourdin");
- mesPersonnages[6] = new Guerrier("Hellen","Guerrier08.jpg" , 0, 0, "Gourdin");
- mesPersonnages[3] = new Personnage("Gaelle", "Barbare04.jpg", 0, 0);
- mesPersonnages[1] = new Voleur("Raptout", "", 2, 4, "Marteau");
- mesPersonnages[2] = new Sorcier("Panoramix", "", 10, 5, "Baguette de laurier");
- mesPersonnages[4] = new Sorcier("Jinx","Barbare04.jpg",0,0, "Bâton");
+ mesPersonnages = new ArrayList();
+ mesPersonnages.add(new Guerrier("Barbare", "", 6, 4, "Hache"));
+ mesPersonnages.add(new Guerrier("Garren","Guerrier08.jpg" , 2, 8, "Gourdin"));
+ mesPersonnages.add(new Guerrier("Hellen","Guerrier08.jpg" , 8, 6, "Gourdin"));
+ mesPersonnages.add(new Personnage("Gaelle", "Barbare04.jpg", 5, 3));
+ mesPersonnages.add(new Voleur("Raptout", "", 2, 4, "Marteau"));
+ mesPersonnages.add(new Sorcier("Panoramix", "", 10, 5, "Baguette de laurier"));
+ mesPersonnages.add(new Sorcier("Jinx","Barbare04.jpg",0,0, "Bâton"));
}
/**
@@ -63,8 +63,8 @@ public class Jeu {
@Override
public String toString(){
String mesPersos = "";
- for (int i = 0; i < mesPersonnages.length; i++){
- mesPersos += mesPersonnages[i] + "\n" + "\n";
+ for (int i = 0; i < mesPersonnages.size(); i++){
+ mesPersos += mesPersonnages.get(i) + "\n" + "\n";
}
return mesPersos;
}
@@ -77,13 +77,13 @@ public class Jeu {
public Personnage rechercherPerso(String n){
int indice = 0;
boolean trouver = false;
- while(indice < this.mesPersonnages.length && !trouver){
- trouver = (this.mesPersonnages[indice].getNom().equals(n));
+ while(indice < this.mesPersonnages.size() && !trouver){
+ trouver = (this.mesPersonnages.get(indice).getNom().equals(n));
indice++;
}
if(trouver){
indice--;
- return this.mesPersonnages[indice];
+ return this.mesPersonnages.get(indice);
}
return null;
}
@@ -111,4 +111,7 @@ public class Jeu {
}
return LesPersonnagesVivants;
}
+
+
+
}