From 17fc3e8013327ca45a612c05ed3ef62bc1edf344 Mon Sep 17 00:00:00 2001
From: Azurlors <florianrichard2001@gmail.com>
Date: Tue, 1 Nov 2022 18:06:34 +0100
Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20classe=20UML?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 MAVENProject/pom.xml                          |  1 +
 .../src/main/java/jeu/Controller.java         | 53 +++--------------
 MAVENProject/src/main/java/jeu/Jeu.java       | 59 +++++--------------
 MAVENProject/src/main/java/jeu/Painter.java   | 36 +----------
 MAVENProject/src/main/java/start/Main.java    | 12 ++--
 5 files changed, 34 insertions(+), 127 deletions(-)

diff --git a/MAVENProject/pom.xml b/MAVENProject/pom.xml
index 5ec1364..60902a9 100644
--- a/MAVENProject/pom.xml
+++ b/MAVENProject/pom.xml
@@ -8,6 +8,7 @@
     <artifactId>MAVENProject</artifactId>
     <version>1.0-SNAPSHOT</version>
 
+
     <properties>
         <maven.compiler.source>17</maven.compiler.source>
         <maven.compiler.target>17</maven.compiler.target>
diff --git a/MAVENProject/src/main/java/jeu/Controller.java b/MAVENProject/src/main/java/jeu/Controller.java
index 93286d2..2134bab 100644
--- a/MAVENProject/src/main/java/jeu/Controller.java
+++ b/MAVENProject/src/main/java/jeu/Controller.java
@@ -5,52 +5,25 @@ import engine.GameController;
 
 import java.awt.event.KeyEvent;
 
-public class Controller {
-}
-
-
-/**
-package model;
-
-        import java.awt.event.KeyEvent;
-
-        import engine.Cmd;
-        import engine.GameController;
-
-
- * @author Horatiu Cirstea, Vincent Thomas
- *
- * controleur de type KeyListener
- *
-
-public class PacmanController implements GameController {
-
-
-     * commande en cours
-
+public class Controller implements GameController{
+    /*
+    * commande en cours
+    */
     private Cmd commandeEnCours;
 
+    /*
+    * construction du controleur par defaut le controleur n'a pas de commande
+    */
 
-     * construction du controleur par defaut le controleur n'a pas de commande
-
-    public PacmanController() {
+    public Controller() {
         this.commandeEnCours = Cmd.IDLE;
     }
 
-
-     * quand on demande les commandes, le controleur retourne la commande en
-     * cours
-     *
-     * @return commande faite par le joueur
-
     public Cmd getCommand() {
         return this.commandeEnCours;
     }
-
     @Override
 
-     * met a jour les commandes en fonctions des touches appuyees
-
     public void keyPressed(KeyEvent e) {
 
         switch (e.getKeyChar()) {
@@ -67,24 +40,16 @@ public class PacmanController implements GameController {
                 this.commandeEnCours = Cmd.JUMP;
                 break;
         }
-
     }
-
     @Override
 
-     * met a jour les commandes quand le joueur relache une touche
-
     public void keyReleased(KeyEvent e) {
         this.commandeEnCours = Cmd.IDLE;
     }
-
     @Override
 
-     * ne fait rien
-
     public void keyTyped(KeyEvent e) {
 
     }
 
-}
-**/
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/MAVENProject/src/main/java/jeu/Jeu.java b/MAVENProject/src/main/java/jeu/Jeu.java
index 8af8b4a..a78f0da 100644
--- a/MAVENProject/src/main/java/jeu/Jeu.java
+++ b/MAVENProject/src/main/java/jeu/Jeu.java
@@ -7,40 +7,15 @@ import java.io.BufferedReader;
 import java.io.FileReader;
 import java.io.IOException;
 
-public class Jeu {
-}
+public class Jeu implements Game{
 
-
-/**
- package model;
-
- import java.io.BufferedReader;
- import java.io.FileReader;
- import java.io.IOException;
-
- import engine.Cmd;
- import engine.Game;
-
-
- * @author Horatiu Cirstea, Vincent Thomas
- *
- *         Version avec personnage qui peut se deplacer. A completer dans les
- *         versions suivantes.
- *
-
-public class PacmanGame implements Game {
-
-
-     * constructeur avec fichier source pour le help
-     *
-
-    public PacmanGame(String source) {
+    public Jeu(String source) {
         BufferedReader helpReader;
         try {
             helpReader = new BufferedReader(new FileReader(source));
-            String ligne;
-            while ((ligne = helpReader.readLine()) != null) {
-                System.out.println(ligne);
+            String line;
+            while ((line = helpReader.readLine()) != null) {
+                System.out.println(line);
             }
             helpReader.close();
         } catch (IOException e) {
@@ -48,27 +23,25 @@ public class PacmanGame implements Game {
         }
     }
 
-
-     * faire evoluer le jeu suite a une commande
-     *
-     * @param commande
-
     @Override
     public void evolve(Cmd commande) {
         System.out.println("Execute "+commande);
-        if (commande == Cmd.LEFT) {
-
+        switch (commande) {
+            case LEFT:
+                break;
+            case RIGHT:
+                break;
+            case JUMP:
+                break;
+            case IDLE:
+                break;
         }
     }
 
-
-     * verifier si le jeu est fini
-
     @Override
     public boolean isFinished() {
         // le jeu n'est jamais fini
         return false;
     }
-
-}
- **/
+    
+}
\ No newline at end of file
diff --git a/MAVENProject/src/main/java/jeu/Painter.java b/MAVENProject/src/main/java/jeu/Painter.java
index ba6637c..55d5f8a 100644
--- a/MAVENProject/src/main/java/jeu/Painter.java
+++ b/MAVENProject/src/main/java/jeu/Painter.java
@@ -5,44 +5,14 @@ import engine.GamePainter;
 import java.awt.*;
 import java.awt.image.BufferedImage;
 
-public class Painter {
-}
-
-/**
-package model;
-
-        import java.awt.Color;
-        import java.awt.Graphics2D;
-        import java.awt.image.BufferedImage;
-
-        import engine.GamePainter;
-
-
- * @author Horatiu Cirstea, Vincent Thomas
- *
- * afficheur graphique pour le game
- *
-
-public class PacmanPainter implements GamePainter {
-
-
-     * la taille des cases
+public class Painter implements GamePainter{
 
     protected static final int WIDTH = 1000;
     protected static final int HEIGHT = 100;
 
-
-     * appelle constructeur parent
-     *
-     * @param game
-     *            le jeutest a afficher
-
-    public PacmanPainter() {
+    public Painter() {
     }
 
-
-     * methode  redefinie de Afficheur retourne une image du jeu
-
     @Override
     public void draw(BufferedImage im) {
         Graphics2D crayon = (Graphics2D) im.getGraphics();
@@ -59,6 +29,4 @@ public class PacmanPainter implements GamePainter {
     public int getHeight() {
         return HEIGHT;
     }
-
 }
-**/
\ No newline at end of file
diff --git a/MAVENProject/src/main/java/start/Main.java b/MAVENProject/src/main/java/start/Main.java
index f75076d..2f32ec4 100644
--- a/MAVENProject/src/main/java/start/Main.java
+++ b/MAVENProject/src/main/java/start/Main.java
@@ -1,9 +1,9 @@
 package start;
 
-import model.PacmanPainter;
+import jeu.Painter;
 import engine.GameEngineGraphical;
-import model.PacmanController;
-import model.PacmanGame;
+import jeu.Controller;
+import jeu.Jeu;
 
 /**
  * lancement du moteur avec le jeu
@@ -13,9 +13,9 @@ public class Main {
 	public static void main(String[] args) throws InterruptedException {
 
 		// creation du jeu particulier et de son afficheur
-		PacmanGame game = new PacmanGame("helpFilePacman.txt");
-		PacmanPainter painter = new PacmanPainter();
-		PacmanController controller = new PacmanController();
+		Jeu game = new Jeu("helpFilePacman.txt");
+		Painter painter = new Painter();
+		Controller controller = new Controller();
 
 		// classe qui lance le moteur de jeu generique
 		GameEngineGraphical engine = new GameEngineGraphical(game, painter, controller);
-- 
GitLab