diff --git a/Partie_3_GUI/img/popup.png b/Partie_3_GUI/img/popup.png new file mode 100644 index 0000000000000000000000000000000000000000..1bbac644081e44b4131275a29d53d14552e985ae Binary files /dev/null and b/Partie_3_GUI/img/popup.png differ diff --git "a/Partie_3_GUI/img/\360\237\202\241.png" "b/Partie_3_GUI/img/\360\237\202\241.png" new file mode 100644 index 0000000000000000000000000000000000000000..103f56d1a807b12e284d5a73ad01b983f25b879b Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\202\241.png" differ diff --git "a/Partie_3_GUI/img/\360\237\202\242.png" "b/Partie_3_GUI/img/\360\237\202\242.png" new file mode 100644 index 0000000000000000000000000000000000000000..1ce0ffe8b82efc672d92c53d1a0261defc1c8824 Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\202\242.png" differ diff --git "a/Partie_3_GUI/img/\360\237\202\243.png" "b/Partie_3_GUI/img/\360\237\202\243.png" new file mode 100644 index 0000000000000000000000000000000000000000..f9e06b4f019efca9dc2011b755404453b5928349 Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\202\243.png" differ diff --git "a/Partie_3_GUI/img/\360\237\202\244.png" "b/Partie_3_GUI/img/\360\237\202\244.png" new file mode 100644 index 0000000000000000000000000000000000000000..95abe3e737c3675286b81da0af0d83033ee9d4ff Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\202\244.png" differ diff --git "a/Partie_3_GUI/img/\360\237\202\245.png" "b/Partie_3_GUI/img/\360\237\202\245.png" new file mode 100644 index 0000000000000000000000000000000000000000..53a1aad26c9990b695ed24c1241843eef0a704f0 Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\202\245.png" differ diff --git "a/Partie_3_GUI/img/\360\237\202\246.png" "b/Partie_3_GUI/img/\360\237\202\246.png" new file mode 100644 index 0000000000000000000000000000000000000000..40242a718bfbec2252610f21196eaacdb9446884 Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\202\246.png" differ diff --git "a/Partie_3_GUI/img/\360\237\202\247.png" "b/Partie_3_GUI/img/\360\237\202\247.png" new file mode 100644 index 0000000000000000000000000000000000000000..b9f1b93d33e8c81a441df99c3da822631d202c50 Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\202\247.png" differ diff --git "a/Partie_3_GUI/img/\360\237\202\250.png" "b/Partie_3_GUI/img/\360\237\202\250.png" new file mode 100644 index 0000000000000000000000000000000000000000..b6b3b3813dce1260129d482550dbfdd465fca085 Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\202\250.png" differ diff --git "a/Partie_3_GUI/img/\360\237\202\251.png" "b/Partie_3_GUI/img/\360\237\202\251.png" new file mode 100644 index 0000000000000000000000000000000000000000..3c3b5ffbc6429e64c97e1f218ca1814e29e1d989 Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\202\251.png" differ diff --git "a/Partie_3_GUI/img/\360\237\202\252.png" "b/Partie_3_GUI/img/\360\237\202\252.png" new file mode 100644 index 0000000000000000000000000000000000000000..0b3d29475d9caa3291a68324e87af4790244500c Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\202\252.png" differ diff --git "a/Partie_3_GUI/img/\360\237\202\253.png" "b/Partie_3_GUI/img/\360\237\202\253.png" new file mode 100644 index 0000000000000000000000000000000000000000..f539c19c6cfc002f9edfec34f8dbbd65227e6249 Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\202\253.png" differ diff --git "a/Partie_3_GUI/img/\360\237\202\255.png" "b/Partie_3_GUI/img/\360\237\202\255.png" new file mode 100644 index 0000000000000000000000000000000000000000..7983d034ddb7b54e26e36c9141b048bff003bfc0 Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\202\255.png" differ diff --git "a/Partie_3_GUI/img/\360\237\202\256.png" "b/Partie_3_GUI/img/\360\237\202\256.png" new file mode 100644 index 0000000000000000000000000000000000000000..2edbbc14848662fb5bcde268d046041a25c193a4 Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\202\256.png" differ diff --git "a/Partie_3_GUI/img/\360\237\202\261.png" "b/Partie_3_GUI/img/\360\237\202\261.png" new file mode 100644 index 0000000000000000000000000000000000000000..b42212405c18f1f72a451f91b354c145089c103f Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\202\261.png" differ diff --git "a/Partie_3_GUI/img/\360\237\202\262.png" "b/Partie_3_GUI/img/\360\237\202\262.png" new file mode 100644 index 0000000000000000000000000000000000000000..75a014f364dbbdc00fb4bb8f3f808370f37907b8 Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\202\262.png" differ diff --git "a/Partie_3_GUI/img/\360\237\202\263.png" "b/Partie_3_GUI/img/\360\237\202\263.png" new file mode 100644 index 0000000000000000000000000000000000000000..8e74673f8222007b4b8a8c82d00d10a782ec7031 Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\202\263.png" differ diff --git "a/Partie_3_GUI/img/\360\237\202\264.png" "b/Partie_3_GUI/img/\360\237\202\264.png" new file mode 100644 index 0000000000000000000000000000000000000000..ceecbfe02f2e1e0af4a64dc457ed46940f954c81 Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\202\264.png" differ diff --git "a/Partie_3_GUI/img/\360\237\202\265.png" "b/Partie_3_GUI/img/\360\237\202\265.png" new file mode 100644 index 0000000000000000000000000000000000000000..d923456fe88b17c1ab8d45f11b8d947957732a6c Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\202\265.png" differ diff --git "a/Partie_3_GUI/img/\360\237\202\266.png" "b/Partie_3_GUI/img/\360\237\202\266.png" new file mode 100644 index 0000000000000000000000000000000000000000..361643efc36ed607f3834a502840b858dc0498d9 Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\202\266.png" differ diff --git "a/Partie_3_GUI/img/\360\237\202\267.png" "b/Partie_3_GUI/img/\360\237\202\267.png" new file mode 100644 index 0000000000000000000000000000000000000000..19b89a2e7e8511b44f824f19172059a0b0bae7a4 Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\202\267.png" differ diff --git "a/Partie_3_GUI/img/\360\237\202\270.png" "b/Partie_3_GUI/img/\360\237\202\270.png" new file mode 100644 index 0000000000000000000000000000000000000000..fb39723cb19cff1271bee430875a3c0d6d570e99 Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\202\270.png" differ diff --git "a/Partie_3_GUI/img/\360\237\202\271.png" "b/Partie_3_GUI/img/\360\237\202\271.png" new file mode 100644 index 0000000000000000000000000000000000000000..7b196d6dc080409b1e7ae97f6bf1e651742fb0ff Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\202\271.png" differ diff --git "a/Partie_3_GUI/img/\360\237\202\272.png" "b/Partie_3_GUI/img/\360\237\202\272.png" new file mode 100644 index 0000000000000000000000000000000000000000..3eb83d72c894aaa7490268239c14244f883a61e8 Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\202\272.png" differ diff --git "a/Partie_3_GUI/img/\360\237\202\273.png" "b/Partie_3_GUI/img/\360\237\202\273.png" new file mode 100644 index 0000000000000000000000000000000000000000..bf342bcb2963500e8f899222f788fb3e1e08d0ad Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\202\273.png" differ diff --git "a/Partie_3_GUI/img/\360\237\202\275.png" "b/Partie_3_GUI/img/\360\237\202\275.png" new file mode 100644 index 0000000000000000000000000000000000000000..21839e681abc17e6ebe6895e9fca39a949d28afc Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\202\275.png" differ diff --git "a/Partie_3_GUI/img/\360\237\202\276.png" "b/Partie_3_GUI/img/\360\237\202\276.png" new file mode 100644 index 0000000000000000000000000000000000000000..1d3c468d8e986a15e38d5fb2b9319b17ff183a4b Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\202\276.png" differ diff --git "a/Partie_3_GUI/img/\360\237\203\201.png" "b/Partie_3_GUI/img/\360\237\203\201.png" new file mode 100644 index 0000000000000000000000000000000000000000..79cd3b8a8054644e23619008b58f7b89601a2ec6 Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\203\201.png" differ diff --git "a/Partie_3_GUI/img/\360\237\203\202.png" "b/Partie_3_GUI/img/\360\237\203\202.png" new file mode 100644 index 0000000000000000000000000000000000000000..4deee7cc848386b049cafd105cb9a92c8ce2cbcd Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\203\202.png" differ diff --git "a/Partie_3_GUI/img/\360\237\203\203.png" "b/Partie_3_GUI/img/\360\237\203\203.png" new file mode 100644 index 0000000000000000000000000000000000000000..8ee0b4b902d308d64b51ec880a0389a34f836dd3 Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\203\203.png" differ diff --git "a/Partie_3_GUI/img/\360\237\203\204.png" "b/Partie_3_GUI/img/\360\237\203\204.png" new file mode 100644 index 0000000000000000000000000000000000000000..70e82e839b4e29647a5e2fefd7b08f4ca30829f1 Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\203\204.png" differ diff --git "a/Partie_3_GUI/img/\360\237\203\205.png" "b/Partie_3_GUI/img/\360\237\203\205.png" new file mode 100644 index 0000000000000000000000000000000000000000..bb9252558a0c6a0b3f6b4756e9d1a1c54c43fdb4 Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\203\205.png" differ diff --git "a/Partie_3_GUI/img/\360\237\203\206.png" "b/Partie_3_GUI/img/\360\237\203\206.png" new file mode 100644 index 0000000000000000000000000000000000000000..78a80ad06a3705f9035bf3b96a1f047c428ac877 Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\203\206.png" differ diff --git "a/Partie_3_GUI/img/\360\237\203\207.png" "b/Partie_3_GUI/img/\360\237\203\207.png" new file mode 100644 index 0000000000000000000000000000000000000000..6ad5f15b51e7b949c825f6ecf1d70a6ba6c8f9ec Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\203\207.png" differ diff --git "a/Partie_3_GUI/img/\360\237\203\210.png" "b/Partie_3_GUI/img/\360\237\203\210.png" new file mode 100644 index 0000000000000000000000000000000000000000..ed1295121de438df71dfed44026046a34ec959ba Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\203\210.png" differ diff --git "a/Partie_3_GUI/img/\360\237\203\211.png" "b/Partie_3_GUI/img/\360\237\203\211.png" new file mode 100644 index 0000000000000000000000000000000000000000..0b933fb0e664b980d3f2668443922062eb083cec Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\203\211.png" differ diff --git "a/Partie_3_GUI/img/\360\237\203\212.png" "b/Partie_3_GUI/img/\360\237\203\212.png" new file mode 100644 index 0000000000000000000000000000000000000000..3bbc4e06bc6042f026761c8c1437a07ad8977c1b Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\203\212.png" differ diff --git "a/Partie_3_GUI/img/\360\237\203\213.png" "b/Partie_3_GUI/img/\360\237\203\213.png" new file mode 100644 index 0000000000000000000000000000000000000000..131a97731b51cca6f26dfb295d5937e964d1ebad Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\203\213.png" differ diff --git "a/Partie_3_GUI/img/\360\237\203\215.png" "b/Partie_3_GUI/img/\360\237\203\215.png" new file mode 100644 index 0000000000000000000000000000000000000000..928f6501da39ba4d00f1bcbb9de2557b50d0dda3 Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\203\215.png" differ diff --git "a/Partie_3_GUI/img/\360\237\203\216.png" "b/Partie_3_GUI/img/\360\237\203\216.png" new file mode 100644 index 0000000000000000000000000000000000000000..e21d6a0a4ad47d87a9830befc68d16cf526f8ae8 Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\203\216.png" differ diff --git "a/Partie_3_GUI/img/\360\237\203\221.png" "b/Partie_3_GUI/img/\360\237\203\221.png" new file mode 100644 index 0000000000000000000000000000000000000000..42bf5ec94d627831e095c53dd5480521f771f97d Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\203\221.png" differ diff --git "a/Partie_3_GUI/img/\360\237\203\222.png" "b/Partie_3_GUI/img/\360\237\203\222.png" new file mode 100644 index 0000000000000000000000000000000000000000..291ed975f29d7873765c9f3259ebad8fd8a9d040 Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\203\222.png" differ diff --git "a/Partie_3_GUI/img/\360\237\203\223.png" "b/Partie_3_GUI/img/\360\237\203\223.png" new file mode 100644 index 0000000000000000000000000000000000000000..076ab318aa596a64e8d3d52c2f53f2d3b32999be Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\203\223.png" differ diff --git "a/Partie_3_GUI/img/\360\237\203\224.png" "b/Partie_3_GUI/img/\360\237\203\224.png" new file mode 100644 index 0000000000000000000000000000000000000000..8be9e089225fdf93c7be1b51031819fc85054c73 Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\203\224.png" differ diff --git "a/Partie_3_GUI/img/\360\237\203\225.png" "b/Partie_3_GUI/img/\360\237\203\225.png" new file mode 100644 index 0000000000000000000000000000000000000000..bde9777696e8e8d42402bdeeb6058b7d6605d0a0 Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\203\225.png" differ diff --git "a/Partie_3_GUI/img/\360\237\203\226.png" "b/Partie_3_GUI/img/\360\237\203\226.png" new file mode 100644 index 0000000000000000000000000000000000000000..a9660a037257ac7d6ab05604fe896b2e51ac4171 Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\203\226.png" differ diff --git "a/Partie_3_GUI/img/\360\237\203\227.png" "b/Partie_3_GUI/img/\360\237\203\227.png" new file mode 100644 index 0000000000000000000000000000000000000000..9d6b54554f5792e0bbef4c2fa3fd898cb6354b6f Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\203\227.png" differ diff --git "a/Partie_3_GUI/img/\360\237\203\230.png" "b/Partie_3_GUI/img/\360\237\203\230.png" new file mode 100644 index 0000000000000000000000000000000000000000..cec743cbcd188453a8c14edde55147683ae24859 Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\203\230.png" differ diff --git "a/Partie_3_GUI/img/\360\237\203\231.png" "b/Partie_3_GUI/img/\360\237\203\231.png" new file mode 100644 index 0000000000000000000000000000000000000000..2174db58e12a0cef03c8f68cfdad9e296f5b31b9 Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\203\231.png" differ diff --git "a/Partie_3_GUI/img/\360\237\203\232.png" "b/Partie_3_GUI/img/\360\237\203\232.png" new file mode 100644 index 0000000000000000000000000000000000000000..18af741dbd2d8eb0f8ac494065d50ee8b7bc326a Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\203\232.png" differ diff --git "a/Partie_3_GUI/img/\360\237\203\233.png" "b/Partie_3_GUI/img/\360\237\203\233.png" new file mode 100644 index 0000000000000000000000000000000000000000..5e003be2d4c3fc8e67a0f63979c6b9054cd37fd6 Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\203\233.png" differ diff --git "a/Partie_3_GUI/img/\360\237\203\235.png" "b/Partie_3_GUI/img/\360\237\203\235.png" new file mode 100644 index 0000000000000000000000000000000000000000..7be5f9a96a5188a17e3606907d0076497b902958 Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\203\235.png" differ diff --git "a/Partie_3_GUI/img/\360\237\203\236.png" "b/Partie_3_GUI/img/\360\237\203\236.png" new file mode 100644 index 0000000000000000000000000000000000000000..68e57747d7e6d518e438bc1e0b45310abf25cae7 Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\203\236.png" differ diff --git "a/Partie_3_GUI/img/\360\237\203\237.png" "b/Partie_3_GUI/img/\360\237\203\237.png" new file mode 100644 index 0000000000000000000000000000000000000000..55b3ef9ba552b0be07dcadfae5830a28561408f3 Binary files /dev/null and "b/Partie_3_GUI/img/\360\237\203\237.png" differ diff --git a/Partie_3_GUI/save.csv b/Partie_3_GUI/save.csv index f481abffdbc7df4d1718d6dcc2639b0a4f25b9de..b407c144fbb472b4528733a32bc5b9e5523974d5 100644 --- a/Partie_3_GUI/save.csv +++ b/Partie_3_GUI/save.csv @@ -1,3 +1,3 @@ -Human,100.0,0 +Human,110.0,0 Player_1,190.0,1 -Player_2,305.0,1 +Player_2,305.0,1 \ No newline at end of file diff --git a/Partie_3_GUI/src/main/java/ch/hepia/App.java b/Partie_3_GUI/src/main/java/ch/hepia/App.java deleted file mode 100644 index b99e87fcaf53d954cec2092e1548f78da9934187..0000000000000000000000000000000000000000 --- a/Partie_3_GUI/src/main/java/ch/hepia/App.java +++ /dev/null @@ -1,187 +0,0 @@ -package ch.hepia; - -import java.io.File; -import java.util.Scanner; - -public class App { - - // Scanner will be used all along to take user inputs in the terminal - public static final Scanner in = new Scanner(System.in); - - // All Color choices to be used in terminal prints - public static final String ANSI_RESET = "\u001B[0m"; - public static final String ANSI_BLACK = "\u001B[30m"; - public static final String ANSI_RED = "\u001B[31m"; - public static final String ANSI_GREEN = "\u001B[32m"; - public static final String ANSI_YELLOW = "\u001B[33m"; - public static final String ANSI_BLUE = "\u001B[34m"; - public static final String ANSI_PURPLE = "\u001B[35m"; - public static final String ANSI_CYAN = "\u001B[36m"; - public static final String ANSI_WHITE = "\u001B[37m"; - - public static void BlackJack() { - - System.out.print("\033[H\033[2J"); - System.out.flush(); - - System.out.println("*~-~* " + App.ANSI_RED + "BlackJack" + App.ANSI_RESET + " *~-~*\n"); - - int numPlayers; - int startMoney; - int computerStrategy = 1; - boolean loadSave = false; - String filePath = "save.csv"; - - File f = new File(filePath); - - // Check if a save file exists - if (f.exists() && !f.isDirectory()) { - - char choice = 'x'; - - System.out.print("Do you want to load last game save (y/n) ? "); - - while (true) { - - choice = App.in.next().charAt(0); - - // Choices are checked with available one for confirmation - if (choice == 'y' || choice == 'n') { - break; - } else { - System.out.println(App.ANSI_YELLOW + "Please enter a valid choice." + App.ANSI_RESET); - } - } - - if (choice == 'y') { - loadSave = true; - } - } - - GameManager BlackJack; - - if (loadSave) { - - // Load save to create game - Save Game = new Save(); - - BlackJack = new GameManager(Game.loadMoney(), Game.loadStrategy()); - - } else { - // Ask the number of players until a valide answer is given - while (true) { - - System.out.print("How many players ? "); - - // Check that the input is an valid int - while (!App.in.hasNextInt()) { - System.out.println( - App.ANSI_YELLOW + "Please enter a valid number for the number of players." - + App.ANSI_RESET); - System.out.print("How many players ? "); - App.in.next(); - } - - numPlayers = App.in.nextInt(); - - // Player count must be between 1 and 7 - if (numPlayers >= 1 && numPlayers <= 7) { - System.out.print(""); - break; - } else { - System.out.println( - App.ANSI_YELLOW + "Please enter a number of players between 1 and 7." + App.ANSI_RESET); - } - } - - // Ask the start money count for each players until a valide answer is given - while (true) { - - System.out.print("How much money do you start with ? "); - - // Check that the input is an valid int - while (!App.in.hasNextInt()) { - System.out - .println(App.ANSI_YELLOW + "Please enter a valid number for your Money." + App.ANSI_RESET); - System.out.print("How much money do you start with ? "); - App.in.next(); - } - - startMoney = App.in.nextInt(); - - // Starting money must be more or equal to minimum bid amount - if (startMoney >= 10) { - System.out.print(""); - break; - } else { - System.out.println(App.ANSI_YELLOW + "Please enter an amount above 10." + App.ANSI_RESET); - } - } - - // Ask if the Computer players should be smart of not - if (numPlayers > 1) { - while (true) { - - System.out.print("Should the Compter players be [1] Smart or [2] Stupid ? "); - - // Check that the input is an valid int - while (!App.in.hasNextInt()) { - System.out - .println(App.ANSI_YELLOW + "Please enter a valid choice." + App.ANSI_RESET); - System.out.print("Should the Compter players be [1] Smart or [2] Stupid ? "); - App.in.next(); - } - - computerStrategy = App.in.nextInt(); - - // Check if the value i s valide - if (computerStrategy == 1 || computerStrategy == 2) { - System.out.print(""); - break; - } else { - System.out.println(App.ANSI_YELLOW + "Please enter a valid choice." + App.ANSI_RESET); - } - } - } - - // Create a new game - BlackJack = new GameManager(numPlayers, startMoney, computerStrategy); - } - - boolean GameOver = false; - - // Game run's in 3 Phases : - // Phase 1 (StartTurn): - // Ask the player how much he wan't to bid - // Phase 2 (PlayTurn): - // Ask the player for all his interactions with this cards - // Phase 3 (ResolveTurn): - // Make the Dealer pick cards - // Do all the math for the player gains and losses - // Check if the player can continue et prepare for the next round - while (!GameOver) { - BlackJack.StartTurn(); - BlackJack.PlayTurn(); - GameOver = BlackJack.ResolveTurn(); - } - - // The player has less than the minimum bid amount allowed = Game Over - - System.out.print("\033[H\033[2J"); - System.out.flush(); - - System.out.println("*~-~* " + App.ANSI_RED + "BlackJack" + App.ANSI_RESET + " *~-~*\n"); - - System.out.println(App.ANSI_PURPLE + "Game Over !" + App.ANSI_RESET); - - App.in.close(); - } - - public static void main(String[] args) { - - // Play 1 BlackJack Game - BlackJack(); - - } - -} diff --git a/Partie_3_GUI/src/main/java/ch/hepia/BlackjackGUI.java b/Partie_3_GUI/src/main/java/ch/hepia/BlackjackGUI.java index 77efaedb9413266e8a54beb4d4074c068a2b6c27..4598e091c1c6f1d7026fa627c064d079ffbd33a1 100644 --- a/Partie_3_GUI/src/main/java/ch/hepia/BlackjackGUI.java +++ b/Partie_3_GUI/src/main/java/ch/hepia/BlackjackGUI.java @@ -5,6 +5,7 @@ import javafx.geometry.Insets; import javafx.geometry.Pos; import javafx.scene.Scene; import javafx.scene.control.Button; +import javafx.scene.control.TextField; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.layout.Background; @@ -13,22 +14,21 @@ import javafx.scene.layout.BackgroundPosition; import javafx.scene.layout.BackgroundRepeat; import javafx.scene.layout.BackgroundSize; import javafx.scene.layout.HBox; +import javafx.scene.layout.StackPane; import javafx.scene.layout.VBox; import javafx.scene.paint.Color; import javafx.scene.text.Font; +import javafx.scene.text.Text; import javafx.scene.text.FontWeight; import javafx.stage.Stage; +import javafx.scene.control.CheckBox; +import javafx.beans.value.*; import java.io.File; import javafx.animation.ScaleTransition; import javafx.animation.TranslateTransition; import javafx.util.Duration; -import javafx.scene.layout.BackgroundImage; -import javafx.scene.layout.BackgroundRepeat; -import javafx.scene.layout.BackgroundSize; -import javafx.scene.layout.BackgroundPosition; -import javafx.scene.paint.Color; public class BlackjackGUI extends Application { @@ -36,12 +36,41 @@ public class BlackjackGUI extends Application { launch(args); } + public void game(Stage primaryStage, boolean loaded, int nbPlayer, int aiStrength, int startMoney) { + + GameManager BlackJack; + + if (loaded) { + Save Game = new Save(); + + BlackJack = new GameManager(Game.loadMoney(), Game.loadStrategy()); + } else { + BlackJack = new GameManager(nbPlayer, startMoney, aiStrength); + } + + BlackJack.StartTurn(primaryStage); + + // boolean GameOver = false; + + /* + * while (!GameOver) { + * BlackJack.StartTurn(primaryStage); + * BlackJack.PlayTurn(primaryStage); + * GameOver = BlackJack.ResolveTurn(primaryStage); + * } + */ + + // primaryStage.close(); + } + @Override public void start(Stage primaryStage) { String filePath = "save.csv"; File f = new File(filePath); + Font font = Font.font("Courier New", FontWeight.BOLD, 25); + primaryStage.setTitle("Blackjack"); Image backgroundImage = new Image("file:img/background.jpg"); @@ -57,36 +86,140 @@ public class BlackjackGUI extends Application { blackjackImageView.setFitHeight(400); blackjackImageView.setPreserveRatio(true); - Button lightGreenButton = createButtonWithText("New Game", "file:img/light_green_button.png", 300); - Button lightBlueButton = createButtonWithText("Load Save", "file:img/light_blue_button.png", 300); + ImageView blackjackLogoImageView = new ImageView(blackjackImage); + blackjackLogoImageView.setFitHeight(120); + blackjackLogoImageView.setPreserveRatio(true); + + Button newGameButton = createButtonWithText("New Game", "file:img/light_green_button.png", 300, 7.0); + Button loadGameButton = createButtonWithText("Load Save", "file:img/light_blue_button.png", 300, 7.0); + + Text players = new Text("Nb of Players : "); + Text money = new Text("Start Money : "); + Text playerCount = new Text("1"); + + Button morePlayerButton = createButtonWithText("+", "file:img/light_green_button.png", 100, 5.0); + Button lessPlayerButton = createButtonWithText("-", "file:img/red_button.png", 100, 5.0); + + Button startGameButton = createButtonWithText("Start Game", "file:img/light_blue_button.png", 200, 7.0); + + TextField playerStartMoney = new TextField(); + + CheckBox aiStrengthSmart = new CheckBox("Smart AI"); + + CheckBox aiStrengthStupid = new CheckBox("Stupid AI"); + + aiStrengthSmart.setTextFill(Color.BLACK); + aiStrengthStupid.setTextFill(Color.BLACK); + + aiStrengthSmart.setFont(font); + aiStrengthStupid.setFont(font); + + playerCount.setFont(font); + playerCount.setFill(Color.BLACK); + + players.setFont(font); + players.setFill(Color.BLACK); + + money.setFont(font); + money.setFill(Color.BLACK); + + playerStartMoney.setFont(font); + playerStartMoney.setPrefWidth(130); + playerStartMoney.setMaxWidth(130); + + HBox playerCountButtonBox = new HBox(10); + playerCountButtonBox.setAlignment(Pos.CENTER); + playerCountButtonBox.getChildren().addAll(morePlayerButton, lessPlayerButton); + + HBox playerCountTextBox = new HBox(0); + playerCountTextBox.setAlignment(Pos.CENTER); + playerCountTextBox.getChildren().addAll(players, playerCount); + + VBox playerCountBox = new VBox(10); + playerCountBox.setAlignment(Pos.CENTER); + playerCountBox.getChildren().addAll(playerCountTextBox, playerCountButtonBox); + + HBox aiStrength = new HBox(20); + aiStrength.setAlignment(Pos.CENTER); + aiStrength.getChildren().addAll(aiStrengthSmart, aiStrengthStupid); + + aiStrengthSmart.setSelected(true); + + aiStrength.setVisible(false); + + aiStrengthSmart.selectedProperty().addListener((obs, wasSelected, isNowSelected) -> { + if (isNowSelected) { + aiStrengthStupid.setSelected(false); + } + }); + + aiStrengthStupid.selectedProperty().addListener((obs, wasSelected, isNowSelected) -> { + if (isNowSelected) { + aiStrengthSmart.setSelected(false); + } + }); + + Image backgroundImagePopup = new Image("file:img/popup.png", 550, 500, false, true); + BackgroundImage backgroundPopup = new BackgroundImage( + backgroundImagePopup, + BackgroundRepeat.NO_REPEAT, + BackgroundRepeat.NO_REPEAT, + BackgroundPosition.CENTER, + new BackgroundSize(550, 500, false, false, true, true)); + + HBox startMoney = new HBox(10); + startMoney.setAlignment(Pos.CENTER); + startMoney.getChildren().addAll(money, playerStartMoney); + + playerStartMoney.setText("1000"); - // Create HBox for the bottom images HBox bottomImagesBox = new HBox(20); bottomImagesBox.setAlignment(Pos.CENTER); - // Create VBox for the entire layout VBox layout = new VBox(100); layout.getChildren().addAll(blackjackImageView, bottomImagesBox); layout.setAlignment(Pos.CENTER); + VBox layout_2 = new VBox(50); + layout_2.getChildren().addAll(playerCountBox, aiStrength, startMoney, startGameButton); + layout_2.setAlignment(Pos.CENTER); + layout_2.setMinSize(550, 500); + layout_2.setMaxSize(550, 500); + + StackPane root = new StackPane(); + root.getChildren().add(layout_2); + // Set Background Image layout.setBackground(new Background(background)); + root.setBackground(new Background(background)); + layout_2.setBackground(new Background(backgroundPopup)); - // Create the scene and set it to the stage Scene scene = new Scene(layout, 1400, 800); primaryStage.setScene(scene); primaryStage.setResizable(false); + Scene scene_2 = new Scene(root, 1400, 800); + // Show the stage primaryStage.show(); if (!f.exists()) { - lightBlueButton.setVisible(false); - bottomImagesBox.getChildren().add(lightGreenButton); + loadGameButton.setVisible(false); + bottomImagesBox.getChildren().add(newGameButton); } else { - bottomImagesBox.getChildren().addAll(lightGreenButton, lightBlueButton); + bottomImagesBox.getChildren().addAll(newGameButton, loadGameButton); } + playerStartMoney.textProperty().addListener(new ChangeListener<String>() { + @Override + public void changed(ObservableValue<? extends String> observable, String oldValue, + String newValue) { + if (!newValue.matches("\\d*")) { + playerStartMoney.setText(newValue.replaceAll("[^\\d]", "")); + } + } + }); + TranslateTransition blackjackTransition = new TranslateTransition(Duration.seconds(2), blackjackImageView); blackjackTransition.setByX(0); blackjackTransition.setByY(30); @@ -94,14 +227,14 @@ public class BlackjackGUI extends Application { blackjackTransition.setAutoReverse(true); TranslateTransition lightGreenButtonTransition = new TranslateTransition(Duration.seconds(1), - lightGreenButton); + newGameButton); lightGreenButtonTransition.setByX(0); lightGreenButtonTransition.setByY(5); lightGreenButtonTransition.setCycleCount(TranslateTransition.INDEFINITE); lightGreenButtonTransition.setAutoReverse(true); TranslateTransition lightBlueButtonTransition = new TranslateTransition(Duration.seconds(1), - lightBlueButton); + loadGameButton); lightBlueButtonTransition.setByX(0); lightBlueButtonTransition.setByY(5); lightBlueButtonTransition.setCycleCount(TranslateTransition.INDEFINITE); @@ -112,7 +245,7 @@ public class BlackjackGUI extends Application { lightGreenButtonTransition.play(); blackjackTransition.play(); - lightGreenButton.setOnAction(event -> { + newGameButton.setOnAction(event -> { lightGreenButtonTransition.stop(); lightBlueButtonTransition.stop(); blackjackTransition.stop(); @@ -123,8 +256,7 @@ public class BlackjackGUI extends Application { blackjackTransition.setAutoReverse(false); blackjackTransition.setCycleCount(1); - blackjackTransition.setByX(-640); - blackjackTransition.setByY(-250); + blackjackTransition.setByY(-700); blackjackTransition.setDuration(Duration.seconds(1)); lightBlueButtonTransition.setAutoReverse(false); @@ -136,22 +268,83 @@ public class BlackjackGUI extends Application { lightGreenButtonTransition.setByY(300); blackjackTransition.setOnFinished(e -> { - blackjackTransition.setByX(0); - blackjackTransition.setByY(10); - blackjackTransition.setCycleCount(TranslateTransition.INDEFINITE); - blackjackTransition.setAutoReverse(true); - - blackjackTransition.play(); + primaryStage.setScene(scene_2); }); + lightBlueButtonTransition.play(); + lightGreenButtonTransition.play(); + scaleTransition.play(); blackjackTransition.play(); + }); + + morePlayerButton.setOnAction(event -> { + playerCount.setText(String.valueOf(Integer.parseInt(playerCount.getText()) + 1)); + + aiStrength.setVisible(true); + + if (Integer.parseInt(playerCount.getText()) > 7) { + playerCount.setText("7"); + + } + }); + + lessPlayerButton.setOnAction(event -> { + playerCount.setText(String.valueOf(Integer.parseInt(playerCount.getText()) - 1)); + + if (Integer.parseInt(playerCount.getText()) <= 1) { + playerCount.setText("1"); + aiStrength.setVisible(false); + } + }); + + loadGameButton.setOnAction(event -> { + lightGreenButtonTransition.stop(); + lightBlueButtonTransition.stop(); + blackjackTransition.stop(); + + ScaleTransition scaleTransition = new ScaleTransition(Duration.seconds(1), blackjackImageView); + scaleTransition.setToX(0.3); + scaleTransition.setToY(0.3); + + blackjackTransition.setAutoReverse(false); + blackjackTransition.setCycleCount(1); + blackjackTransition.setByY(-700); + blackjackTransition.setDuration(Duration.seconds(1)); + + lightBlueButtonTransition.setAutoReverse(false); + lightBlueButtonTransition.setCycleCount(1); + lightBlueButtonTransition.setByY(300); + + lightGreenButtonTransition.setAutoReverse(false); + lightGreenButtonTransition.setCycleCount(1); + lightGreenButtonTransition.setByY(300); + + blackjackTransition.setOnFinished(e -> { + game(primaryStage, true, 0, 0, 0); + }); + lightBlueButtonTransition.play(); lightGreenButtonTransition.play(); scaleTransition.play(); + blackjackTransition.play(); + }); + + startGameButton.setOnAction(event -> { + + int ai; + + if (aiStrengthStupid.isSelected()) { + ai = 2; + } else { + ai = 1; + } + + game(primaryStage, false, Integer.parseInt(playerCount.getText()), ai, + Integer.parseInt(playerStartMoney.getText())); }); } - private Button createButtonWithText(String buttonText, String imagePath, int size) { + private Button createButtonWithText(String buttonText, String imagePath, int size, double translateYValue) { Image buttonImage = new Image(imagePath); ImageView buttonImageView = new ImageView(buttonImage); buttonImageView.setFitWidth(size); @@ -165,7 +358,6 @@ public class BlackjackGUI extends Application { button.setFont(font); button.setTextFill(Color.WHITE); - double translateYValue = 7.0; buttonImageView.setTranslateY(translateYValue); button.setStyle("-fx-background-color: transparent; -fx-border-color: transparent;"); diff --git a/Partie_3_GUI/src/main/java/ch/hepia/GameManager.java b/Partie_3_GUI/src/main/java/ch/hepia/GameManager.java index 2cc3940f7e6485114af15f378c94242b079d1859..01f0f8681180af66735a20560fbe42f223d8e00a 100644 --- a/Partie_3_GUI/src/main/java/ch/hepia/GameManager.java +++ b/Partie_3_GUI/src/main/java/ch/hepia/GameManager.java @@ -2,6 +2,31 @@ package ch.hepia; import java.util.ArrayList; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.scene.Scene; +import javafx.scene.control.Button; +import javafx.scene.control.TextField; +import javafx.scene.image.Image; +import javafx.scene.image.ImageView; +import javafx.scene.layout.Background; +import javafx.scene.layout.BackgroundFill; +import javafx.scene.layout.BackgroundImage; +import javafx.scene.layout.BackgroundPosition; +import javafx.scene.layout.BackgroundRepeat; +import javafx.scene.layout.BackgroundSize; +import javafx.scene.layout.CornerRadii; +import javafx.scene.layout.HBox; +import javafx.scene.layout.StackPane; +import javafx.scene.layout.VBox; +import javafx.scene.paint.Color; +import javafx.scene.text.Font; +import javafx.scene.text.FontWeight; +import javafx.scene.text.Text; +import javafx.scene.text.TextAlignment; +import javafx.stage.Stage; +import javafx.beans.value.*; + public class GameManager { private JeudeCarte Deck; @@ -9,6 +34,7 @@ public class GameManager { private JoueurCroupier Dealer; private int ComputerPlayers; private int Step; + private boolean GameOver; public GameManager(int nbPlayer, int startMoney, int computerStrategy) { @@ -17,6 +43,8 @@ public class GameManager { this.Players = new ArrayList<>(); + this.GameOver = false; + // First Player is always the humain this.Players.add(new JoueurHumain(Deck, startMoney)); @@ -40,6 +68,8 @@ public class GameManager { this.Players = new ArrayList<>(); + this.GameOver = false; + // First Player is always the humain this.Players.add(new JoueurHumain(Deck, Money.get(0))); @@ -58,60 +88,152 @@ public class GameManager { // Phase 1 (StartTurn): // Ask the player how much he wan't to bid - public void StartTurn() { + public void StartTurn(Stage primaryStage) { this.Step = 0; - System.out.print("\033[H\033[2J"); - System.out.flush(); + Font font = Font.font("Courier New", FontWeight.BOLD, 25); - System.out.println("*~-~* " + App.ANSI_RED + "BlackJack" + App.ANSI_RESET + " *~-~*\n"); + Image backgroundImage = new Image("file:img/background.jpg"); + BackgroundImage background = new BackgroundImage( + backgroundImage, + BackgroundRepeat.NO_REPEAT, + BackgroundRepeat.NO_REPEAT, + BackgroundPosition.CENTER, + new BackgroundSize(BackgroundSize.AUTO, BackgroundSize.AUTO, false, false, true, true)); - double bet; + Image backgroundImagePopup = new Image("file:img/popup.png", 550, 400, false, true); + BackgroundImage backgroundPopup = new BackgroundImage( + backgroundImagePopup, + BackgroundRepeat.NO_REPEAT, + BackgroundRepeat.NO_REPEAT, + BackgroundPosition.CENTER, + new BackgroundSize(550, 400, false, false, true, true)); - System.out.println("Money : " + App.ANSI_BLUE + this.Players.get(0).GetMoney() + App.ANSI_RESET); + if (this.GameOver) { - // Ask the bid amount until a valide answer is given - while (true) { + Button exitButton = createButtonWithText("Exit", "file:img/red_button.png", 200, + 7.0); - System.out.print("How much do you want to bet (Min. 10) ? "); + Text gameOver = new Text("Game Over !"); - // Check that the input is an valid double - while (!App.in.hasNextDouble()) { - System.out.println(App.ANSI_YELLOW + "Please enter a valid number to bet." + App.ANSI_RESET); - System.out.print("How much do you want to bet (Min. 10) ?"); - App.in.next(); - } + gameOver.setFont(Font.font("Courier New", FontWeight.BOLD, 50)); + gameOver.setFill(Color.BLACK); + + VBox layout = new VBox(100); + layout.getChildren().addAll(gameOver, exitButton); + layout.setAlignment(Pos.CENTER); + layout.setMinSize(550, 400); + layout.setMaxSize(550, 400); + + StackPane root = new StackPane(); + + root.getChildren().add(layout); + + root.setBackground(new Background(background)); + layout.setBackground(new Background(backgroundPopup)); + + Scene scene_3 = new Scene(root, 1400, 800); + + primaryStage.setScene(scene_3); + + exitButton.setOnAction(event -> { + primaryStage.close(); + }); + + } else { + Button exitButton = createButtonWithText("Save & Exit", "file:img/light_blue_button.png", 200, + 7.0); + + Button startButton = createButtonWithText("Start Turn", "file:img/light_green_button.png", 200, + 7.0); + + Text bid = new Text("Bid Amount : "); + Text bidAlert = new Text(" \n "); + bidAlert.setTextAlignment(TextAlignment.CENTER); + TextField bidAmount = new TextField(); + + bidAmount.setFont(font); + bidAmount.setPrefWidth(130); + bidAmount.setMaxWidth(130); + + bidAlert.setFont(font); + bidAlert.setFill(Color.RED); + + bid.setFont(font); + bid.setFill(Color.BLACK); - bet = App.in.nextDouble(); + bidAmount.setText("10"); - // Check if the player has enough money to place the bid - if (bet <= this.Players.get(0).GetMoney()) { + HBox bidBox = new HBox(10); + bidBox.setAlignment(Pos.CENTER); + bidBox.getChildren().addAll(bid, bidAmount); - // Check if the minimum bid amount it cleared - if (bet < 10) { - System.out.println(App.ANSI_YELLOW + "Minimum bid amount is 10." + App.ANSI_RESET); + HBox buttonBox = new HBox(10); + buttonBox.setAlignment(Pos.CENTER); + buttonBox.getChildren().addAll(exitButton, startButton); + + StackPane root = new StackPane(); + + VBox layout = new VBox(50); + layout.getChildren().addAll(bidBox, bidAlert, buttonBox); + layout.setAlignment(Pos.CENTER); + layout.setMinSize(550, 400); + layout.setMaxSize(550, 400); + + root.getChildren().add(layout); + + root.setBackground(new Background(background)); + layout.setBackground(new Background(backgroundPopup)); + + Scene scene_3 = new Scene(root, 1400, 800); + + primaryStage.setScene(scene_3); + + bidAmount.textProperty().addListener(new ChangeListener<String>() { + @Override + public void changed(ObservableValue<? extends String> observable, String oldValue, + String newValue) { + if (!newValue.matches("\\d*")) { + bidAmount.setText(newValue.replaceAll("[^\\d]", "")); + } else if (newValue.isEmpty()) { + bidAmount.setText("10"); + } + } + }); + + startButton.setOnAction(event -> { + + if (Double.parseDouble(bidAmount.getText()) < 10 + || Double.parseDouble(bidAmount.getText()) > this.Players.get(0).GetMoney()) { + bidAlert.setText("Must be between\n10 and " + this.Players.get(0).GetMoney()); } else { - break; + Players.get(0).SetBet(Double.parseDouble(bidAmount.getText()), 0); + + // Set the Computer players bid for this turn + for (int x = 1; x <= this.ComputerPlayers; x++) { + Players.get(x).SetBet(10, 0); + } + + layout.setVisible(false); + } + }); - } else { - System.out.println(App.ANSI_YELLOW + "You don't have enough money." + App.ANSI_RESET); - } - } + exitButton.setOnAction(event -> { - // Set the player bid for this turn - Players.get(0).SetBet(bet, 0); + Save Game = new Save(); + Game.save(this.Players, this.ComputerPlayers); - // Set the Computer players bid for this turn - for (int x = 1; x <= this.ComputerPlayers; x++) { - Players.get(x).SetBet(10, 0); + primaryStage.close(); + + }); } } // Phase 2 (PlayTurn): // Ask the player for all his interactions with this cards - public void PlayTurn() { + public void PlayTurn(Stage primaryStage) { boolean EndTurn = false, CanSplit = false, CanInsure = false, CanDouble = false, CanDraw = false; @@ -133,76 +255,83 @@ public class GameManager { System.out.print("\033[H\033[2J"); System.out.flush(); - System.out.println("*~-~* " + App.ANSI_RED + "BlackJack" + App.ANSI_RESET + " *~-~*\n"); + // System.out.println("*~-~* " + App.ANSI_RED + "BlackJack" + App.ANSI_RESET + " + // *~-~*\n"); // Show the remaining amount of cards in the deck - System.out.println( - "Cards in Deck : " + App.ANSI_GREEN + this.Deck.GetNbCards() + App.ANSI_RESET + "\n"); + // System.out.println("Cards in Deck : " + App.ANSI_GREEN + + // this.Deck.GetNbCards() + App.ANSI_RESET + "\n"); // Dealer has only 1 card in his hand at this point in time - System.out - .println("Dealer Strength : " + App.ANSI_PURPLE + this.Dealer.GetStrength(0) + App.ANSI_RESET); + // System.out.println("Dealer Strength : " + App.ANSI_PURPLE + + // this.Dealer.GetStrength(0) + App.ANSI_RESET); // Show the dealer hand this.Dealer.ShowHands(); // Show the current player balance - System.out.println("\nMoney : " + App.ANSI_BLUE + this.Players.get(0).GetMoney() + App.ANSI_RESET); + // System.out.println("\nMoney : " + App.ANSI_BLUE + + // this.Players.get(0).GetMoney() + App.ANSI_RESET); // Check if the player has put down an insurance if (this.Players.get(0).HasInsured()) { - System.out.println( - "Insured : " + App.ANSI_BLUE + this.Players.get(0).GetInsured() + App.ANSI_RESET); + // System.out.println("Insured : " + App.ANSI_BLUE + + // this.Players.get(0).GetInsured() + App.ANSI_RESET); } // Show the hand number of the player - System.out - .println("Bet on Hand " + App.ANSI_GREEN + (HandNb + 1) + App.ANSI_RESET + " : " + App.ANSI_BLUE - + this.Players.get(0).GetBet(HandNb) + App.ANSI_RESET); + // System.out.println("Bet on Hand " + App.ANSI_GREEN + (HandNb + 1) + + // App.ANSI_RESET + " : " + App.ANSI_BLUE+ this.Players.get(0).GetBet(HandNb) + + // App.ANSI_RESET); // Show the hand strength of the player // 99 = BlackJack // >21 = Busted // <=21 = show the strength - System.out - .print("Strength of Hand " + App.ANSI_GREEN + (HandNb + 1) + App.ANSI_RESET + " : " - + App.ANSI_PURPLE); + // System.out.print("Strength of Hand " + App.ANSI_GREEN + (HandNb + 1) + + // App.ANSI_RESET + " : "+ App.ANSI_PURPLE); if (this.Players.get(0).GetStrength(HandNb) == 99) { - System.out.println("BlackJack" + App.ANSI_RESET); + // System.out.println("BlackJack" + App.ANSI_RESET); } else if (this.Players.get(0).GetStrength(HandNb) > 21) { - System.out.println( - this.Players.get(0).GetStrength(HandNb) + App.ANSI_RED + " [BUSTED]" + App.ANSI_RESET); + // System.out.println(this.Players.get(0).GetStrength(HandNb) + App.ANSI_RED + " + // [BUSTED]" + App.ANSI_RESET); } else { - System.out.println(this.Players.get(0).GetStrength(HandNb) + App.ANSI_RESET); + // System.out.println(this.Players.get(0).GetStrength(HandNb) + App.ANSI_RESET); } // Show the player hand this.Players.get(0).ShowHand(HandNb); // Show Computer Players hands - for (int x = 1; x <= this.ComputerPlayers; x++) { - for (int HandNbComputer = 0; HandNbComputer < this.Players.get(x).GetNbHands(); HandNbComputer++) { - System.out - .print("\nComputer " + App.ANSI_GREEN + x + App.ANSI_RESET + ", Money " + App.ANSI_BLUE - + this.Players.get(x).GetMoney() + App.ANSI_RESET + ", Hand " - + App.ANSI_GREEN + HandNbComputer + App.ANSI_RESET + ", Bet " + App.ANSI_BLUE - + this.Players.get(x).GetBet(HandNbComputer) + App.ANSI_RESET + ", Strength " - + App.ANSI_PURPLE); - if (this.Players.get(x).GetStrength(HandNbComputer) == 99) { - System.out.println("BlackJack" + App.ANSI_RESET + " :"); - } else if (this.Players.get(x).GetStrength(HandNbComputer) > 21) { - System.out.println( - this.Players.get(x).GetStrength(HandNbComputer) + App.ANSI_RED + " [BUSTED]" - + App.ANSI_RESET + " :"); - } else { - System.out.println(this.Players.get(x).GetStrength(HandNbComputer) + App.ANSI_RESET + " :"); - } - this.Players.get(x).ShowHand(HandNbComputer); - } - } + /* + * for (int x = 1; x <= this.ComputerPlayers; x++) { + * for (int HandNbComputer = 0; HandNbComputer < + * this.Players.get(x).GetNbHands(); HandNbComputer++) { + * System.out + * .print("\nComputer " + App.ANSI_GREEN + x + App.ANSI_RESET + ", Money " + + * App.ANSI_BLUE + * + this.Players.get(x).GetMoney() + App.ANSI_RESET + ", Hand " + * + App.ANSI_GREEN + HandNbComputer + App.ANSI_RESET + ", Bet " + App.ANSI_BLUE + * + this.Players.get(x).GetBet(HandNbComputer) + App.ANSI_RESET + ", Strength " + * + App.ANSI_PURPLE); + * if (this.Players.get(x).GetStrength(HandNbComputer) == 99) { + * System.out.println("BlackJack" + App.ANSI_RESET + " :"); + * } else if (this.Players.get(x).GetStrength(HandNbComputer) > 21) { + * System.out.println( + * this.Players.get(x).GetStrength(HandNbComputer) + App.ANSI_RED + " [BUSTED]" + * + App.ANSI_RESET + " :"); + * } else { + * System.out.println(this.Players.get(x).GetStrength(HandNbComputer) + + * App.ANSI_RESET + " :"); + * } + * this.Players.get(x).ShowHand(HandNbComputer); + * } + * } + */ // Choices for player - System.out.println("\n--- " + App.ANSI_GREEN + "Choices" + App.ANSI_RESET + " ---\n"); + // System.out.println("\n--- " + App.ANSI_GREEN + "Choices" + App.ANSI_RESET + " + // ---\n"); // Insurance // Can only insure if it's the first thing that the players does @@ -211,7 +340,8 @@ public class GameManager { if (this.Step == 0 && this.Dealer.HasOnlyAs() && !this.Players.get(0).HasInsured()) { CanInsure = true; - System.out.println(App.ANSI_BLUE + "[i]" + App.ANSI_RESET + " Insurance against Dealer"); + // System.out.println(App.ANSI_BLUE + "[i]" + App.ANSI_RESET + " Insurance + // against Dealer"); } // Split @@ -225,7 +355,8 @@ public class GameManager { && this.Players.get(0).GetNbHands() < 3 && this.Players.get(0).GetBet(HandNb) <= this.Players.get(0).GetMoney()) { CanSplit = true; - System.out.println(App.ANSI_BLUE + "[s]" + App.ANSI_RESET + " Split your Hand"); + // System.out.println(App.ANSI_BLUE + "[s]" + App.ANSI_RESET + " Split your + // Hand"); } // Double @@ -241,7 +372,8 @@ public class GameManager { && this.Players.get(0).GetStrength(HandNb) != 99 && this.Players.get(0).GetBet(HandNb) <= this.Players.get(0).GetMoney()) { CanDouble = true; - System.out.println(App.ANSI_BLUE + "[d]" + App.ANSI_RESET + " Double your Hand"); + // System.out.println(App.ANSI_BLUE + "[d]" + App.ANSI_RESET + " Double your + // Hand"); } // Draw a Card (Hit) @@ -257,27 +389,32 @@ public class GameManager { && this.Players.get(0).GetCardStrength(HandNb, 0) == 1) && this.Players.get(0).GetStrength(HandNb) < 21) { CanDraw = true; - System.out.println(App.ANSI_BLUE + "[h]" + App.ANSI_RESET + " Hit"); + // System.out.println(App.ANSI_BLUE + "[h]" + App.ANSI_RESET + " Hit"); } // Keep (Stand) - System.out.println(App.ANSI_BLUE + "[k]" + App.ANSI_RESET + " Keep current Hand"); + // System.out.println(App.ANSI_BLUE + "[k]" + App.ANSI_RESET + " Keep current + // Hand"); // Ask for the player choice until a valide one is given - while (true) { - System.out.print("> "); - - choice = App.in.next().charAt(0); - - // Choices are checked with available one for confirmation - if ((choice == 'i' && CanInsure) || (choice == 's' && CanSplit) || (choice == 'd' && CanDouble) - || (choice == 'h' && CanDraw) - || choice == 'k') { - break; - } else { - System.out.println(App.ANSI_YELLOW + "Please enter a valid choice." + App.ANSI_RESET); - } - } + /* + * while (true) { + * System.out.print("> "); + * + * choice = App.in.next().charAt(0); + * + * // Choices are checked with available one for confirmation + * if ((choice == 'i' && CanInsure) || (choice == 's' && CanSplit) || (choice == + * 'd' && CanDouble) + * || (choice == 'h' && CanDraw) + * || choice == 'k') { + * break; + * } else { + * System.out.println(App.ANSI_YELLOW + "Please enter a valid choice." + + * App.ANSI_RESET); + * } + * } + */ // Hit if (choice == 'h') { @@ -319,7 +456,7 @@ public class GameManager { // Make the Dealer pick cards // Do all the math for the player gains and losses // Check if the player can continue et prepare for the next round - public boolean ResolveTurn() { + public boolean ResolveTurn(Stage primaryStage) { // Computer Players take turn to play for (int x = 1; x <= this.ComputerPlayers; x++) { @@ -539,23 +676,25 @@ public class GameManager { System.out.print("\033[H\033[2J"); System.out.flush(); - System.out.println("*~-~* " + App.ANSI_RED + "BlackJack" + App.ANSI_RESET + " *~-~*\n"); + // System.out.println("*~-~* " + App.ANSI_RED + "BlackJack" + App.ANSI_RESET + " + // *~-~*\n"); // Show the remaining amount of cards in the deck - System.out.println( - "Cards in Deck : " + App.ANSI_GREEN + this.Deck.GetNbCards() + App.ANSI_RESET + "\n"); + // System.out.println("Cards in Deck : " + App.ANSI_GREEN + + // this.Deck.GetNbCards() + App.ANSI_RESET + "\n"); // Show the hand strength of the dealer // 99 = BlackJack // >21 = Busted // <=21 = show the strength - System.out.print("Dealer Score : " + App.ANSI_PURPLE); + // System.out.print("Dealer Score : " + App.ANSI_PURPLE); if (this.Dealer.GetStrength(0) == 99) { - System.out.println("BlackJack" + App.ANSI_RESET); + // System.out.println("BlackJack" + App.ANSI_RESET); } else if (this.Dealer.GetStrength(0) > 21) { - System.out.println(this.Dealer.GetStrength(0) + App.ANSI_RED + " [BUSTED]" + App.ANSI_RESET); + // System.out.println(this.Dealer.GetStrength(0) + App.ANSI_RED + " [BUSTED]" + + // App.ANSI_RESET); } else { - System.out.println(this.Dealer.GetStrength(0) + App.ANSI_RESET); + // System.out.println(this.Dealer.GetStrength(0) + App.ANSI_RESET); } // Show the dealers hand @@ -563,8 +702,8 @@ public class GameManager { // Check if the player has put down an insurance if (this.Players.get(0).HasInsured()) { - System.out.println( - "Insured : " + App.ANSI_BLUE + this.Players.get(0).GetInsured() + App.ANSI_RESET); + // System.out.println("Insured : " + App.ANSI_BLUE + + // this.Players.get(0).GetInsured() + App.ANSI_RESET); } // Apply Computer Players Loss/Win @@ -601,87 +740,107 @@ public class GameManager { } // Show Computer Players hands - for (int x = 1; x <= this.ComputerPlayers; x++) { - for (int HandNbComputer = 0; HandNbComputer < this.Players.get(x).GetNbHands(); HandNbComputer++) { - System.out - .print("\nComputer " + App.ANSI_GREEN + x + App.ANSI_RESET + ", Money " + App.ANSI_BLUE - + this.Players.get(x).GetMoney() + App.ANSI_RESET + ", Hand " - + App.ANSI_GREEN + HandNbComputer + App.ANSI_RESET + ", Bet " + App.ANSI_BLUE - + this.Players.get(x).GetBet(HandNbComputer) + App.ANSI_RESET + ", Strength " - + App.ANSI_PURPLE); - if (this.Players.get(x).GetStrength(HandNbComputer) == 99) { - System.out.println("BlackJack" + App.ANSI_RESET + " :"); - } else if (this.Players.get(x).GetStrength(HandNbComputer) > 21) { - System.out.println( - this.Players.get(x).GetStrength(HandNbComputer) + App.ANSI_RED + " [BUSTED]" - + App.ANSI_RESET + " :"); - } else { - System.out.println(this.Players.get(x).GetStrength(HandNbComputer) + App.ANSI_RESET + " :"); - } - this.Players.get(x).ShowHand(HandNbComputer); - } - } + /* + * for (int x = 1; x <= this.ComputerPlayers; x++) { + * for (int HandNbComputer = 0; HandNbComputer < + * this.Players.get(x).GetNbHands(); HandNbComputer++) { + * System.out + * .print("\nComputer " + App.ANSI_GREEN + x + App.ANSI_RESET + ", Money " + + * App.ANSI_BLUE + * + this.Players.get(x).GetMoney() + App.ANSI_RESET + ", Hand " + * + App.ANSI_GREEN + HandNbComputer + App.ANSI_RESET + ", Bet " + App.ANSI_BLUE + * + this.Players.get(x).GetBet(HandNbComputer) + App.ANSI_RESET + ", Strength " + * + App.ANSI_PURPLE); + * if (this.Players.get(x).GetStrength(HandNbComputer) == 99) { + * System.out.println("BlackJack" + App.ANSI_RESET + " :"); + * } else if (this.Players.get(x).GetStrength(HandNbComputer) > 21) { + * System.out.println( + * this.Players.get(x).GetStrength(HandNbComputer) + App.ANSI_RED + " [BUSTED]" + * + App.ANSI_RESET + " :"); + * } else { + * System.out.println(this.Players.get(x).GetStrength(HandNbComputer) + + * App.ANSI_RESET + " :"); + * } + * this.Players.get(x).ShowHand(HandNbComputer); + * } + * } + */ // Go thew all hands of the player - for (int HandNb = 0; HandNb < this.Players.get(0).GetNbHands(); HandNb++) { - - System.out.println("\nHand " + App.ANSI_GREEN + (HandNb + 1) + App.ANSI_RESET + " :"); - - // Show to bet amount of the hand - System.out.println("\tBet : " + App.ANSI_BLUE + this.Players.get(0).GetBet(HandNb) + App.ANSI_RESET); - - // Show strength of the hand of the player - // 99 = BlackJack - // >21 = Busted - // <=21 = show the strength - System.out.print("\tStrength : " + App.ANSI_PURPLE); - if (this.Players.get(0).GetStrength(HandNb) == 99) { - System.out.println("BlackJack" + App.ANSI_RESET); - } else if (this.Players.get(0).GetStrength(HandNb) > 21) { - System.out.println( - this.Players.get(0).GetStrength(HandNb) + App.ANSI_RED + " [BUSTED]" + App.ANSI_RESET); - } else { - System.out.println(this.Players.get(0).GetStrength(HandNb) + App.ANSI_RESET); - } - - // Show and apply gains and losses - System.out.print("\tResult : "); - // If the player is Busted (strength > 21 but not BlackJack (99)) - if (this.Players.get(0).GetStrength(HandNb) > 21 && this.Players.get(0).GetStrength(HandNb) != 99) { - // Show player loss - System.out.println(App.ANSI_RED + "-" + this.Players.get(0).GetBet(HandNb) + App.ANSI_RESET); - } - // If it's a Draw - else if (this.Dealer.GetStrength(0) == this.Players.get(0).GetStrength(HandNb)) { - // Player get's back his bet - System.out.println(App.ANSI_BLUE + "±0" + App.ANSI_RESET); - this.Players.get(0).AddMoney(this.Players.get(0).GetBet(HandNb)); - } - // If the player has done a BlackJack - else if (this.Players.get(0).GetStrength(HandNb) == 99) { - // Player gets payed 1.5 to 1 - System.out.println(App.ANSI_GREEN + "+" + (this.Players.get(0).GetBet(HandNb) * 1.5) + App.ANSI_RESET); - this.Players.get(0).AddMoney(this.Players.get(0).GetBet(HandNb) * 2.5); - } - // If the Dealer is Busted (strength > 21 but not BlackJack (99)) - else if (this.Dealer.GetStrength(0) > 21 && this.Dealer.GetStrength(0) != 99) { - // Player wins and get payed 1 to 1 - System.out.println(App.ANSI_GREEN + "+" + this.Players.get(0).GetBet(HandNb) + App.ANSI_RESET); - this.Players.get(0).AddMoney(this.Players.get(0).GetBet(HandNb) * 2); - } - // If the Dealer has a better score - else if (this.Players.get(0).GetStrength(HandNb) < this.Dealer.GetStrength(0)) { - // Show player loss - System.out.println(App.ANSI_RED + "-" + this.Players.get(0).GetBet(HandNb) + App.ANSI_RESET); - } - // If the Player has a better score - else if (this.Players.get(0).GetStrength(HandNb) > this.Dealer.GetStrength(0)) { - // Player wins and get payed 1 to 1 - System.out.println(App.ANSI_GREEN + "+" + this.Players.get(0).GetBet(HandNb) + App.ANSI_RESET); - this.Players.get(0).AddMoney(this.Players.get(0).GetBet(HandNb) * 2); - } - - } + /* + * for (int HandNb = 0; HandNb < this.Players.get(0).GetNbHands(); HandNb++) { + * + * System.out.println("\nHand " + App.ANSI_GREEN + (HandNb + 1) + App.ANSI_RESET + * + " :"); + * + * // Show to bet amount of the hand + * System.out.println("\tBet : " + App.ANSI_BLUE + + * this.Players.get(0).GetBet(HandNb) + App.ANSI_RESET); + * + * // Show strength of the hand of the player + * // 99 = BlackJack + * // >21 = Busted + * // <=21 = show the strength + * System.out.print("\tStrength : " + App.ANSI_PURPLE); + * if (this.Players.get(0).GetStrength(HandNb) == 99) { + * System.out.println("BlackJack" + App.ANSI_RESET); + * } else if (this.Players.get(0).GetStrength(HandNb) > 21) { + * System.out.println( + * this.Players.get(0).GetStrength(HandNb) + App.ANSI_RED + " [BUSTED]" + + * App.ANSI_RESET); + * } else { + * System.out.println(this.Players.get(0).GetStrength(HandNb) + App.ANSI_RESET); + * } + * + * // Show and apply gains and losses + * System.out.print("\tResult : "); + * // If the player is Busted (strength > 21 but not BlackJack (99)) + * if (this.Players.get(0).GetStrength(HandNb) > 21 && + * this.Players.get(0).GetStrength(HandNb) != 99) { + * // Show player loss + * System.out.println(App.ANSI_RED + "-" + this.Players.get(0).GetBet(HandNb) + + * App.ANSI_RESET); + * } + * // If it's a Draw + * else if (this.Dealer.GetStrength(0) == + * this.Players.get(0).GetStrength(HandNb)) { + * // Player get's back his bet + * System.out.println(App.ANSI_BLUE + "±0" + App.ANSI_RESET); + * this.Players.get(0).AddMoney(this.Players.get(0).GetBet(HandNb)); + * } + * // If the player has done a BlackJack + * else if (this.Players.get(0).GetStrength(HandNb) == 99) { + * // Player gets payed 1.5 to 1 + * System.out.println(App.ANSI_GREEN + "+" + (this.Players.get(0).GetBet(HandNb) + * * 1.5) + App.ANSI_RESET); + * this.Players.get(0).AddMoney(this.Players.get(0).GetBet(HandNb) * 2.5); + * } + * // If the Dealer is Busted (strength > 21 but not BlackJack (99)) + * else if (this.Dealer.GetStrength(0) > 21 && this.Dealer.GetStrength(0) != 99) + * { + * // Player wins and get payed 1 to 1 + * System.out.println(App.ANSI_GREEN + "+" + this.Players.get(0).GetBet(HandNb) + * + App.ANSI_RESET); + * this.Players.get(0).AddMoney(this.Players.get(0).GetBet(HandNb) * 2); + * } + * // If the Dealer has a better score + * else if (this.Players.get(0).GetStrength(HandNb) < + * this.Dealer.GetStrength(0)) { + * // Show player loss + * System.out.println(App.ANSI_RED + "-" + this.Players.get(0).GetBet(HandNb) + + * App.ANSI_RESET); + * } + * // If the Player has a better score + * else if (this.Players.get(0).GetStrength(HandNb) > + * this.Dealer.GetStrength(0)) { + * // Player wins and get payed 1 to 1 + * System.out.println(App.ANSI_GREEN + "+" + this.Players.get(0).GetBet(HandNb) + * + App.ANSI_RESET); + * this.Players.get(0).AddMoney(this.Players.get(0).GetBet(HandNb) * 2); + * } + * + * } + */ // Check if the player had insurance if (this.Players.get(0).HasInsured()) { @@ -691,38 +850,45 @@ public class GameManager { // If the Dealer did a BackJack if (this.Dealer.GetStrength(0) == 99) { // Player gets payed back 2 to 1 - System.out.println(App.ANSI_GREEN + "+" + (this.Players.get(0).GetInsured() * 3) + App.ANSI_RESET); + // System.out.println(App.ANSI_GREEN + "+" + (this.Players.get(0).GetInsured() * + // 3) + App.ANSI_RESET); this.Players.get(0).AddMoney(this.Players.get(0).GetInsured() * 3); } else { // Show player loss - System.out.println(App.ANSI_RED + "-" + (this.Players.get(0).GetInsured()) + App.ANSI_RESET); + // System.out.println(App.ANSI_RED + "-" + (this.Players.get(0).GetInsured()) + + // App.ANSI_RESET); } } // Show the final player balance - System.out.println("\nMoney : " + App.ANSI_BLUE + this.Players.get(0).GetMoney() + App.ANSI_RESET); + // System.out.println("\nMoney : " + App.ANSI_BLUE + + // this.Players.get(0).GetMoney() + App.ANSI_RESET); // Show Choices - System.out.println("\n--- " + App.ANSI_GREEN + "Choices" + App.ANSI_RESET + " ---\n"); + // System.out.println("\n--- " + App.ANSI_GREEN + "Choices" + App.ANSI_RESET + " + // ---\n"); - System.out.println(App.ANSI_BLUE + "[c]" + App.ANSI_RESET + " Continue"); - System.out.println(App.ANSI_BLUE + "[s]" + App.ANSI_RESET + " Save & Quit"); + // System.out.println(App.ANSI_BLUE + "[c]" + App.ANSI_RESET + " Continue"); + // System.out.println(App.ANSI_BLUE + "[s]" + App.ANSI_RESET + " Save & Quit"); char choice = 'x'; // Ask for the player choice until a valide one is given - while (true) { - System.out.print("> "); - - choice = App.in.next().charAt(0); - - // Choices are checked with available one for confirmation - if (choice == 'c' || choice == 's') { - break; - } else { - System.out.println(App.ANSI_YELLOW + "Please enter a valid choice." + App.ANSI_RESET); - } - } + /* + * while (true) { + * System.out.print("> "); + * + * choice = App.in.next().charAt(0); + * + * // Choices are checked with available one for confirmation + * if (choice == 'c' || choice == 's') { + * break; + * } else { + * System.out.println(App.ANSI_YELLOW + "Please enter a valid choice." + + * App.ANSI_RESET); + * } + * } + */ if (choice == 'c') { // If the player has less than the minimum bid amount allowed @@ -752,4 +918,30 @@ public class GameManager { return false; } + private Button createButtonWithText(String buttonText, String imagePath, int size, double translateYValue) { + Image buttonImage = new Image(imagePath); + ImageView buttonImageView = new ImageView(buttonImage); + buttonImageView.setFitWidth(size); + buttonImageView.setPreserveRatio(true); + + Button button = new Button(buttonText, buttonImageView); + button.setContentDisplay(javafx.scene.control.ContentDisplay.CENTER); + button.setPadding(Insets.EMPTY); + + Font font = Font.font("Courier New", FontWeight.BOLD, 25); + button.setFont(font); + button.setTextFill(Color.WHITE); + + buttonImageView.setTranslateY(translateYValue); + + button.setStyle("-fx-background-color: transparent; -fx-border-color: transparent;"); + + button.setOnMouseEntered(e -> button.setStyle( + "-fx-cursor: hand; -fx-background-color: transparent; -fx-border-color: transparent;")); + + button.setOnMouseExited(e -> button + .setStyle("-fx-background-color: transparent; -fx-border-color: transparent;")); + + return button; + } } diff --git a/Partie_3_GUI/target/classes/ch/hepia/App.class b/Partie_3_GUI/target/classes/ch/hepia/App.class deleted file mode 100644 index 6f9ea08bede892bdaffb0daee17453c3e7b99324..0000000000000000000000000000000000000000 Binary files a/Partie_3_GUI/target/classes/ch/hepia/App.class and /dev/null differ diff --git a/Partie_3_GUI/target/classes/ch/hepia/BlackjackGUI$1.class b/Partie_3_GUI/target/classes/ch/hepia/BlackjackGUI$1.class new file mode 100644 index 0000000000000000000000000000000000000000..0108bfa7beeb341799a40b35a1d2f409ab7042bb Binary files /dev/null and b/Partie_3_GUI/target/classes/ch/hepia/BlackjackGUI$1.class differ diff --git a/Partie_3_GUI/target/classes/ch/hepia/BlackjackGUI.class b/Partie_3_GUI/target/classes/ch/hepia/BlackjackGUI.class index 8ee6da1ffe40a822485baf2765e2b7c90c623206..99b73da8cdc04a71b6522bf8776c23ecdd313229 100644 Binary files a/Partie_3_GUI/target/classes/ch/hepia/BlackjackGUI.class and b/Partie_3_GUI/target/classes/ch/hepia/BlackjackGUI.class differ diff --git a/Partie_3_GUI/target/classes/ch/hepia/COULEUR.class b/Partie_3_GUI/target/classes/ch/hepia/COULEUR.class index c582fd28bd308c74abcc31d7c543625ab96af75b..c38a76f38b5f56aec3100849ad749e77c1255bcd 100644 Binary files a/Partie_3_GUI/target/classes/ch/hepia/COULEUR.class and b/Partie_3_GUI/target/classes/ch/hepia/COULEUR.class differ diff --git a/Partie_3_GUI/target/classes/ch/hepia/Carte.class b/Partie_3_GUI/target/classes/ch/hepia/Carte.class index f2e1b3556ab535a9579d8c800c12eb799aff3d01..bb77e1a2cf2b2c55d68d07f73a271f6ad870f1c6 100644 Binary files a/Partie_3_GUI/target/classes/ch/hepia/Carte.class and b/Partie_3_GUI/target/classes/ch/hepia/Carte.class differ diff --git a/Partie_3_GUI/target/classes/ch/hepia/GameManager$1.class b/Partie_3_GUI/target/classes/ch/hepia/GameManager$1.class new file mode 100644 index 0000000000000000000000000000000000000000..cf32a393bd62ad299b967bad90ea50167be45046 Binary files /dev/null and b/Partie_3_GUI/target/classes/ch/hepia/GameManager$1.class differ diff --git a/Partie_3_GUI/target/classes/ch/hepia/GameManager.class b/Partie_3_GUI/target/classes/ch/hepia/GameManager.class index e282ad70f389211acf3598dce6c56617b197d996..ef64cca08dec5fb70b0de12ed32d495f51e0441d 100644 Binary files a/Partie_3_GUI/target/classes/ch/hepia/GameManager.class and b/Partie_3_GUI/target/classes/ch/hepia/GameManager.class differ diff --git a/Partie_3_GUI/target/classes/ch/hepia/Hand$1.class b/Partie_3_GUI/target/classes/ch/hepia/Hand$1.class index 2214bf48295c2e99569934bb083314370d6c1499..e2750c39ec1ee0ffda4f715b78a572443a2da898 100644 Binary files a/Partie_3_GUI/target/classes/ch/hepia/Hand$1.class and b/Partie_3_GUI/target/classes/ch/hepia/Hand$1.class differ diff --git a/Partie_3_GUI/target/classes/ch/hepia/Hand.class b/Partie_3_GUI/target/classes/ch/hepia/Hand.class index 6e99640898ba7d7dacac297d9754b15afd0dc13e..a5d795896fe3549efa725a1873962850a6211e6f 100644 Binary files a/Partie_3_GUI/target/classes/ch/hepia/Hand.class and b/Partie_3_GUI/target/classes/ch/hepia/Hand.class differ diff --git a/Partie_3_GUI/target/classes/ch/hepia/JeudeCarte$1.class b/Partie_3_GUI/target/classes/ch/hepia/JeudeCarte$1.class index 2735eb7c27de1aa52aa4584d2c1ef9d746a2b524..e87f2ad85071fb1b622c4a955974eae6caf97a63 100644 Binary files a/Partie_3_GUI/target/classes/ch/hepia/JeudeCarte$1.class and b/Partie_3_GUI/target/classes/ch/hepia/JeudeCarte$1.class differ diff --git a/Partie_3_GUI/target/classes/ch/hepia/JeudeCarte.class b/Partie_3_GUI/target/classes/ch/hepia/JeudeCarte.class index ef19fe3892611f8ced9c139e6ced49f24319685c..7c84a24a016f03fff7d97c2fd8eab208948f7fbf 100644 Binary files a/Partie_3_GUI/target/classes/ch/hepia/JeudeCarte.class and b/Partie_3_GUI/target/classes/ch/hepia/JeudeCarte.class differ diff --git a/Partie_3_GUI/target/classes/ch/hepia/JoueurCroupier.class b/Partie_3_GUI/target/classes/ch/hepia/JoueurCroupier.class index a6d7be41a8badd1a6b17940cba326b7982c5ed9e..1d0bb3797ec4281bcbc48e36763785c6e864c086 100644 Binary files a/Partie_3_GUI/target/classes/ch/hepia/JoueurCroupier.class and b/Partie_3_GUI/target/classes/ch/hepia/JoueurCroupier.class differ diff --git a/Partie_3_GUI/target/classes/ch/hepia/JoueurHumain.class b/Partie_3_GUI/target/classes/ch/hepia/JoueurHumain.class index 80c3c5720b4dac59c98a4620e9f627ec9d95b149..068028eff942eafbe3b36e821e7fc43a0fe1309b 100644 Binary files a/Partie_3_GUI/target/classes/ch/hepia/JoueurHumain.class and b/Partie_3_GUI/target/classes/ch/hepia/JoueurHumain.class differ diff --git a/Partie_3_GUI/target/classes/ch/hepia/JoueurOrdinateur.class b/Partie_3_GUI/target/classes/ch/hepia/JoueurOrdinateur.class index 7d9b26c3479ba17255924e3dfe272b223229de85..e8925bd7d60d537103d49935df82fae23c2b1f36 100644 Binary files a/Partie_3_GUI/target/classes/ch/hepia/JoueurOrdinateur.class and b/Partie_3_GUI/target/classes/ch/hepia/JoueurOrdinateur.class differ diff --git a/Partie_3_GUI/target/classes/ch/hepia/Paquet.class b/Partie_3_GUI/target/classes/ch/hepia/Paquet.class index 287773450d9a2e8fcd9120c796067e1f9f2a10cf..79dc7afd66ab47cc77bb82fcf6c5682425eccc23 100644 Binary files a/Partie_3_GUI/target/classes/ch/hepia/Paquet.class and b/Partie_3_GUI/target/classes/ch/hepia/Paquet.class differ diff --git a/Partie_3_GUI/target/classes/ch/hepia/Save.class b/Partie_3_GUI/target/classes/ch/hepia/Save.class index 4d96235bc2aa0a217a3dee9df8ff67b16df6f5b7..9573a2e368dea090dc72a1674ce1aa82a9c79b87 100644 Binary files a/Partie_3_GUI/target/classes/ch/hepia/Save.class and b/Partie_3_GUI/target/classes/ch/hepia/Save.class differ diff --git a/Partie_3_GUI/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/Partie_3_GUI/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst index 5d1c142f591bd975d136e6e7e94b3cee8333fbad..639a23cb9cc4566af378d8ea8f8b8ade38dd3540 100644 --- a/Partie_3_GUI/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst +++ b/Partie_3_GUI/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -4,12 +4,9 @@ ch/hepia/Carte.class ch/hepia/Save.class ch/hepia/JoueurOrdinateur.class ch/hepia/Joueur.class -ch/hepia/App.class ch/hepia/COULEUR.class ch/hepia/Hand$1.class ch/hepia/Paquet.class ch/hepia/JoueurCroupier.class -ch/hepia/BlackjackGUI.class ch/hepia/JeudeCarte$1.class -ch/hepia/GameManager.class ch/hepia/JoueurHumain.class diff --git a/Partie_3_GUI/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/Partie_3_GUI/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst index e75eae20816218a9b04fc56d9d5a71067fcd5fb3..886584a4a8ad60a1813b528b8a0f01d220104c7a 100644 --- a/Partie_3_GUI/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +++ b/Partie_3_GUI/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -5,5 +5,4 @@ /home/padi/Git/java-card-game/Partie_3_GUI/src/main/java/ch/hepia/Paquet.java /home/padi/Git/java-card-game/Partie_3_GUI/src/main/java/ch/hepia/Carte.java /home/padi/Git/java-card-game/Partie_3_GUI/src/main/java/ch/hepia/Hand.java -/home/padi/Git/java-card-game/Partie_3_GUI/src/main/java/ch/hepia/App.java /home/padi/Git/java-card-game/Partie_3_GUI/src/main/java/ch/hepia/BlackjackGUI.java diff --git a/Partie_3_GUI/target/test-classes/ch/hepia/JoueurTest.class b/Partie_3_GUI/target/test-classes/ch/hepia/JoueurTest.class new file mode 100644 index 0000000000000000000000000000000000000000..6c1eb68d4853e00d11fada367c940922ce2fed72 Binary files /dev/null and b/Partie_3_GUI/target/test-classes/ch/hepia/JoueurTest.class differ