diff --git a/ressources/cartes/1.png b/ressources/cartes/1.png new file mode 100644 index 0000000..87c25f4 Binary files /dev/null and b/ressources/cartes/1.png differ diff --git a/ressources/cartes/10.png b/ressources/cartes/10.png new file mode 100644 index 0000000..76e1177 Binary files /dev/null and b/ressources/cartes/10.png differ diff --git a/ressources/cartes/11.png b/ressources/cartes/11.png new file mode 100644 index 0000000..1d2048e Binary files /dev/null and b/ressources/cartes/11.png differ diff --git a/ressources/cartes/12.png b/ressources/cartes/12.png new file mode 100644 index 0000000..747c24b Binary files /dev/null and b/ressources/cartes/12.png differ diff --git a/ressources/cartes/13.png b/ressources/cartes/13.png new file mode 100644 index 0000000..6bae6a0 Binary files /dev/null and b/ressources/cartes/13.png differ diff --git a/ressources/cartes/14.png b/ressources/cartes/14.png new file mode 100644 index 0000000..88e44ed Binary files /dev/null and b/ressources/cartes/14.png differ diff --git a/ressources/cartes/15.png b/ressources/cartes/15.png new file mode 100644 index 0000000..f1a35a4 Binary files /dev/null and b/ressources/cartes/15.png differ diff --git a/ressources/cartes/16.png b/ressources/cartes/16.png new file mode 100644 index 0000000..71081e7 Binary files /dev/null and b/ressources/cartes/16.png differ diff --git a/ressources/cartes/17.png b/ressources/cartes/17.png new file mode 100644 index 0000000..77fe5e0 Binary files /dev/null and b/ressources/cartes/17.png differ diff --git a/ressources/cartes/18.png b/ressources/cartes/18.png new file mode 100644 index 0000000..f431216 Binary files /dev/null and b/ressources/cartes/18.png differ diff --git a/ressources/cartes/19.png b/ressources/cartes/19.png new file mode 100644 index 0000000..f431216 Binary files /dev/null and b/ressources/cartes/19.png differ diff --git a/ressources/cartes/2.png b/ressources/cartes/2.png new file mode 100644 index 0000000..479b580 Binary files /dev/null and b/ressources/cartes/2.png differ diff --git a/ressources/cartes/20.png b/ressources/cartes/20.png new file mode 100644 index 0000000..f431216 Binary files /dev/null and b/ressources/cartes/20.png differ diff --git a/ressources/cartes/21.png b/ressources/cartes/21.png new file mode 100644 index 0000000..8549fe5 Binary files /dev/null and b/ressources/cartes/21.png differ diff --git a/ressources/cartes/22.png b/ressources/cartes/22.png new file mode 100644 index 0000000..08d1254 Binary files /dev/null and b/ressources/cartes/22.png differ diff --git a/ressources/cartes/23.png b/ressources/cartes/23.png new file mode 100644 index 0000000..9603366 Binary files /dev/null and b/ressources/cartes/23.png differ diff --git a/ressources/cartes/24.png b/ressources/cartes/24.png new file mode 100644 index 0000000..7867178 Binary files /dev/null and b/ressources/cartes/24.png differ diff --git a/ressources/cartes/25.png b/ressources/cartes/25.png new file mode 100644 index 0000000..ae55ba7 Binary files /dev/null and b/ressources/cartes/25.png differ diff --git a/ressources/cartes/26.png b/ressources/cartes/26.png new file mode 100644 index 0000000..737d2c9 Binary files /dev/null and b/ressources/cartes/26.png differ diff --git a/ressources/cartes/27.png b/ressources/cartes/27.png new file mode 100644 index 0000000..322aeba Binary files /dev/null and b/ressources/cartes/27.png differ diff --git a/ressources/cartes/28.png b/ressources/cartes/28.png new file mode 100644 index 0000000..1595b64 Binary files /dev/null and b/ressources/cartes/28.png differ diff --git a/ressources/cartes/29.png b/ressources/cartes/29.png new file mode 100644 index 0000000..7990a74 Binary files /dev/null and b/ressources/cartes/29.png differ diff --git a/ressources/cartes/3.png b/ressources/cartes/3.png new file mode 100644 index 0000000..9adb7e8 Binary files /dev/null and b/ressources/cartes/3.png differ diff --git a/ressources/cartes/30.png b/ressources/cartes/30.png new file mode 100644 index 0000000..ba38e98 Binary files /dev/null and b/ressources/cartes/30.png differ diff --git a/ressources/cartes/31.png b/ressources/cartes/31.png new file mode 100644 index 0000000..ba38e98 Binary files /dev/null and b/ressources/cartes/31.png differ diff --git a/ressources/cartes/32.png b/ressources/cartes/32.png new file mode 100644 index 0000000..062245c Binary files /dev/null and b/ressources/cartes/32.png differ diff --git a/ressources/cartes/33.png b/ressources/cartes/33.png new file mode 100644 index 0000000..4ceadd6 Binary files /dev/null and b/ressources/cartes/33.png differ diff --git a/ressources/cartes/34.png b/ressources/cartes/34.png new file mode 100644 index 0000000..031ea79 Binary files /dev/null and b/ressources/cartes/34.png differ diff --git a/ressources/cartes/35.png b/ressources/cartes/35.png new file mode 100644 index 0000000..8355297 Binary files /dev/null and b/ressources/cartes/35.png differ diff --git a/ressources/cartes/36.png b/ressources/cartes/36.png new file mode 100644 index 0000000..38fe7c6 Binary files /dev/null and b/ressources/cartes/36.png differ diff --git a/ressources/cartes/37.png b/ressources/cartes/37.png new file mode 100644 index 0000000..4a37f6a Binary files /dev/null and b/ressources/cartes/37.png differ diff --git a/ressources/cartes/38.png b/ressources/cartes/38.png new file mode 100644 index 0000000..0b7c1f4 Binary files /dev/null and b/ressources/cartes/38.png differ diff --git a/ressources/cartes/39.png b/ressources/cartes/39.png new file mode 100644 index 0000000..f9903d4 Binary files /dev/null and b/ressources/cartes/39.png differ diff --git a/ressources/cartes/4.png b/ressources/cartes/4.png new file mode 100644 index 0000000..a9c8a4a Binary files /dev/null and b/ressources/cartes/4.png differ diff --git a/ressources/cartes/40.png b/ressources/cartes/40.png new file mode 100644 index 0000000..2659c5c Binary files /dev/null and b/ressources/cartes/40.png differ diff --git a/ressources/cartes/41.png b/ressources/cartes/41.png new file mode 100644 index 0000000..ea59865 Binary files /dev/null and b/ressources/cartes/41.png differ diff --git a/ressources/cartes/42.png b/ressources/cartes/42.png new file mode 100644 index 0000000..b8e4c61 Binary files /dev/null and b/ressources/cartes/42.png differ diff --git a/ressources/cartes/43.png b/ressources/cartes/43.png new file mode 100644 index 0000000..376d9c8 Binary files /dev/null and b/ressources/cartes/43.png differ diff --git a/ressources/cartes/44.png b/ressources/cartes/44.png new file mode 100644 index 0000000..0d34240 Binary files /dev/null and b/ressources/cartes/44.png differ diff --git a/ressources/cartes/45.png b/ressources/cartes/45.png new file mode 100644 index 0000000..98427b8 Binary files /dev/null and b/ressources/cartes/45.png differ diff --git a/ressources/cartes/46.png b/ressources/cartes/46.png new file mode 100644 index 0000000..ca199a7 Binary files /dev/null and b/ressources/cartes/46.png differ diff --git a/ressources/cartes/47.png b/ressources/cartes/47.png new file mode 100644 index 0000000..e028f67 Binary files /dev/null and b/ressources/cartes/47.png differ diff --git a/ressources/cartes/48.png b/ressources/cartes/48.png new file mode 100644 index 0000000..82c4480 Binary files /dev/null and b/ressources/cartes/48.png differ diff --git a/ressources/cartes/49.png b/ressources/cartes/49.png new file mode 100644 index 0000000..38a3a29 Binary files /dev/null and b/ressources/cartes/49.png differ diff --git a/ressources/cartes/5.png b/ressources/cartes/5.png new file mode 100644 index 0000000..efd9318 Binary files /dev/null and b/ressources/cartes/5.png differ diff --git a/ressources/cartes/50.png b/ressources/cartes/50.png new file mode 100644 index 0000000..31d0140 Binary files /dev/null and b/ressources/cartes/50.png differ diff --git a/ressources/cartes/51.png b/ressources/cartes/51.png new file mode 100644 index 0000000..61281da Binary files /dev/null and b/ressources/cartes/51.png differ diff --git a/ressources/cartes/52.png b/ressources/cartes/52.png new file mode 100644 index 0000000..0bf6c3f Binary files /dev/null and b/ressources/cartes/52.png differ diff --git a/ressources/cartes/53.png b/ressources/cartes/53.png new file mode 100644 index 0000000..9d99951 Binary files /dev/null and b/ressources/cartes/53.png differ diff --git a/ressources/cartes/54.png b/ressources/cartes/54.png new file mode 100644 index 0000000..152e6ce Binary files /dev/null and b/ressources/cartes/54.png differ diff --git a/ressources/cartes/55.png b/ressources/cartes/55.png new file mode 100644 index 0000000..4523958 Binary files /dev/null and b/ressources/cartes/55.png differ diff --git a/ressources/cartes/56.png b/ressources/cartes/56.png new file mode 100644 index 0000000..7628add Binary files /dev/null and b/ressources/cartes/56.png differ diff --git a/ressources/cartes/57.png b/ressources/cartes/57.png new file mode 100644 index 0000000..bef4ca3 Binary files /dev/null and b/ressources/cartes/57.png differ diff --git a/ressources/cartes/58.png b/ressources/cartes/58.png new file mode 100644 index 0000000..6e49f66 Binary files /dev/null and b/ressources/cartes/58.png differ diff --git a/ressources/cartes/59.png b/ressources/cartes/59.png new file mode 100644 index 0000000..2a109eb Binary files /dev/null and b/ressources/cartes/59.png differ diff --git a/ressources/cartes/6.png b/ressources/cartes/6.png new file mode 100644 index 0000000..c294bd4 Binary files /dev/null and b/ressources/cartes/6.png differ diff --git a/ressources/cartes/60.png b/ressources/cartes/60.png new file mode 100644 index 0000000..ecb809c Binary files /dev/null and b/ressources/cartes/60.png differ diff --git a/ressources/cartes/61.png b/ressources/cartes/61.png new file mode 100644 index 0000000..b3e5f11 Binary files /dev/null and b/ressources/cartes/61.png differ diff --git a/ressources/cartes/62.png b/ressources/cartes/62.png new file mode 100644 index 0000000..686a963 Binary files /dev/null and b/ressources/cartes/62.png differ diff --git a/ressources/cartes/63.png b/ressources/cartes/63.png new file mode 100644 index 0000000..2ca33f3 Binary files /dev/null and b/ressources/cartes/63.png differ diff --git a/ressources/cartes/64.png b/ressources/cartes/64.png new file mode 100644 index 0000000..a95a1e7 Binary files /dev/null and b/ressources/cartes/64.png differ diff --git a/ressources/cartes/65.png b/ressources/cartes/65.png new file mode 100644 index 0000000..bba2932 Binary files /dev/null and b/ressources/cartes/65.png differ diff --git a/ressources/cartes/66.png b/ressources/cartes/66.png new file mode 100644 index 0000000..713f928 Binary files /dev/null and b/ressources/cartes/66.png differ diff --git a/ressources/cartes/67.png b/ressources/cartes/67.png new file mode 100644 index 0000000..50b07e8 Binary files /dev/null and b/ressources/cartes/67.png differ diff --git a/ressources/cartes/7.png b/ressources/cartes/7.png new file mode 100644 index 0000000..8f53b15 Binary files /dev/null and b/ressources/cartes/7.png differ diff --git a/ressources/cartes/8.png b/ressources/cartes/8.png new file mode 100644 index 0000000..9bf7f35 Binary files /dev/null and b/ressources/cartes/8.png differ diff --git a/ressources/cartes/9.png b/ressources/cartes/9.png new file mode 100644 index 0000000..76e1177 Binary files /dev/null and b/ressources/cartes/9.png differ diff --git a/src/database/CreatingCardsTest.java b/src/database/CreatingCardsTest.java index 7dd408f..0103bf8 100644 --- a/src/database/CreatingCardsTest.java +++ b/src/database/CreatingCardsTest.java @@ -44,25 +44,25 @@ public class CreatingCardsTest { //Ange gardien try { - QueryGenerator.queryInsertObject(2,new CartePiochable(CartePiochable.Type.LUMIERE, + DatabaseManager.queryInsertObject(2,new CartePiochable(CartePiochable.Type.LUMIERE, new EffetSelf(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_IMMUNITY, 1, true)))); //Avénement suprême - QueryGenerator.queryInsertObject(3,new CartePiochable(CartePiochable.Type.LUMIERE, + DatabaseManager.queryInsertObject(3,new CartePiochable(CartePiochable.Type.LUMIERE, new EffetSelf(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP, 20, true)) ,new ConditionMultiple(new ConditionEquipe(CartePersonnage.Equipe.HUNTER), new ConditionReveal()) )); //Barre de chocolat - QueryGenerator.queryInsertObject(4,new CartePiochable(CartePiochable.Type.LUMIERE, + DatabaseManager.queryInsertObject(4,new CartePiochable(CartePiochable.Type.LUMIERE, new EffetSelf(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP, 20, true)) ,new ConditionMultiple(new ConditionClassPersonnage(Allie.class,Emi.class,Metamorphe.class), new ConditionReveal()) )); //Bénédiction - QueryGenerator.queryInsertObject(5,new CartePiochable(CartePiochable.Type.LUMIERE,new EffetChoisirCible(new ActionAltererStatistiquesJoueurRoll(Joueur.PLAYER_HP,6, true)))); + DatabaseManager.queryInsertObject(5,new CartePiochable(CartePiochable.Type.LUMIERE,new EffetChoisirCible(new ActionAltererStatistiquesJoueurRoll(Joueur.PLAYER_HP,6, true)))); // BOUSSOLE mystique @@ -73,58 +73,58 @@ public class CreatingCardsTest { // 8 // Eau bénite - QueryGenerator.queryInsertObject(9,new CartePiochable(CartePiochable.Type.LUMIERE,new EffetSelf(new ActionAltererStatistiquesJoueurRoll(Joueur.PLAYER_HP,2, true)))); - QueryGenerator.queryInsertObject(10,new CartePiochable(CartePiochable.Type.LUMIERE,new EffetSelf(new ActionAltererStatistiquesJoueurRoll(Joueur.PLAYER_HP,2, true)))); + DatabaseManager.queryInsertObject(9,new CartePiochable(CartePiochable.Type.LUMIERE,new EffetSelf(new ActionAltererStatistiquesJoueurRoll(Joueur.PLAYER_HP,2, true)))); + DatabaseManager.queryInsertObject(10,new CartePiochable(CartePiochable.Type.LUMIERE,new EffetSelf(new ActionAltererStatistiquesJoueurRoll(Joueur.PLAYER_HP,2, true)))); // Eclair purificateur - QueryGenerator.queryInsertObject(11,new CartePiochable(CartePiochable.Type.LUMIERE,new EffetCiblerTous(new ActionAltererStatistiquesJoueurRoll(Joueur.PLAYER_HP, -2, true)))); + DatabaseManager.queryInsertObject(11,new CartePiochable(CartePiochable.Type.LUMIERE,new EffetCiblerTous(new ActionAltererStatistiquesJoueurRoll(Joueur.PLAYER_HP, -2, true)))); // Lance de longinus - QueryGenerator.queryInsertObject(12,new CarteEquipementStat(CartePiochable.Type.LUMIERE, + DatabaseManager.queryInsertObject(12,new CarteEquipementStat(CartePiochable.Type.LUMIERE, new EffetSelf(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_DAMAGE, 2, true)) ,new ConditionMultiple(new ConditionEquipe(CartePersonnage.Equipe.HUNTER), new ConditionReveal()) )); // Miroir divin - QueryGenerator.queryInsertObject(13,new CartePiochable(CartePiochable.Type.LUMIERE,new EffetSelf(new ActionReveal()),new ConditionClassPersonnage(Vampire.class,LoupGarou.class))); + DatabaseManager.queryInsertObject(13,new CartePiochable(CartePiochable.Type.LUMIERE,new EffetSelf(new ActionReveal()),new ConditionClassPersonnage(Vampire.class,LoupGarou.class))); // Premiers secours - QueryGenerator.queryInsertObject(14, new CartePiochable(CartePiochable.Type.LUMIERE,new EffetCiblerTous(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP, 7, false)))); + DatabaseManager.queryInsertObject(14, new CartePiochable(CartePiochable.Type.LUMIERE,new EffetCiblerTous(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP, 7, false)))); //Savoir ancestral - QueryGenerator.queryInsertObject(15, new CartePiochable(CartePiochable.Type.LUMIERE,new EffetSelf(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_TURN, 1, true)))); + DatabaseManager.queryInsertObject(15, new CartePiochable(CartePiochable.Type.LUMIERE,new EffetSelf(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_TURN, 1, true)))); //Toge sainte - QueryGenerator.queryInsertObject(16, new CartePiochable(CartePiochable.Type.LUMIERE,new EffetSelf(new ActionMultiple(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_RESISTANCE, 1, true),new ActionAltererStatistiquesJoueur(Joueur.PLAYER_DAMAGE, -1, true))))); + DatabaseManager.queryInsertObject(16, new CartePiochable(CartePiochable.Type.LUMIERE,new EffetSelf(new ActionMultiple(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_RESISTANCE, 1, true),new ActionAltererStatistiquesJoueur(Joueur.PLAYER_DAMAGE, -1, true))))); // Ténèbre // Araignée Sanguinaire - QueryGenerator.queryInsertObject(17, new CartePiochable(CartePiochable.Type.TENEBRE,new EffetMultiple(new EffetCiblerTous(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP, -2, true)), + DatabaseManager.queryInsertObject(17, new CartePiochable(CartePiochable.Type.TENEBRE,new EffetMultiple(new EffetCiblerTous(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP, -2, true)), new EffetSelf(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP, -2, true))))); // Chauve - souris vampire - QueryGenerator.queryInsertObject(18, new CartePiochable(CartePiochable.Type.TENEBRE,new EffetMultiple(new EffetCiblerTous(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP, -2, true)), + DatabaseManager.queryInsertObject(18, new CartePiochable(CartePiochable.Type.TENEBRE,new EffetMultiple(new EffetCiblerTous(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP, -2, true)), new EffetSelf(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP, 1, true))))); - QueryGenerator.queryInsertObject(19, new CartePiochable(CartePiochable.Type.TENEBRE,new EffetMultiple(new EffetCiblerTous(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP, -2, true)), + DatabaseManager.queryInsertObject(19, new CartePiochable(CartePiochable.Type.TENEBRE,new EffetMultiple(new EffetCiblerTous(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP, -2, true)), new EffetSelf(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP, 1, true))))); - QueryGenerator.queryInsertObject(20, new CartePiochable(CartePiochable.Type.TENEBRE,new EffetMultiple(new EffetCiblerTous(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP, -2, true)), + DatabaseManager.queryInsertObject(20, new CartePiochable(CartePiochable.Type.TENEBRE,new EffetMultiple(new EffetCiblerTous(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP, -2, true)), new EffetSelf(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP, 1, true))))); // Dynamite @@ -133,11 +133,11 @@ public class CreatingCardsTest { // Hache tueuse - QueryGenerator.queryInsertObject(22,new CarteEquipementStat(CartePiochable.Type.TENEBRE, + DatabaseManager.queryInsertObject(22,new CarteEquipementStat(CartePiochable.Type.TENEBRE, new EffetSelf(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_DAMAGE, 1, true)))); // Hachoir maudit - QueryGenerator.queryInsertObject(23,new CarteEquipementStat(CartePiochable.Type.TENEBRE, + DatabaseManager.queryInsertObject(23,new CarteEquipementStat(CartePiochable.Type.TENEBRE, new EffetSelf(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_DAMAGE, 1, true)))); @@ -150,39 +150,39 @@ public class CreatingCardsTest { // Poupé démoniaque // 26 - QueryGenerator.queryInsertObject(28,new CartePiochable(CartePiochable.Type.TENEBRE, + DatabaseManager.queryInsertObject(28,new CartePiochable(CartePiochable.Type.TENEBRE, new EffetSelf(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP, 20, true)) ,new ConditionMultiple(new ConditionEquipe(CartePersonnage.Equipe.SHADOW), new ConditionReveal()) )); // 29 - QueryGenerator.queryInsertObject(30,new CartePiochable(CartePiochable.Type.TENEBRE, + DatabaseManager.queryInsertObject(30,new CartePiochable(CartePiochable.Type.TENEBRE, new EffetChoisirCible(new ActionVoler(ActionVoler.VOLER)))); - QueryGenerator.queryInsertObject(31,new CartePiochable(CartePiochable.Type.TENEBRE, + DatabaseManager.queryInsertObject(31,new CartePiochable(CartePiochable.Type.TENEBRE, new EffetChoisirCible(new ActionVoler(ActionVoler.VOLER)))); - QueryGenerator.queryInsertObject(32,new CarteEquipementStat(CartePiochable.Type.TENEBRE, + DatabaseManager.queryInsertObject(32,new CarteEquipementStat(CartePiochable.Type.TENEBRE, new EffetSelf(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_DAMAGE, 1, true)))); // Vision clairvoyante - QueryGenerator.queryInsertObject(33, new CartePiochable(CartePiochable.Type.VISION,new EffetChoisirCible(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP, -1, true)), + DatabaseManager.queryInsertObject(33, new CartePiochable(CartePiochable.Type.VISION,new EffetChoisirCible(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP, -1, true)), new ConditionStatistiques(ConditionStatistiques.JOUEUR, Joueur.PLAYER_HP, 11, ConditionStatistiques.LESS))); // Vision cupide - QueryGenerator.queryInsertObject(34,new CartePiochable(CartePiochable.Type.VISION,new EffetChoisirEffet(new EffetChoisirCible(new ActionVoler(ActionVoler.DONNER)),new EffetChoisirCible(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP,-1,true))), + DatabaseManager.queryInsertObject(34,new CartePiochable(CartePiochable.Type.VISION,new EffetChoisirEffet(new EffetChoisirCible(new ActionVoler(ActionVoler.DONNER)),new EffetChoisirCible(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP,-1,true))), new ConditionEquipe(CartePersonnage.Equipe.NEUTRE,CartePersonnage.Equipe.SHADOW))); - QueryGenerator.queryInsertObject(35,new CartePiochable(CartePiochable.Type.VISION,new EffetChoisirEffet(new EffetChoisirCible(new ActionVoler(ActionVoler.DONNER)),new EffetChoisirCible(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP,-1,true))), + DatabaseManager.queryInsertObject(35,new CartePiochable(CartePiochable.Type.VISION,new EffetChoisirEffet(new EffetChoisirCible(new ActionVoler(ActionVoler.DONNER)),new EffetChoisirCible(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP,-1,true))), new ConditionEquipe(CartePersonnage.Equipe.NEUTRE,CartePersonnage.Equipe.SHADOW))); // Vision destructrice - QueryGenerator.queryInsertObject(36, new CartePiochable(CartePiochable.Type.VISION,new EffetChoisirCible(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP, -2, true)), + DatabaseManager.queryInsertObject(36, new CartePiochable(CartePiochable.Type.VISION,new EffetChoisirCible(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP, -2, true)), new ConditionStatistiques(ConditionStatistiques.JOUEUR, Joueur.PLAYER_HP, 12, ConditionStatistiques.MORE))); @@ -190,53 +190,53 @@ public class CreatingCardsTest { // Vision enivrante - QueryGenerator.queryInsertObject(38,new CartePiochable(CartePiochable.Type.VISION,new EffetChoisirEffet(new EffetChoisirCible(new ActionVoler(ActionVoler.DONNER)),new EffetChoisirCible(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP,-1,true))), + DatabaseManager.queryInsertObject(38,new CartePiochable(CartePiochable.Type.VISION,new EffetChoisirEffet(new EffetChoisirCible(new ActionVoler(ActionVoler.DONNER)),new EffetChoisirCible(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP,-1,true))), new ConditionEquipe(CartePersonnage.Equipe.NEUTRE,CartePersonnage.Equipe.SHADOW))); - QueryGenerator.queryInsertObject(39,new CartePiochable(CartePiochable.Type.VISION,new EffetChoisirEffet(new EffetChoisirCible(new ActionVoler(ActionVoler.DONNER)),new EffetChoisirCible(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP,-1,true))), + DatabaseManager.queryInsertObject(39,new CartePiochable(CartePiochable.Type.VISION,new EffetChoisirEffet(new EffetChoisirCible(new ActionVoler(ActionVoler.DONNER)),new EffetChoisirCible(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP,-1,true))), new ConditionEquipe(CartePersonnage.Equipe.NEUTRE,CartePersonnage.Equipe.SHADOW))); // Vision Foudroyante - QueryGenerator.queryInsertObject(40,new CartePiochable(CartePiochable.Type.VISION,new EffetChoisirCible(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP,-1,true)), + DatabaseManager.queryInsertObject(40,new CartePiochable(CartePiochable.Type.VISION,new EffetChoisirCible(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP,-1,true)), new ConditionEquipe(CartePersonnage.Equipe.SHADOW))); // Vision furtive - QueryGenerator.queryInsertObject(41,new CartePiochable(CartePiochable.Type.VISION,new EffetChoisirEffet(new EffetChoisirCible(new ActionVoler(ActionVoler.DONNER)),new EffetChoisirCible(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP,-1,true))), + DatabaseManager.queryInsertObject(41,new CartePiochable(CartePiochable.Type.VISION,new EffetChoisirEffet(new EffetChoisirCible(new ActionVoler(ActionVoler.DONNER)),new EffetChoisirCible(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP,-1,true))), new ConditionEquipe(CartePersonnage.Equipe.HUNTER,CartePersonnage.Equipe.SHADOW))); - QueryGenerator.queryInsertObject(42,new CartePiochable(CartePiochable.Type.VISION,new EffetChoisirEffet(new EffetChoisirCible(new ActionVoler(ActionVoler.DONNER)),new EffetChoisirCible(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP,-1,true))), + DatabaseManager.queryInsertObject(42,new CartePiochable(CartePiochable.Type.VISION,new EffetChoisirEffet(new EffetChoisirCible(new ActionVoler(ActionVoler.DONNER)),new EffetChoisirCible(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP,-1,true))), new ConditionEquipe(CartePersonnage.Equipe.HUNTER,CartePersonnage.Equipe.SHADOW))); // Vision Mortifère - QueryGenerator.queryInsertObject(43,new CartePiochable(CartePiochable.Type.VISION,new EffetChoisirCible(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP,-1,true)), + DatabaseManager.queryInsertObject(43,new CartePiochable(CartePiochable.Type.VISION,new EffetChoisirCible(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP,-1,true)), new ConditionEquipe(CartePersonnage.Equipe.SHADOW))); // Vision lugubre - QueryGenerator.queryInsertObject(45,new CartePiochable(CartePiochable.Type.VISION,new EffetChoisirCible(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP,-2,true)), + DatabaseManager.queryInsertObject(45,new CartePiochable(CartePiochable.Type.VISION,new EffetChoisirCible(new ActionAltererStatistiquesJoueur(Joueur.PLAYER_HP,-2,true)), new ConditionEquipe(CartePersonnage.Equipe.SHADOW))); // Vision réconfortante // Vision suprême - QueryGenerator.queryInsertObject(48,new Allie()); - QueryGenerator.queryInsertObject(49,new Bob()); - QueryGenerator.queryInsertObject(50,new Charles()); + DatabaseManager.queryInsertObject(48,new Allie()); + DatabaseManager.queryInsertObject(49,new Bob()); + DatabaseManager.queryInsertObject(50,new Charles()); - QueryGenerator.queryInsertObject(51,new Daniel()); - QueryGenerator.queryInsertObject(52,new Emi()); - QueryGenerator.queryInsertObject(53,new Franklin()); + DatabaseManager.queryInsertObject(51,new Daniel()); + DatabaseManager.queryInsertObject(52,new Emi()); + DatabaseManager.queryInsertObject(53,new Franklin()); - QueryGenerator.queryInsertObject(54,new Georges()); - QueryGenerator.queryInsertObject(55,new LoupGarou()); - QueryGenerator.queryInsertObject(56,new Metamorphe()); - QueryGenerator.queryInsertObject(57,new Vampire()); + DatabaseManager.queryInsertObject(54,new Georges()); + DatabaseManager.queryInsertObject(55,new LoupGarou()); + DatabaseManager.queryInsertObject(56,new Metamorphe()); + DatabaseManager.queryInsertObject(57,new Vampire()); } catch (IOException | SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); diff --git a/src/database/DatabaseManager.java b/src/database/DatabaseManager.java index e3f2a72..41084a4 100644 --- a/src/database/DatabaseManager.java +++ b/src/database/DatabaseManager.java @@ -1,7 +1,13 @@ package database; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.ObjectOutputStream; import java.sql.Connection; import java.sql.DriverManager; +import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; @@ -35,5 +41,61 @@ public class DatabaseManager { } return list; } + + public static List remplirTableSansImage(String query) { + List list = new ArrayList(); + try (Connection connection = connect()) { + + //System.out.println("Connected to PostgreSQL database!"); + Statement statement = connection.createStatement(); + //System.out.println("Reading records..."); + ResultSet retour = statement.executeQuery(query); + while (retour.next()) { + list.add(new Record(retour.getString("id"), retour.getString("nom"), null, retour.getBytes("objet"))); + } + } catch (SQLException e) { + System.err.println("Connection failure."); + e.printStackTrace(); + } + return list; + } + + public static void queryInsertObject(int id, Object o) throws IOException, SQLException { + + String table = null; + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ObjectOutputStream oos; + + oos = new ObjectOutputStream(baos); + oos.writeObject(o); + oos.close(); + + ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); + + byte[] object = bais.readAllBytes(); + InputStream objectIS = new ByteArrayInputStream(object); + + if(id <= 16) { + table = QueryGenerator.getTable("CartesLumiere"); + } else if(id <= 32) { + table = QueryGenerator.getTable("CartesTenebre"); + } else if(id <= 47) { + table = QueryGenerator.getTable("CartesVision"); + } else if(id <= 57) { + table = QueryGenerator.getTable("CartesPersonnage"); + } else if(id <= 61) { + table = QueryGenerator.getTable("CartesDos"); + } + + String query = null; + query = "UPDATE " + table + " SET objet = ? " + + " WHERE id = ? " ; + + Connection conn = connect(); + PreparedStatement pst = conn.prepareStatement(query); + pst.setBinaryStream(1, objectIS); + pst.setInt(2, id); + pst.executeUpdate(); + } } diff --git a/src/database/QueryGenerator.java b/src/database/QueryGenerator.java index 59daaad..7147a91 100644 --- a/src/database/QueryGenerator.java +++ b/src/database/QueryGenerator.java @@ -1,13 +1,7 @@ package database; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.ObjectOutputStream; import java.sql.Connection; import java.sql.DriverManager; -import java.sql.PreparedStatement; import java.sql.SQLException; public class QueryGenerator { @@ -64,41 +58,5 @@ public class QueryGenerator { return "SELECT * FROM " + table + " WHERE id = " + id; } - public static void queryInsertObject(int id, Object o) throws IOException, SQLException { - - String table = null; - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - ObjectOutputStream oos; - - oos = new ObjectOutputStream(baos); - oos.writeObject(o); - oos.close(); - - ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); - - byte[] object = bais.readAllBytes(); - InputStream objectIS = new ByteArrayInputStream(object); - - if(id <= 16) { - table = getTable("CartesLumiere"); - } else if(id <= 32) { - table = getTable("CartesTenebre"); - } else if(id <= 47) { - table = getTable("CartesVision"); - } else if(id <= 57) { - table = getTable("CartesPersonnage"); - } else if(id <= 61) { - table = getTable("CartesDos"); - } - - String query = null; - query = "UPDATE " + table + " SET objet = ? " - + " WHERE id = ? " ; - - Connection conn = connect(); - PreparedStatement pst = conn.prepareStatement(query); - pst.setBinaryStream(1, objectIS); - pst.setInt(2, id); - pst.executeUpdate(); - } + } diff --git a/src/database/Record.java b/src/database/Record.java index da4cbec..32b06ee 100644 --- a/src/database/Record.java +++ b/src/database/Record.java @@ -31,15 +31,15 @@ public class Record { this.obj = obj; } - public String getId() { + protected String getId() { return id; } - public String getNom() { + protected String getNom() { return nom; } - public byte[] getImg() { + protected byte[] getImg() { return img; } @@ -48,7 +48,7 @@ public class Record { return String.format("%-20.30s %-30.30s %-20.30s %-20.30s%n", this.getId(), this.getNom(), this.getImg(), this.getObjet()); } - public byte[] getObjet() { + protected byte[] getObjet() { return this.obj; } diff --git a/src/database/RessourceLoader.java b/src/database/RessourceLoader.java index f33ad8f..fe42aba 100644 --- a/src/database/RessourceLoader.java +++ b/src/database/RessourceLoader.java @@ -1,16 +1,46 @@ package database; +import java.awt.Image; import java.io.ByteArrayInputStream; +import java.io.File; import java.io.IOException; import java.io.ObjectInputStream; import java.util.HashMap; import java.util.Map; +import javax.imageio.ImageIO; + import carte.Carte; import carte.CartePiochable; +import personnage.CartePersonnage; public class RessourceLoader { + + public static final String CARTES_PERSONNAGE = "cp"; + public static final String CARTES_LUMIERE = "cl"; + public static final String CARTES_TENEBRE = "ct"; + public static final String CARTES_VISION = "cv"; + + public static final String DOS_PERSONNAGE = "dp"; + public static final String DOS_LUMIERE = "dl"; + public static final String DOS_TENEBRE = "dt"; + public static final String DOS_VISION = "dv"; + + private final int ID_DOS_PERSONNAGE = 60; + private final int ID_DOS_LUMIERE = 58; + private final int ID_DOS_TENEBRE= 59; + private final int ID_DOS_VISION= 61; + + private Map> ressourcesCartes; + private Map ressourcesDosCartes; + + + public RessourceLoader() { + this.ressourcesCartes = new HashMap>(); + this.ressourcesDosCartes = new HashMap(); + } + private static Map loadCards() throws ClassNotFoundException, IOException{ Table t = new Table(); @@ -30,9 +60,9 @@ public class RessourceLoader { return cartes; } - private static Map getMapType(CartePiochable.Type t, Map cartes){ + private static Map getMapType(CartePiochable.Type t, Map cartes){ - Map cartesType = new HashMap(); + Map cartesType = new HashMap(); for(Integer i: cartes.keySet()) { @@ -50,25 +80,86 @@ public class RessourceLoader { return cartesType; } - - - public static Object deserialize(byte[] data) throws IOException, ClassNotFoundException { + private static Map getMapPersonnage(Map cartes){ + + Map cartesPersonnage = new HashMap(); + + for(Integer i: cartes.keySet()) { + + Carte c = cartes.get(i); + if(cartes.get(i) instanceof CartePersonnage) { + + CartePersonnage carte = (CartePersonnage) c; + cartesPersonnage.put(i,carte); + } + } + return cartesPersonnage; + } + + private static Object deserialize(byte[] data) throws IOException, ClassNotFoundException { ByteArrayInputStream in = new ByteArrayInputStream(data); ObjectInputStream is = new ObjectInputStream(in); return is.readObject(); } - public static void main(String[] args) { + private static Image loadImage(int id) throws IOException { + String name = ""+id+".png"; + String url = "ressources/cartes/"+name; + System.out.println(url); + Image picture = ImageIO.read(new File(url)); + return picture; + } + + private static Map getMapImageCarte(Map cartes) throws IOException{ + + Map mapCarteImage = new HashMap(); + + for(Integer i : cartes.keySet()) { + + Carte c = cartes.get(i); + Image img = loadImage(i); + mapCarteImage.put(c,img); + } + + return mapCarteImage; + } + + + public void loadRessources() { try { Map cartes = loadCards(); - System.out.println(cartes); - System.out.println(getMapType(CartePiochable.Type.TENEBRE, cartes)); - } catch (ClassNotFoundException | IOException e) { + Map mapT = getMapType(CartePiochable.Type.TENEBRE, cartes); + Map mapL = getMapType(CartePiochable.Type.LUMIERE, cartes); + Map mapV = getMapType(CartePiochable.Type.VISION, cartes); + Map mapP = getMapPersonnage(cartes); + + Map mapIT = getMapImageCarte(mapT); + Map mapIL = getMapImageCarte(mapT); + Map mapIV = getMapImageCarte(mapT); + Map mapIP = getMapImageCarte(mapT); + + + this.ressourcesCartes.put(CARTES_TENEBRE, mapIT); + this.ressourcesCartes.put(CARTES_LUMIERE, mapIL); + this.ressourcesCartes.put(CARTES_LUMIERE, mapIV); + this.ressourcesCartes.put(CARTES_LUMIERE, mapIP); + + this.ressourcesDosCartes.put(DOS_TENEBRE, loadImage(ID_DOS_TENEBRE)); + this.ressourcesDosCartes.put(DOS_LUMIERE, loadImage(ID_DOS_LUMIERE)); + this.ressourcesDosCartes.put(DOS_VISION, loadImage(ID_DOS_VISION)); + this.ressourcesDosCartes.put(DOS_PERSONNAGE, loadImage(ID_DOS_PERSONNAGE)); + + } catch (IOException | ClassNotFoundException e) { e.printStackTrace(); } - } + public static void main(String[] args) { + RessourceLoader rl = new RessourceLoader(); + rl.loadRessources(); + } + + } diff --git a/src/database/Table.java b/src/database/Table.java index ce53f44..4083ee4 100644 --- a/src/database/Table.java +++ b/src/database/Table.java @@ -27,10 +27,9 @@ public class Table { public void remplirTableQuery(String query) { try (Connection connection = DriverManager.getConnection("jdbc:postgresql://localhost:5432/ShadowHunterDatabase", "shManager", "shadowhunter1234")) { //notre utilisateur que l'on utilisera (: - - System.out.println("Connected to PostgreSQL database!"); + Statement statement = connection.createStatement(); - System.out.println("Reading records..."); + ResultSet retour = statement.executeQuery(query); while (retour.next()) { list.add(new Record(retour.getString("id"), retour.getString("nom"), null, retour.getBytes("objet"))); @@ -59,16 +58,6 @@ public class Table { } protected boolean isEmpty() { - if(list.isEmpty()) { - return true; - } else { - return false; - } + return list.isEmpty(); } - - - - - - } diff --git a/src/domaine/properties/langue.properties b/src/domaine/properties/langue.properties index 8714ef8..f8fdaba 100644 --- a/src/domaine/properties/langue.properties +++ b/src/domaine/properties/langue.properties @@ -1,5 +1,5 @@ jouer=Jouer -regles=Régles +regles=Règles commencer.partie=Commencer la partie entrez.nom.joueur= Entrez le nom des joueurs nombre.joueur.minimum=(Il faut au moins 4 joueurs) diff --git a/src/domaine/properties/langue_fr.properties b/src/domaine/properties/langue_fr.properties index 56790ca..1356a68 100644 --- a/src/domaine/properties/langue_fr.properties +++ b/src/domaine/properties/langue_fr.properties @@ -1,5 +1,5 @@ jouer=Jouer -regles=Régles +regles=Règles commencer.partie=Commencer la partie entrez.nom.joueur= Entrez le nom des joueurs nombre.joueur.minimum=(Il faut au moins 4 joueurs) diff --git a/src/ihm/Musique.java b/src/ihm/Musique.java index d3f8a91..89880e5 100644 --- a/src/ihm/Musique.java +++ b/src/ihm/Musique.java @@ -6,25 +6,32 @@ import java.io.InputStream; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.Clip; - +import javax.sound.sampled.FloatControl; public class Musique { public static Clip clip; public static long clipTimePosition = 0; + + public static boolean musiqueEnCours = false; + static FloatControl volume ; public static void playMusique(InputStream path) { try { InputStream musicPath = path; - - if (musicPath!=null) { + + if (musicPath != null) { InputStream bufferedIn = new BufferedInputStream(musicPath); AudioInputStream audioInput = AudioSystem.getAudioInputStream(bufferedIn); clip = AudioSystem.getClip(); clip.open(audioInput); + + volume = (FloatControl) clip.getControl(FloatControl.Type.MASTER_GAIN); + volume.setValue(-20.0f); // Reduit le volume de 20 decibels. + clip.start(); clip.loop(Clip.LOOP_CONTINUOUSLY); @@ -46,5 +53,13 @@ public class Musique { clip.setMicrosecondPosition(clipTimePosition); clip.start(); } + + public static void volumeUp(Float valeur) { + volume.setValue(volume.getValue() +valeur); + } + + public static void volumeDown(Float valeur) { + volume.setValue(volume.getValue() -valeur); + } } diff --git a/src/ihm/controller/MenuController.java b/src/ihm/controller/MenuController.java index 46923aa..a76cd25 100644 --- a/src/ihm/controller/MenuController.java +++ b/src/ihm/controller/MenuController.java @@ -30,6 +30,8 @@ public class MenuController implements Initializable{ input = getClass().getResourceAsStream("/ihm/ressources/img/logo.png"); Image image = new Image(input); titre.setImage(image); + + } @FXML diff --git a/src/ihm/controller/ParametreController.java b/src/ihm/controller/ParametreController.java index e151be0..81eeadd 100644 --- a/src/ihm/controller/ParametreController.java +++ b/src/ihm/controller/ParametreController.java @@ -31,7 +31,7 @@ public class ParametreController implements Initializable { public static boolean cbMusiqueCoche = false; // verifi si la checbox musical est coche public static boolean cbSonCoche = false; boolean MusiqueLancee = false; //verifi si la musique a déja été lancé une première fois - + String filepathMusique = "/ihm/ressources/musique/The_Red_Fox_Tavern.wav"; // lien vers la musique : https://www.youtube.com/watch?v=LBpKUIyOHdo InputStream fileMusique = getClass().getResourceAsStream("/ihm/ressources/musique/The_Red_Fox_Tavern.wav"); @@ -42,6 +42,7 @@ public class ParametreController implements Initializable { @Override public void initialize(URL arg0, ResourceBundle arg1) { + langues.getItems().add("Anglais"); langues.getItems().add("Allemand"); langues.getItems().add("Espagnol"); @@ -59,11 +60,12 @@ public class ParametreController implements Initializable { if (cmusique.isSelected() == true) { cbMusiqueCoche = true; - if (Musique.clipTimePosition == 0 && MusiqueLancee == false) { // si la musique n'a jamais été lancé + if (Musique.clipTimePosition == 0 && MusiqueLancee == false && Musique.musiqueEnCours != true) { // si la musique n'a jamais été lancé Musique.playMusique(fileMusique); + Musique.musiqueEnCours = true; MusiqueLancee = true; - } else { + } else if (Musique.musiqueEnCours != true) { Musique.resumeMusique(Musique.clip); // si elle a deja été lancé mais mis en pause, reprend a partir du point d'arret } @@ -71,6 +73,7 @@ public class ParametreController implements Initializable { if (cbMusiqueCoche == true) { cbMusiqueCoche = false; Musique.pauseMusique(Musique.clip); //met en pause la musique + Musique.musiqueEnCours = false; } } @@ -137,5 +140,17 @@ public class ParametreController implements Initializable { } + + @FXML + public void monterVolume(MouseEvent mouseEvent) throws IOException{ + Musique.volumeUp(5.f); + System.out.println("on monte le son"); + } + + @FXML + public void baisserVolume(MouseEvent mouseEvent) throws IOException{ + Musique.volumeDown(5.f); + System.out.println("on baisse le son"); + } } diff --git a/src/ihm/controller/PauseController.java b/src/ihm/controller/PauseController.java index b3e7e30..ad79e4f 100644 --- a/src/ihm/controller/PauseController.java +++ b/src/ihm/controller/PauseController.java @@ -32,7 +32,7 @@ public class PauseController implements Initializable { boolean MusiqueLancee = ParametreController.cbMusiqueCoche; boolean SonLance = ParametreController.cbSonCoche; - + @Override public void initialize(URL arg0, ResourceBundle arg1) { @@ -55,18 +55,22 @@ public class PauseController implements Initializable { if (fileMusique != null) { if (cbMusique.isSelected()) { System.out.println("\tLancement de la musique"); - - if (Musique.clipTimePosition == 0 && MusiqueLancee == false) { // si la musique n'a jamais été lancé + + if (Musique.clipTimePosition == 0 && MusiqueLancee == false && Musique.musiqueEnCours != true) { // si la musique n'a jamais été lancé Musique.playMusique(fileMusique); + Musique.musiqueEnCours = true; MusiqueLancee = true; - } else - Musique.resumeMusique(Musique.clip); // si elle a deja été lancé mais mis en pause, reprend a partir du point d'arret - } else { + } else if (MusiqueLancee ==false && Musique.musiqueEnCours != true) { + Musique.resumeMusique(Musique.clip); // si elle a deja été lancé mais mis en pause, reprend a partir du point d'arret + } + + } else if (MusiqueLancee == true){ Musique.pauseMusique(Musique.clip); // met en pause la musique + Musique.musiqueEnCours = false; + MusiqueLancee = false; System.out.println("\tMise en pause de la musique"); } - } - else { + } else { System.out.println("fichier audio non trouvé"); } @@ -98,6 +102,7 @@ public class PauseController implements Initializable { System.err.println("Fin de partie"); Stage appStage = (Stage) ((Node) me.getSource()).getScene().getWindow(); appStage.close(); +<<<<<<< HEAD /* final URL fxmlURL = getClass().getResource("/ihm/ressources/Menu.fxml"); final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRENCH); @@ -106,5 +111,25 @@ public class PauseController implements Initializable { +======= + + final URL fxmlURL = getClass().getResource("/ihm/ressources/Menu.fxml"); + final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRENCH); + final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); + AnchorPane root = fxmlLoader.load(); + + } + + @FXML + public void monterVolume(MouseEvent mouseEvent) throws IOException{ + Musique.volumeUp(5.f); + System.out.println("on monte le son"); + } + + @FXML + public void baisserVolume(MouseEvent mouseEvent) throws IOException{ + Musique.volumeDown(5.f); + System.out.println("on baisse le son"); +>>>>>>> 9fca28f7bb31a2ae6de169307adf781247bc61a4 } } diff --git a/src/ihm/controller/ReglesControlleur.java b/src/ihm/controller/ReglesControlleur.java index e925d3e..614bf3e 100644 --- a/src/ihm/controller/ReglesControlleur.java +++ b/src/ihm/controller/ReglesControlleur.java @@ -39,14 +39,18 @@ public class ReglesControlleur implements Initializable { @FXML public void pageSuivante(MouseEvent mouseEvent) throws IOException { - InputStream fileSound1 = getClass().getResourceAsStream("/ihm/ressources/musique/BEEP1.wav"); - EffetSonore.playSoundEffect(fileSound1); if (index < 4) { index++; + InputStream fileSound1 = getClass().getResourceAsStream("/ihm/ressources/musique/BEEP1.wav"); + EffetSonore.playSoundEffect(fileSound1); + System.out.println("Page suivante"); + } else { + InputStream fileSound2 = getClass().getResourceAsStream("/ihm/ressources/musique/BeepError.wav"); + EffetSonore.playSoundEffect(fileSound2); + System.out.println("C'est la dernière page!"); } - System.out.println("Page suivante"); InputStream input = getClass().getResourceAsStream("/ihm/ressources/img/Regle" + index + ".png"); Image image = new Image(input); imageRegles.setImage(image); @@ -55,14 +59,18 @@ public class ReglesControlleur implements Initializable { @FXML public void pagePrecedente(MouseEvent mouseEvent) throws IOException { - InputStream fileSound1 = getClass().getResourceAsStream("/ihm/ressources/musique/BEEP1.wav"); - EffetSonore.playSoundEffect(fileSound1); if (index > 1) { index--; + InputStream fileSound1 = getClass().getResourceAsStream("/ihm/ressources/musique/BEEP1.wav"); + EffetSonore.playSoundEffect(fileSound1); + System.out.println("Page précédente"); + } else { + InputStream fileSound2 = getClass().getResourceAsStream("/ihm/ressources/musique/BeepError.wav"); + EffetSonore.playSoundEffect(fileSound2); + System.out.println("C'est la première page!"); } - System.out.println("Page précédente"); InputStream input = getClass().getResourceAsStream("/ihm/ressources/img/Regle" + index + ".png"); Image image = new Image(input); imageRegles.setImage(image); diff --git a/src/ihm/ressources/Pause.fxml b/src/ihm/ressources/Pause.fxml index 5da995b..b925919 100644 --- a/src/ihm/ressources/Pause.fxml +++ b/src/ihm/ressources/Pause.fxml @@ -9,7 +9,6 @@ - @@ -46,6 +45,29 @@ + + + + + + + + +