diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 747b538e6cf7518533336403c0b30a7f2f68ddfb..380cde1da734af938f0feea75b02e66dd7277611 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,7 +4,20 @@ <option name="autoReloadType" value="SELECTIVE" /> </component> <component name="ChangeListManager"> - <list default="true" id="0242c1a9-e139-4946-98de-d110221679b6" name="Default Changelist" comment="" /> + <list default="true" id="0242c1a9-e139-4946-98de-d110221679b6" name="Default Changelist" comment=""> + <change beforePath="$PROJECT_DIR$/.idea/codeStyles/Project.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/codeStyles/Project.xml" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/.idea/codeStyles/codeStyleConfig.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/codeStyles/codeStyleConfig.xml" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/.idea/kotlinc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/kotlinc.xml" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/.idea/libraries/KotlinJavaRuntime.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/libraries/KotlinJavaRuntime.xml" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/.idea/modules.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/modules.xml" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/.idea/vcs.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/puissance4_java.iml" beforeDir="false" afterPath="$PROJECT_DIR$/puissance4_java.iml" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/src/dcc.mdj" beforeDir="false" afterPath="$PROJECT_DIR$/src/dcc.mdj" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/src/puissance4/Main.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/puissance4/Main.java" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/src/puissance4/model/Grille.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/puissance4/model/Grille.java" afterDir="false" /> + </list> <option name="SHOW_DIALOG" value="false" /> <option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> @@ -33,13 +46,13 @@ <property name="RunOnceActivity.ShowReadmeOnStart" value="true" /> <property name="WebServerToolWindowFactoryState" value="false" /> <property name="aspect.path.notification.shown" value="true" /> - <property name="last_opened_file_path" value="$USER_HOME$/IdeaProjects/P31_systeme_fichier" /> + <property name="last_opened_file_path" value="$PROJECT_DIR$" /> <property name="project.structure.last.edited" value="Modules" /> <property name="project.structure.proportion" value="0.15" /> <property name="project.structure.side.proportion" value="0.2" /> <property name="settings.editor.selected.configurable" value="preferences.lookFeel" /> </component> - <component name="RunManager"> + <component name="RunManager" selected="Application.Main"> <configuration name="FullRowDetection" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true"> <option name="MAIN_CLASS_NAME" value="puissance4.controleur.FullRowDetection" /> <module name="puissance4_java" /> @@ -53,8 +66,35 @@ <option name="Make" enabled="true" /> </method> </configuration> + <configuration name="Main" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true"> + <option name="MAIN_CLASS_NAME" value="puissance4.Main" /> + <module name="puissance4_java" /> + <extension name="coverage"> + <pattern> + <option name="PATTERN" value="puissance4.*" /> + <option name="ENABLED" value="true" /> + </pattern> + </extension> + <method v="2"> + <option name="Make" enabled="true" /> + </method> + </configuration> + <configuration default="true" type="ArquillianTestNG" factoryName="" nameIsGenerated="true"> + <option name="arquillianRunConfiguration"> + <value> + <option name="containerStateName" value="" /> + </value> + </option> + <option name="TEST_OBJECT" value="CLASS" /> + <properties /> + <listeners /> + <method v="2"> + <option name="Make" enabled="true" /> + </method> + </configuration> <recent_temporary> <list> + <item itemvalue="Application.Main" /> <item itemvalue="Application.FullRowDetection" /> </list> </recent_temporary> @@ -79,9 +119,7 @@ <workItem from="1607010556720" duration="2636000" /> <workItem from="1607245589897" duration="24000" /> <workItem from="1607412315237" duration="91000" /> - <workItem from="1607414232494" duration="651000" /> - <workItem from="1607414915432" duration="1277000" /> - <workItem from="1607416619648" duration="2006000" /> + <workItem from="1607415898623" duration="2049000" /> </task> <servers /> </component> diff --git a/out/production/puissance4_java/puissance4/Main.class b/out/production/puissance4_java/puissance4/Main.class index c730ac35919db26b80fe77e24be66a0e4d99f958..70c52f44c20a96ef7aee627bf8aa38a3440b628b 100644 Binary files a/out/production/puissance4_java/puissance4/Main.class and b/out/production/puissance4_java/puissance4/Main.class differ diff --git a/out/production/puissance4_java/puissance4/model/Grille.class b/out/production/puissance4_java/puissance4/model/Grille.class index 17013ab60d98cc298bd8550ee2535327429ba111..faf6a7ffb84a783869bcb5bc511df5d6d279b0be 100644 Binary files a/out/production/puissance4_java/puissance4/model/Grille.class and b/out/production/puissance4_java/puissance4/model/Grille.class differ diff --git a/src/puissance4/Main.java b/src/puissance4/Main.java index 76f249706f54ef341d3e2f0069fa6881eb169b4a..0fb3a5f095121a0ab715a1f1f6065d0cfdaf7921 100644 --- a/src/puissance4/Main.java +++ b/src/puissance4/Main.java @@ -1,13 +1,14 @@ package puissance4; +import puissance4.model.Grille; + import java.awt.*; public class Main { public static void main(String[] args) { - System.out.println("Hello World"); - - + Grille grid = new Grille(); + grid.displayGrille(); } } diff --git a/src/puissance4/controleur/FullRowDetection.java b/src/puissance4/controleur/FullRowDetection.java index c11d866297c3c1c853ac19360fbb3bbe6f927d5e..a32217e879cae0a8f469f8e4e688b8be665e6064 100644 --- a/src/puissance4/controleur/FullRowDetection.java +++ b/src/puissance4/controleur/FullRowDetection.java @@ -113,8 +113,8 @@ public class FullRowDetection { board[j][i] = tab[height-i-1][j] ; - System.out.println( Arrays.toString( - new FullRowDetection().detect( board ) + System.out.println( Arrays.toString( + new FullRowDetection().detect( board ) ) ); } diff --git a/src/puissance4/model/Case.java b/src/puissance4/model/Case.java index 9d4ec69abd7a5cd1b13207a1dbcf046eb7cd2aca..9a872a3bbdd22f4c61d75728bd3f506144a59fe8 100644 --- a/src/puissance4/model/Case.java +++ b/src/puissance4/model/Case.java @@ -1,32 +1,16 @@ package puissance4.model; -import java.util.ArrayList; -import - public class Case { private int posLigne; private int posColonne; - public Case(int posL, int posC) { - this.posLigne=posL; - this.posColonne=posC; - } - public boolean[][] getEnplacement(int posL, int posC){ - return grille[posL][posC]; - } + public Case() { - public void setEnplacement(int posL, int posC){ - this.posLigne=posL; - this.posColonne=posC; } - public void Remplir(int posL, int posC){ - for (int i = 0;i < grille.length; i++) { - for (int j = 0; j < grille[i].length; j++) { - grille[posL][posC] = true; - } - } + private void Remplir(int posL, int posC){ + } } diff --git a/src/puissance4/model/Grille.java b/src/puissance4/model/Grille.java index 1ae9202045e2086856e2992d2378b34b4c966a37..c3a74a54c8a17503975b424b82fb131899cbe740 100644 --- a/src/puissance4/model/Grille.java +++ b/src/puissance4/model/Grille.java @@ -1,49 +1,44 @@ package puissance4.model; -import java.util.Arrays; - public class Grille { - private final int nbCases; - private int nblignes; - private int nbColonnes; - public boolean[][] grille; - - public Grille () - { - this.nbCases = 42; - this.nblignes = 6; - this.nbColonnes = 7; - grille = new boolean[nblignes][nbColonnes]; + private final int nbCases = 42; + private final int nblignes = 6; + private final int nbColonnes = 7; + private boolean[][] grid; + + public Grille() { + grid = new boolean[nblignes][nbColonnes]; } public int getNblignes() { - return nblignes; + return this.nblignes; } public int getNbColonnes() { - return nbColonnes; + return this.nbColonnes; } - public void setNblignes(int nb) { - this.nblignes = nb; + public int getNbCases(){ + return this.nbCases; } - public void setNbColonnes(int nb) { - this.nbColonnes = nb; + public boolean[][] getGrille(){ + return this.grid; } - public boolean estVide() { - return Arrays.toString(grille).isEmpty(); - } + public void displayGrille(){ + String res = ""; - public boolean estPleine() { - boolean res = false; - for (int i = 0; i < grille.length; i++) { - if (i == grille.length - 1) { - res = true; + for (int i = 0; i < this.nblignes; i++) { + for (int j = 0; j < this.nbColonnes; j++) { + System.out.print(this.grid[i][j] + " "); } + System.out.println(); } - return res; + System.out.println(); } } + + + diff --git a/src/puissance4/model/Pion.java b/src/puissance4/model/Pion.java index 4a682e362828bdb96656937e61a98b61f0426934..aeeb337b1aaaff3079c5963798199bea893cae40 100644 --- a/src/puissance4/model/Pion.java +++ b/src/puissance4/model/Pion.java @@ -2,13 +2,13 @@ package puissance4.model; import java.awt.*; -public class Pion{ +public class Pion { private Color couleur; private Case emplacement; - - public Pion(Color couleur) { - this.couleur=couleur; + + public Pion(){ + } public Color getCouleur() {