DEBUT
This commit is contained in:
+12861
File diff suppressed because it is too large
Load Diff
@@ -1,47 +1,38 @@
|
|||||||
# CHESS
|
src/
|
||||||
|
├── modele/ ← 🔵 Couche Modèle (logique du jeu)
|
||||||
D'accord ! Voici une **arborescence plus simple** pour ton projet d'échecs en Java avec Swing.
|
│ ├── Partie.java
|
||||||
|
│ ├── Plateau.java
|
||||||
---
|
│ ├── Case.java
|
||||||
|
│ ├── Coup.java
|
||||||
## **📂 Arborescence simplifiée**
|
│ ├── Couleur.java ← enum
|
||||||
```
|
│ ├── ModeDeJeu.java ← enum
|
||||||
ChessGame/
|
│ ├── piece/
|
||||||
│── src/ # Dossier des fichiers sources Java
|
│ │ ├── Piece.java ← abstraite
|
||||||
│ ├── ChessGame.java # Point d'entrée du jeu
|
│ │ ├── Roi.java
|
||||||
│ ├── Echiquier.java # Gère le plateau de jeu
|
│ │ ├── Reine.java
|
||||||
│ ├── Piece.java # Classe mère pour les pièces
|
│ │ ├── Tour.java
|
||||||
│ ├── Pion.java # Classe du Pion
|
│ │ ├── Cavalier.java
|
||||||
│ ├── Tour.java # Classe de la Tour
|
│ │ ├── Fou.java
|
||||||
│ ├── Cavalier.java # Classe du Cavalier
|
│ │ └── Pion.java
|
||||||
│ ├── Fou.java # Classe du Fou
|
│ ├── joueur/
|
||||||
│ ├── Reine.java # Classe de la Reine
|
│ │ ├── Joueur.java ← abstraite
|
||||||
│ ├── Roi.java # Classe du Roi
|
│ │ ├── JoueurHumain.java
|
||||||
│ ├── Joueur.java # Gère les joueurs et le tour
|
│ │ ├── JoueurIA.java
|
||||||
│ ├── ChessGUI.java # Interface graphique en Swing
|
│ │ └── IA.java
|
||||||
│── assets/ # Images des pièces
|
│
|
||||||
│ ├── roi_noir.png
|
├── vue/ ← 🟢 Couche Vue (console ou graphique)
|
||||||
│ ├── roi_blanc.png
|
│ ├── Vue.java ← interface
|
||||||
│ ├── ...
|
│ ├── VueConsole.java
|
||||||
│── README.md # Explication du projet
|
│ ├── VueGraphique.java
|
||||||
```
|
│
|
||||||
|
├── controleur/ ← 🟠 Couche Contrôleur
|
||||||
---
|
│ ├── ControleurPartie.java
|
||||||
|
│ └── ControleurReseau.java
|
||||||
## **📜 Cahier des charges **
|
│
|
||||||
|
├── reseau/ ← 🌐 Réseau (mode en ligne)
|
||||||
### **1. Objectif**
|
│ ├── MessageJeu.java
|
||||||
Créer un **jeu d'échecs en Java avec Swing**, jouable entre **deux joueurs sur le même PC**.
|
│ ├── TypeMessage.java ← enum
|
||||||
|
│ ├── Serveur.java
|
||||||
### **2. Fonctionnalités**
|
│ └── Client.java
|
||||||
✅ Plateau 8x8 avec affichage des pièces
|
│
|
||||||
✅ Déplacement des pièces selon les règles
|
└── Main.java ← Point d'entrée du jeu
|
||||||
✅ Tour par tour (Blancs commencent)
|
|
||||||
✅ Vérification de l’échec et de l’échec et mat
|
|
||||||
✅ Interface simple avec Swing
|
|
||||||
|
|
||||||
### **3. Bonus (si possible)**
|
|
||||||
➕ Mode contre une IA
|
|
||||||
➕ Animation des déplacements
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|||||||
Binary file not shown.
@@ -0,0 +1,4 @@
|
|||||||
|
public class Main {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package controleur;
|
||||||
|
|
||||||
|
public class ControleurPartie {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package controleur;
|
||||||
|
|
||||||
|
public class ControleurReseau {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
|
||||||
|
public class Case {
|
||||||
|
private int x;
|
||||||
|
private int y;
|
||||||
|
private Piece piece;
|
||||||
|
|
||||||
|
public Case(int x, int y) {
|
||||||
|
this.x = x;
|
||||||
|
this.y = y;
|
||||||
|
this.piece = null; // Initialement, la case est vide
|
||||||
|
}
|
||||||
|
|
||||||
|
public Point getPosition() {
|
||||||
|
return new Point(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPiece(Piece piece) {
|
||||||
|
this.piece = piece;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Piece getPiece() {
|
||||||
|
return piece;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean estVide() {
|
||||||
|
return piece == null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
public enum Couleur {
|
||||||
|
BLANC,
|
||||||
|
NOIR;
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import java.awt.Point;
|
||||||
|
|
||||||
|
public class Coup {
|
||||||
|
private int xDepart;
|
||||||
|
private int xArrivee;
|
||||||
|
private int yDepart;
|
||||||
|
private int yArrivee;
|
||||||
|
|
||||||
|
public Coup(int xDepart, int yDepart, int xArrivee, int yArrivee) {
|
||||||
|
this.xDepart = xDepart;
|
||||||
|
this.yDepart = yDepart;
|
||||||
|
this.xArrivee = xArrivee;
|
||||||
|
this.yArrivee = yArrivee;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Point getOrigine(){
|
||||||
|
return new Point(xDepart, yDepart);
|
||||||
|
}
|
||||||
|
public Point getDestination(){
|
||||||
|
return new Point(xArrivee, yArrivee);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
public enum ModeDeJeu {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
public class Plateau {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package joueur;
|
||||||
|
|
||||||
|
public class IA {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package joueur;
|
||||||
|
|
||||||
|
public class Joueur {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package joueur;
|
||||||
|
|
||||||
|
public class JoueurHumain {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package joueur;
|
||||||
|
|
||||||
|
public class JoueurIA {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package piece;
|
||||||
|
|
||||||
|
public class Cavalier {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package piece;
|
||||||
|
|
||||||
|
public class Fou {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
public class Piece {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package piece;
|
||||||
|
|
||||||
|
public class Pion {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package piece;
|
||||||
|
|
||||||
|
public class Reine {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package piece;
|
||||||
|
|
||||||
|
public class Roi {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package piece;
|
||||||
|
|
||||||
|
public class Tour {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package reseau;
|
||||||
|
|
||||||
|
public class Client {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package reseau;
|
||||||
|
|
||||||
|
public class MessageJeu {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package reseau;
|
||||||
|
|
||||||
|
public class Serveur {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package reseau;
|
||||||
|
|
||||||
|
public enum TypeMessage {
|
||||||
|
DEMANDE_DE_PARTIE,
|
||||||
|
MOUVEMENT,
|
||||||
|
FIN_DE_PARTIE
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package vue;
|
||||||
|
|
||||||
|
public class Vue {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package vue;
|
||||||
|
|
||||||
|
public class VueConsole {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package vue;
|
||||||
|
|
||||||
|
public class VueGraphique {
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user