diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..40155f0 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/src/main/java/it/polimi/ingsw/gc14/ClientLauncherGUI.java b/src/main/java/it/polimi/ingsw/gc14/ClientLauncherGUI.java new file mode 100644 index 0000000..e94be59 --- /dev/null +++ b/src/main/java/it/polimi/ingsw/gc14/ClientLauncherGUI.java @@ -0,0 +1,61 @@ +package it.polimi.ingsw.gc14; + +import it.polimi.ingsw.gc14.Controller.ClientController; +import it.polimi.ingsw.gc14.Network.RMI.Client.RMIClient; +import it.polimi.ingsw.gc14.Network.TCP.Client.TCPClient; +import it.polimi.ingsw.gc14.View.GUI.GUI; +import it.polimi.ingsw.gc14.View.GUI.LoginView; +import javafx.application.Application; +import javafx.application.Platform; +import javafx.stage.Stage; + +public class ClientLauncherGUI extends Application { + + @Override + public void start(Stage stage) { + LoginView loginView = new LoginView(); + GUI view = new GUI(stage); + + ClientController controller = new ClientController(view); + + loginView.getBtnAccedi().setOnAction(e -> { + String nome = loginView.getNome(); + int numPlayer = loginView.getNumPlayers(); + int networkType = loginView.getNetworkType(); + String ip = loginView.getIP(); + + if (nome.isEmpty() || ip.isEmpty()) { + loginView.setErrore("Compila tutti i campi."); + return; + } + + // Connessione in un thread separato — non bloccare il JavaFX thread! + new Thread(() -> { + if (networkType == 0) { + RMIClient client = new RMIClient(controller, ip, 1099); + if (client.connect(nome, numPlayer)) { + controller.setClient(client); + // Da qui in poi il server chiamerà onGameInit → render() + } else { + Platform.runLater(() -> loginView.setErrore("Connessione RMI fallita.")); + } + } else { + TCPClient client = new TCPClient(controller, ip, 8080); + if (client.connect(nome, numPlayer)) { + controller.setClient(client); + } else { + Platform.runLater(() -> loginView.setErrore("Connessione TCP fallita.")); + } + } + }).start(); + }); + + stage.setTitle("Mesos"); + stage.setScene(loginView.getScene()); + stage.show(); + } + + public static void main(String[] args) { + launch(); + } +} \ No newline at end of file diff --git a/src/main/java/it/polimi/ingsw/gc14/ClientLauncherTUI.java b/src/main/java/it/polimi/ingsw/gc14/ClientLauncherTUI.java index 03a7a6a..f6f70c1 100644 --- a/src/main/java/it/polimi/ingsw/gc14/ClientLauncherTUI.java +++ b/src/main/java/it/polimi/ingsw/gc14/ClientLauncherTUI.java @@ -4,6 +4,13 @@ import it.polimi.ingsw.gc14.Network.NetworkEvent; import it.polimi.ingsw.gc14.Network.RMI.Client.RMIClient; import it.polimi.ingsw.gc14.Network.TCP.Client.TCPClient; import it.polimi.ingsw.gc14.View.TUI.TUI; + +import java.net.Inet4Address; +import java.net.InetAddress; +import java.net.NetworkInterface; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.List; import java.util.Scanner; /** @@ -14,6 +21,8 @@ import java.util.Scanner; */ public class ClientLauncherTUI { + List admissibleChar=new ArrayList<>(); + /** * The TUI view associated with this client. */ @@ -29,19 +38,44 @@ public class ClientLauncherTUI { */ public void main() throws InterruptedException { view = new TUI(null); + admissibleChar.add("0"); + admissibleChar.add("1"); + admissibleChar.add("2"); + admissibleChar.add("3"); + admissibleChar.add("4"); + admissibleChar.add("5"); + admissibleChar.add("6"); + admissibleChar.add("7"); + admissibleChar.add("8"); + admissibleChar.add("9"); + admissibleChar.add("A"); + admissibleChar.add("B"); + admissibleChar.add("C"); + admissibleChar.add("a"); + admissibleChar.add("b"); + admissibleChar.add("c"); + ClientController controller = new ClientController(view); Scanner scanner = new Scanner(System.in); - System.out.println("Selezionare nome utente: "); + System.out.println("Insert username: "); String username = scanner.next(); view.setUsername(username); - System.out.println("Selezionare numero di giocatori desiderato: "); + System.out.println("Insert preferred number of players: "); int proposedNumPlayers = scanner.nextInt(); - System.out.println("Selezionare RMI[0] o TCP[1]: "); + System.out.println("Select RMI[0] o TCP[1]: "); int networkType = scanner.nextInt(); + System.out.println("Insert server IP: "); + String IP = scanner.next(); // RMI if (networkType == 0) { // Connect - RMIClient client = new RMIClient(controller, "localhost", 1099); + String myIP; + try { + myIP = chooseNetworkInterface(scanner); + } catch (Exception e) { + throw new RuntimeException(e); + } + RMIClient client = new RMIClient(controller, IP, 1099, myIP); if (client.connect(username, proposedNumPlayers)) { System.out.println("Succesfully connected to RMI server\n\n"); } else { @@ -55,7 +89,7 @@ public class ClientLauncherTUI { // TCP } else if (networkType == 1) { // Connect - TCPClient client = new TCPClient(controller, "localhost", 8080); + TCPClient client = new TCPClient(controller, IP, 8080); if (client.connect(username, proposedNumPlayers)) { System.out.println("Succesfully connected to TCP server\n\n"); } else { @@ -101,29 +135,71 @@ public class ClientLauncherTUI { private void getInput(Scanner scanner, ClientController controller, String username) { String action = scanner.next(); int pos = -1; - if (!action.equals("7") && !action.equals("8") && !action.equals("9") && !action.equals("A") && !action.equals("B") && !action.equals("C")) { - try { - System.out.println("Insert the required position:"); - pos = scanner.nextInt(); - } catch (Exception e) { - System.out.println("ERROR: Invalid input(expected number)"); + + if(admissibleChar.contains(action)) + { + if (!action.equals("7") && !action.equals("8") && !action.equals("9") && !action.equals("A") && !action.equals("B") && !action.equals("C")&&!action.equals("a") && !action.equals("b") && !action.equals("c")) { + try { + System.out.println("Insert the required position:"); + pos = scanner.nextInt(); + } catch (Exception e) { + view.showError("ERROR: Invalid input(expected number)"); + return; + } + } + switch (action) { + case "0" -> controller.slotChoice(username, pos); + case "1" -> controller.drawUpperTribeCard(username, pos); + case "2" -> controller.drawUpperBuildingCard(username, pos); + case "3" -> controller.drawLowerTribeCard(username, pos); + case "4" -> controller.drawLowerBuildingCard(username, pos); + case "5" -> controller.pickOptionalTribeCard(username, pos); + case "6" -> controller.pickOptionalBuildingCard(username, pos); + case "7" -> controller.noOptionalCard(username); + case "8" -> controller.skipUpper(username); + case "9" -> controller.skipLower(username); + case "A", "a" -> view.fullRender(); + case "B", "b" -> view.renderBoard(); + case "C", "c" -> view.renderPlayer(); + default -> {} } } - switch (action) { - case "0" -> controller.slotChoice(username, pos); - case "1" -> controller.drawUpperBuildingCard(username, pos); - case "2" -> controller.drawUpperTribeCard(username, pos); - case "3" -> controller.drawLowerBuildingCard(username, pos); - case "4" -> controller.drawLowerTribeCard(username, pos); - case "5" -> controller.pickOptionalTribeCard(username, pos); - case "6" -> controller.pickOptionalBuildingCard(username, pos); - case "7" -> controller.noOptionalCard(username); - case "8" -> controller.skipUpper(username); - case "9" -> controller.skipLower(username); - case "A" -> view.fullRender(); - case "B" -> view.renderBoard(); - case "C" -> view.renderPlayer(); - default -> {} + else + { + view.showError("ERROR: Invalid input(action not valid)"); } } + + public static String chooseNetworkInterface(Scanner scanner) throws Exception { + List ips = new ArrayList<>(); + + // Lista tutte le interfacce attive con IP reale + Enumeration interfaces = NetworkInterface.getNetworkInterfaces(); + while (interfaces.hasMoreElements()) { + NetworkInterface ni = interfaces.nextElement(); + + // Salta loopback, interfacce spente o virtuali + if (!ni.isUp() || ni.isLoopback() || ni.isVirtual()) continue; + + Enumeration addresses = ni.getInetAddresses(); + while (addresses.hasMoreElements()) { + InetAddress addr = addresses.nextElement(); + // Solo IPv4 + if (addr instanceof Inet4Address) { + System.out.println("[" + ips.size() + "] " + ni.getDisplayName() + " -> " + addr.getHostAddress()); + ips.add(addr.getHostAddress()); + } + } + } + + if (ips.isEmpty()) throw new Exception("Nessuna interfaccia disponibile"); + if (ips.size() == 1) { + System.out.println("Una sola interfaccia trovata, uso: " + ips.get(0)); + return ips.get(0); + } + + System.out.print("Scegli interfaccia: "); + int choice = scanner.nextInt(); + return ips.get(choice); + } } \ No newline at end of file diff --git a/src/main/java/it/polimi/ingsw/gc14/Controller/ClientController.java b/src/main/java/it/polimi/ingsw/gc14/Controller/ClientController.java index 144435f..9f52437 100644 --- a/src/main/java/it/polimi/ingsw/gc14/Controller/ClientController.java +++ b/src/main/java/it/polimi/ingsw/gc14/Controller/ClientController.java @@ -1,12 +1,13 @@ package it.polimi.ingsw.gc14.Controller; import it.polimi.ingsw.gc14.Model.Game; -import it.polimi.ingsw.gc14.Model.Player; import it.polimi.ingsw.gc14.Network.IClient; import it.polimi.ingsw.gc14.Network.NetworkEvents.*; -import it.polimi.ingsw.gc14.Network.Observer; import it.polimi.ingsw.gc14.View.IView; +import java.rmi.RemoteException; +import java.util.Objects; + /** * Controller class that holds all the components of the client, such as view, network client and Game Controller. * It provides methods to set the client components and to execute requested actions. @@ -50,7 +51,7 @@ public class ClientController { */ public void setModel(Game model) { localController.setModel(model); - view.update(localController.getModel()); + view.setModel(localController.getModel()); } @@ -70,7 +71,19 @@ public class ClientController { * @param pos the index of the card to draw */ public void drawUpperTribeCard(String playerUsername, int pos) { - client.doEvent(new DrawUpperTribeCard(playerUsername,pos)); + + if(!Objects.equals(playerUsername, localController.getModel().getCurrentState().getCurrentPlayer().getUserName())) + { + view.showError("It's not your turn!"); + } + else + { + try { + client.drawUpperTribeCard(playerUsername, pos); + } catch (RemoteException e) { + throw new RuntimeException(e); + } + } } @@ -81,7 +94,14 @@ public class ClientController { * @param pos the index of the card to draw */ public void drawLowerTribeCard(String playerUsername,int pos) { - client.doEvent(new DrawLowerTribeCard(playerUsername,pos)); + if(!Objects.equals(playerUsername, localController.getModel().getCurrentState().getCurrentPlayer().getUserName())) + view.showError("It's not your turn!"); + else + try { + client.drawLowerTribeCard(playerUsername, pos); + } catch (RemoteException e) { + throw new RuntimeException(e); + } } @@ -92,7 +112,16 @@ public class ClientController { * @param pos the index of the card to draw */ public void drawUpperBuildingCard(String playerUsername,int pos) { - client.doEvent(new DrawUpperBuildingCard(playerUsername,pos)); + if(!Objects.equals(playerUsername, localController.getModel().getCurrentState().getCurrentPlayer().getUserName())) + view.showError("It's not your turn!"); + else { + try { + client.drawUpperBuildingCard(playerUsername,pos); + } catch (RemoteException e) { + throw new RuntimeException(e); + } + } + } @@ -103,7 +132,15 @@ public class ClientController { * @param pos the index of the card to draw */ public void drawLowerBuildingCard(String playerUsername,int pos) { - client.doEvent(new DrawLowerBuildingCard(playerUsername,pos)); + if(!Objects.equals(playerUsername, localController.getModel().getCurrentState().getCurrentPlayer().getUserName())) + view.showError("It's not your turn!"); + else { + try { + client.drawLowerBuildingCard(playerUsername,pos); + } catch (RemoteException e) { + throw new RuntimeException(e); + } + } } @@ -113,7 +150,15 @@ public class ClientController { * @param playerUsername the name of the player performing the action */ public void skipUpper(String playerUsername) { - client.doEvent(new SkipUpper(playerUsername)); + if(!Objects.equals(playerUsername, localController.getModel().getCurrentState().getCurrentPlayer().getUserName())) + view.showError("It's not your turn!"); + else { + try { + client.skipUpper(playerUsername); + } catch (RemoteException e) { + throw new RuntimeException(e); + } + } } @@ -122,7 +167,17 @@ public class ClientController { * This action is available only when the lower list is empty or the player cannot draw any card. * @param playerUsername the name of the player performing the action */ - public void skipLower(String playerUsername) { client.doEvent(new SkipLower(playerUsername));} + public void skipLower(String playerUsername) { + if(!Objects.equals(playerUsername, localController.getModel().getCurrentState().getCurrentPlayer().getUserName())) + view.showError("It's not your turn!"); + else { + try { + client.skipLower(playerUsername); + } catch (RemoteException e) { + throw new RuntimeException(e); + } + } + } /** @@ -132,7 +187,15 @@ public class ClientController { * @param pos the index of the card to draw */ public void pickOptionalTribeCard(String playerUsername,int pos) { - client.doEvent(new PickOptionalTribeCard(playerUsername,pos)); + if(!Objects.equals(playerUsername, localController.getModel().getCurrentState().getCurrentPlayer().getUserName())) + view.showError("It's not your turn!"); + else { + try { + client.pickOptionalTribeCard(playerUsername,pos); + } catch (RemoteException e) { + throw new RuntimeException(e); + } + } } @@ -143,7 +206,15 @@ public class ClientController { * @param pos the index of the card to draw */ public void pickOptionalBuildingCard(String playerUsername,int pos) { - client.doEvent(new PickOptionalBuildingCard(playerUsername,pos)); + if(!Objects.equals(playerUsername, localController.getModel().getCurrentState().getCurrentPlayer().getUserName())) + view.showError("It's not your turn!"); + else { + try { + client.pickOptionalBuildingCard(playerUsername,pos); + } catch (RemoteException e) { + throw new RuntimeException(e); + } + } } @@ -153,7 +224,15 @@ public class ClientController { * @param playerUsername the name of the player performing the action */ public void noOptionalCard(String playerUsername) { - client.doEvent(new NoOptionalCard(playerUsername)); + if(!Objects.equals(playerUsername, localController.getModel().getCurrentState().getCurrentPlayer().getUserName())) + view.showError("It's not your turn!"); + else { + try { + client.noOptionalCard(playerUsername); + } catch (RemoteException e) { + throw new RuntimeException(e); + } + } } @@ -163,7 +242,15 @@ public class ClientController { * @param pos the index of the selected slot */ public void slotChoice(String playerUsername,int pos) { - client.doEvent(new SlotChoice(playerUsername,pos)); + if(!Objects.equals(playerUsername, localController.getModel().getCurrentState().getCurrentPlayer().getUserName())) + view.showError("It's not your turn!"); + else { + try { + client.slotChoice(playerUsername,pos); + } catch (RemoteException e) { + throw new RuntimeException(e); + } + } } } diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/Building/Effects/Building8.java b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/Building/Effects/Building8.java index d67017d..0c4db48 100644 --- a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/Building/Effects/Building8.java +++ b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/Building/Effects/Building8.java @@ -42,7 +42,7 @@ public class Building8 extends BuildingCard { if(!player.buildingCards.contains(this)) throw new IllegalArgumentException(); for (Builder builder : player.builders) { - player.addPrestige(builder.getPrestigeValue() * 2); + player.addPrestige(builder.getPrestigeValue()); } } diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/BuildingCard.java b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/BuildingCard.java index fa997e1..9770187 100644 --- a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/BuildingCard.java +++ b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/BuildingCard.java @@ -167,8 +167,16 @@ public class BuildingCard extends PlayableCard implements Cloneable , BuildingEf * @return {@code true} if the building card is successfully bought, * {@code false} otherwise. */ + // sum reduction value builder=> sconto public boolean buy(Player player) { - if( bought || !player.removeFood(getPrice())) + int discount = 0; + discount = player.builders.stream().mapToInt(x -> x.getReductionValue()).sum(); + + if(discount > this.price){ + discount = this.price; + } + + if(bought || !player.removeFood(this.price - discount)) return false; player.buildingCards.add(this); bought=true; diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Events/CavePaintings.java b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Events/CavePaintings.java index 2e18de0..6971681 100644 --- a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Events/CavePaintings.java +++ b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Events/CavePaintings.java @@ -91,7 +91,6 @@ public class CavePaintings extends EventCard { return new CavePaintings(getEra(), NLower, NPrestigeRem, NPrestigeMul) ; } - /** * Prints a string representation of this {@code TribeCard}. This specific variation is used in the {@code Game}'s * toString to print a more detailed version. @@ -111,6 +110,6 @@ public class CavePaintings extends EventCard { */ @Override public String toStringBoard() { - return super.toString()+" 0-"+(NLower-1)+":"+NPrestigeRem+" "+NLower+"+:"+NPrestigeMul; + return super.toStringBoard()+" 0-"+(NLower-1)+":"+NPrestigeRem+" "+NLower+"+:"+NPrestigeMul; } } diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Events/Hunt.java b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Events/Hunt.java index 4bf1e52..80870d2 100644 --- a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Events/Hunt.java +++ b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Events/Hunt.java @@ -84,7 +84,7 @@ public class Hunt extends EventCard { */ @Override public String toStringBoard() { - return super.toString()+" 1F+"+prestigeMultiplier+"PP"+" X N Hunter"; + return super.toStringBoard()+" 1F+"+prestigeMultiplier+"PP"+" X N Hunter"; } } diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Events/ShamanicRitual.java b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Events/ShamanicRitual.java index 70703d5..1a65f10 100644 --- a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Events/ShamanicRitual.java +++ b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Events/ShamanicRitual.java @@ -111,7 +111,7 @@ public class ShamanicRitual extends EventCard { */ @Override public String toStringBoard() { - return super.toString()+" *>:"+prestigeToAdd+" *<:"+prestigeToRemove; + return super.toStringBoard()+" *>:"+prestigeToAdd+" *<:"+prestigeToRemove; } } diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Events/Sustenance.java b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Events/Sustenance.java index 8826d3d..ac53288 100644 --- a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Events/Sustenance.java +++ b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Events/Sustenance.java @@ -48,7 +48,7 @@ public class Sustenance extends EventCard { * If the resulting Food debt is positive, the player must pay it with available Food. * If the player does not have enough Food, all remaining Food is removed and the player * loses Prestige equal to the unpaid Food debt multiplied by {@code PrestigeDebt}. - * This event is intended to be executed last among event effects. + * This event is intended to be executed last among event effects. * * @param playerList the list of players affected by the event. * @throws NullPointerException if {@code playerList} or one of its required elements is {@code null}. @@ -108,6 +108,6 @@ public class Sustenance extends EventCard { */ @Override public String toStringBoard() { - return super.toString()+" -1F/-"+PrestigeDebt+"PP"; + return super.toStringBoard()+" -1F/-"+PrestigeDebt+"PP"; } } diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Game.java b/src/main/java/it/polimi/ingsw/gc14/Model/Game.java index db8fc1a..500a4a5 100644 --- a/src/main/java/it/polimi/ingsw/gc14/Model/Game.java +++ b/src/main/java/it/polimi/ingsw/gc14/Model/Game.java @@ -4,6 +4,9 @@ import it.polimi.ingsw.gc14.Model.Cards.Building.EffectType; import it.polimi.ingsw.gc14.Model.Cards.BuildingCard; import it.polimi.ingsw.gc14.Model.Cards.TribeCard; import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Character; +import it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType; +import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Characters.Builder; +import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Characters.Inventor; import it.polimi.ingsw.gc14.Model.Cards.TribeCards.EventCard; import it.polimi.ingsw.gc14.Model.Cards.TribeCards.EventType; import it.polimi.ingsw.gc14.Model.GamePackage.Board; @@ -17,7 +20,8 @@ import it.polimi.ingsw.gc14.Model.GamePackage.GameStages; import java.io.Serializable; import java.util.*; import java.util.stream.Collectors; -import it.polimi.ingsw.gc14.Network.Observer; +import java.util.stream.Stream; + import it.polimi.ingsw.gc14.View.TUI.AsciiTable; import it.polimi.ingsw.gc14.View.TUI.BorderStyle; @@ -28,26 +32,6 @@ import it.polimi.ingsw.gc14.View.TUI.BorderStyle; */ public class Game implements Serializable { - /** - * List of observers registered to receive updates when the game state changes. - * - *

The list is marked as {@code transient} because observers should not be - * serialized with the game model. - */ - private transient List observers = new ArrayList<>(); // transient! non serializzare - - - public void addObserver(Observer observer) { - observers.add(observer); - } - - - private void notifyObservers() { - for (Observer o : observers) { - o.update(this); - } - } - /** * Returns the list of players participating in the game. * @@ -250,6 +234,16 @@ public class Game implements Serializable { orderLogicCard=new Order5(playersList); break; } + for(Player player : playersList) + { + switch(orderLogicCard.getPosition(player.getUserName())) + { + case 0: player.addFood(2); break; + case 1,2: player.addFood(3); break; + case 3,4: player.addFood(4); break; + } + + } currentState.PlayerUpdate(orderLogicCard.pull(),null); currentState.GameStageUpdate(GameStages.SLOT_CHOICE); } @@ -282,6 +276,10 @@ public class Game implements Serializable { { return false; } + if(slotPlayerEntry.getKey().getSlotId()=='A') + { + player.addFood(3); + } slotMap.put(slotPlayerEntry.getKey(),player); nextPlayerSetup(); return true; @@ -306,7 +304,7 @@ public class Game implements Serializable { public boolean DrawUpperTribeCardByIndex(Player player,int cardIndex) { if( cardIndex<0 || cardIndex >=board.upperListTribe.size()) return false; - if(currentState.getGameStage()!= GameStages.RESOLVING_ACTIONS) + if(currentState.getGameStage()!= GameStages.RES_ACTIONS) { return false; } @@ -342,7 +340,7 @@ public class Game implements Serializable { * @return {@code true} if the skip succeeds, {@code false} otherwise. */ public boolean SkipUpperDrawing(Player player) { - if(currentState.getGameStage()!= GameStages.RESOLVING_ACTIONS) + if(currentState.getGameStage()!= GameStages.RES_ACTIONS) { return false; } @@ -373,7 +371,7 @@ public class Game implements Serializable { * @return {@code true} if the skip succeeds, {@code false} otherwise. */ public boolean SkipLowerDrawing(Player player) { - if(currentState.getGameStage()!= GameStages.RESOLVING_ACTIONS) + if(currentState.getGameStage()!= GameStages.RES_ACTIONS) { return false; } @@ -407,7 +405,7 @@ public class Game implements Serializable { public boolean DrawLowerTribeCardByIndex(Player player, int cardIndex) { if( cardIndex<0 || cardIndex >=board.lowerListTribe.size()) return false; - if(currentState.getGameStage()!= GameStages.RESOLVING_ACTIONS) + if(currentState.getGameStage()!= GameStages.RES_ACTIONS) { return false; } @@ -448,7 +446,7 @@ public class Game implements Serializable { public boolean DrawUpperBuildingCardByIndex(Player player,int cardIndex) { if( cardIndex<0 || cardIndex >=board.upperListBuilding.size()) return false; - if(currentState.getGameStage()!= GameStages.RESOLVING_ACTIONS) + if(currentState.getGameStage()!= GameStages.RES_ACTIONS) { return false; } @@ -487,7 +485,7 @@ public class Game implements Serializable { public boolean DrawLowerBuildingCardByIndex(Player player,int cardIndex) { if( cardIndex<0 || cardIndex >=board.lowerListBuilding.size()) return false; - if(currentState.getGameStage()!= GameStages.RESOLVING_ACTIONS) + if(currentState.getGameStage()!= GameStages.RES_ACTIONS) { return false; } @@ -532,7 +530,7 @@ public class Game implements Serializable { * @return {@code true} if the operation succeeds, {@code false} otherwise. */ public boolean PickOptionalTribeCardByIndex(Player player,int cardIndex) { - if(currentState.getGameStage() != GameStages.OPTIONAL_CARD_EFFECT){ + if(currentState.getGameStage() != GameStages.OPT_CARD_E){ return false; } if(!player.equals(currentState.getCurrentPlayer())){ @@ -567,7 +565,7 @@ public class Game implements Serializable { * @return {@code true} if the operation succeeds, {@code false} otherwise. */ public boolean PickOptionalBuildingCard(Player player, int cardIndex) { - if(currentState.getGameStage() != GameStages.OPTIONAL_CARD_EFFECT){ + if(currentState.getGameStage() != GameStages.OPT_CARD_E){ return false; } if(!player.equals(currentState.getCurrentPlayer())){ @@ -599,7 +597,7 @@ public class Game implements Serializable { * @return {@code true} if the operation succeeds, {@code false} otherwise. */ public boolean NoOptionalCard(Player player) { - if(currentState.getGameStage() != GameStages.OPTIONAL_CARD_EFFECT){ + if(currentState.getGameStage() != GameStages.OPT_CARD_E){ return false; } if(!player.equals(currentState.getCurrentPlayer())){ @@ -638,7 +636,7 @@ public class Game implements Serializable { currentState.PlayerUpdate(tempPlayer, null); return; } - currentState.GameStageUpdate(GameStages.RESOLVING_ACTIONS); + currentState.GameStageUpdate(GameStages.RES_ACTIONS); for (Slot s : slotMap.keySet()) { if (slotMap.get(s) != null) { currentState.PlayerUpdate(slotMap.get(s), s); @@ -654,7 +652,7 @@ public class Game implements Serializable { return; } - if(GameStages.RESOLVING_ACTIONS==currentState.getGameStage()) { + if(GameStages.RES_ACTIONS ==currentState.getGameStage()) { orderLogicCard.push(currentState.getCurrentPlayer()); slotMap.put(currentState.getSlot(), null); for (Slot s : slotMap.keySet()) { @@ -673,9 +671,9 @@ public class Game implements Serializable { } if(slotMap.values().stream().allMatch(v -> v == null)) { - currentState.GameStageUpdate(GameStages.OPTIONAL_CARD_EFFECT); + currentState.GameStageUpdate(GameStages.OPT_CARD_E); HashMap optional=new LinkedHashMap<>(); - for (Player p : playersList) { + for (Player p : orderLogicCard.players) { int tempCount=(int)p.buildingCards.stream().filter(x->x.getEffectId()==12).count(); if(tempCount>0) { @@ -694,14 +692,13 @@ public class Game implements Serializable { return; } - currentState.GameStageUpdate(GameStages.RESOLVING_EVENT); + currentState.GameStageUpdate(GameStages.RES_EVENT); if (currentState.getRound() < 10) { nextRound(); currentState.PlayerUpdate(orderLogicCard.pull(), null); currentState.GameStageUpdate(GameStages.SLOT_CHOICE); } else { - EventResolution(); currentState.GameStageUpdate(GameStages.ENDING); endGame(); } @@ -710,7 +707,7 @@ public class Game implements Serializable { } } - if (GameStages.OPTIONAL_CARD_EFFECT == currentState.getGameStage()) { + if (GameStages.OPT_CARD_E == currentState.getGameStage()) { Player optionalPlayer = OptionalCardQueue.poll(); if (optionalPlayer != null) { @@ -718,14 +715,13 @@ public class Game implements Serializable { return; } - currentState.GameStageUpdate(GameStages.RESOLVING_EVENT); + currentState.GameStageUpdate(GameStages.RES_EVENT); if (currentState.getRound() < 10) { nextRound(); currentState.PlayerUpdate(orderLogicCard.pull(), null); currentState.GameStageUpdate(GameStages.SLOT_CHOICE); } else { - EventResolution(); currentState.GameStageUpdate(GameStages.ENDING); endGame(); } @@ -768,7 +764,7 @@ public class Game implements Serializable { */ private void EventResolution() { - if(currentState.getGameStage()!= GameStages.RESOLVING_EVENT) + if(currentState.getGameStage()!= GameStages.RES_EVENT) { return; } @@ -818,6 +814,28 @@ public class Game implements Serializable { * and updating the game stage to {@code ENDED}. */ private void endGame() { + Queue events; + events=Stream.concat(board.lowerListTribe.stream().filter(TribeCard::IsEventCard),board.upperListTribe.stream().filter(TribeCard::IsEventCard)).map(x->((EventCard)x)).collect(Collectors.toCollection(LinkedList::new)); + ArrayListsustenance=events.stream().filter(x->x.getType().equals(EventType.SUSTENANCE)).collect(Collectors.toCollection(ArrayList::new)); + events.removeAll(sustenance); + events.forEach(event->event.activateEvent(playersList)); + sustenance.forEach(event->event.activateEvent(playersList)); + + playersList.forEach(p->{ + int temp= p.builders.stream().mapToInt(Builder::getPrestigeValue).sum(); + p.addPrestige(temp); + }); + playersList.forEach(p->{ + int temp=(int) p.inventors.stream().mapToInt(Inventor::Icon).distinct().count(); + p.addPrestige(temp*p.getNType(CharacterType.INVENTOR)); + }); + playersList.forEach(p->{ + p.addPrestige(10 * (p.getNType(CharacterType.ARTIST)/2)); + }); + playersList.forEach(p->{ + int temp= p.buildingCards.stream().mapToInt(BuildingCard::getPrestigeValue).sum(); + p.addPrestige(temp); + }); playersList.forEach( p -> p.buildingCards.stream().filter(x -> x.getEffectType() == EffectType.FINAL). forEach(x -> x.applyEffect(p)) diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/GamePackage/Board.java b/src/main/java/it/polimi/ingsw/gc14/Model/GamePackage/Board.java index afec513..473062e 100644 --- a/src/main/java/it/polimi/ingsw/gc14/Model/GamePackage/Board.java +++ b/src/main/java/it/polimi/ingsw/gc14/Model/GamePackage/Board.java @@ -41,6 +41,8 @@ public class Board implements Serializable { /** Contains all the building cards of the upper list. When a new era starts, the old era's buildings are moved from the upper to the lower list */ public List lowerListBuilding; + + private final ArrayList> buildingCardsAllEras; /** Number of players */ private int nTotem; @@ -88,6 +90,7 @@ public class Board implements Serializable { tribeDeck=generateTribeDeck(nTotem); era=1; + for(int i=0;i buildingDeck = new ArrayList<>(DecksCreator.loadBuildingDeckByEra(1)); Collections.shuffle(buildingDeck); + buildingCardsAllEras= new ArrayList<>(); + buildingCardsAllEras.add(new ArrayList<>()); + buildingCardsAllEras.add(new ArrayList<>()); + buildingCardsAllEras.add(new ArrayList<>()); if(nTotem==2) + { + buildingCardsAllEras.set(0, new ArrayList<>(buildingDeck.subList(0, 1))); upperListBuilding = new ArrayList<>(buildingDeck.subList(0,1)); + } else + { + buildingCardsAllEras.set(0, new ArrayList<>(buildingDeck.subList(0, 2))); upperListBuilding = new ArrayList<>(buildingDeck.subList(0,2)); + } + + buildingDeck=new ArrayList<>(DecksCreator.loadBuildingDeckByEra(2)); + Collections.shuffle(buildingDeck); + if(nTotem<=3) + { + buildingCardsAllEras.set(1, new ArrayList(buildingDeck.subList(0, 2))); + } + else + { + buildingCardsAllEras.set(1, new ArrayList(buildingDeck.subList(0, 3))); + } + buildingDeck=new ArrayList<>(DecksCreator.loadBuildingDeckByEra(3)); + Collections.shuffle(buildingDeck); + if(nTotem==2) + { + buildingCardsAllEras.set(2, new ArrayList(buildingDeck.subList(0, 3))); + }else if(nTotem==5) + { + buildingCardsAllEras.set(2, new ArrayList(buildingDeck.subList(0, 5))); + } + else { + buildingCardsAllEras.set(2, new ArrayList(buildingDeck.subList(0, 4))); + } + } /** @@ -231,27 +268,11 @@ public class Board implements Serializable { Collections.shuffle(buildingCards); if(era==2) { - if(nTotem<=3) - { - upperListBuilding.addAll(buildingCards.subList(0,2)); - } - else - { - upperListBuilding.addAll( buildingCards.subList(0,3)); - } + upperListBuilding.addAll(buildingCardsAllEras.get(1)); } - else // Era 3 + else { - if(nTotem==2) - { - upperListBuilding.addAll( buildingCards.subList(0,3)); - }else if(nTotem==5) - { - upperListBuilding.addAll( buildingCards.subList(0,5)); - } - else { - upperListBuilding.addAll(buildingCards.subList(0,4)); - } + upperListBuilding.addAll(buildingCardsAllEras.get(2)); } } } diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/GamePackage/GameStages.java b/src/main/java/it/polimi/ingsw/gc14/Model/GamePackage/GameStages.java index e272fbd..00b4376 100644 --- a/src/main/java/it/polimi/ingsw/gc14/Model/GamePackage/GameStages.java +++ b/src/main/java/it/polimi/ingsw/gc14/Model/GamePackage/GameStages.java @@ -6,5 +6,5 @@ package it.polimi.ingsw.gc14.Model.GamePackage; * Represents the possible stages of a game. */ public enum GameStages { - WAITING, SLOT_CHOICE, RESOLVING_ACTIONS, OPTIONAL_CARD_EFFECT, RESOLVING_EVENT, ENDING, ENDED + WAITING, SLOT_CHOICE, RES_ACTIONS, OPT_CARD_E, RES_EVENT, ENDING, ENDED } diff --git a/src/main/java/it/polimi/ingsw/gc14/Network/IClient.java b/src/main/java/it/polimi/ingsw/gc14/Network/IClient.java index 86f6435..a38a329 100644 --- a/src/main/java/it/polimi/ingsw/gc14/Network/IClient.java +++ b/src/main/java/it/polimi/ingsw/gc14/Network/IClient.java @@ -1,8 +1,33 @@ package it.polimi.ingsw.gc14.Network; +import it.polimi.ingsw.gc14.Network.NetworkEvents.*; + import java.rmi.RemoteException; +import java.util.Objects; public interface IClient { public boolean connect(String username,int preferredInt); - public void doEvent(NetworkEvent event) ; + + public void drawUpperTribeCard(String playerUsername, int pos) throws RemoteException; + + public void drawLowerTribeCard(String playerUsername,int pos) throws RemoteException; + + public void drawUpperBuildingCard(String playerUsername,int pos) throws RemoteException; + + + public void drawLowerBuildingCard(String playerUsername,int pos) throws RemoteException; + + public void skipUpper(String playerUsername) throws RemoteException; + + public void skipLower(String playerUsername) throws RemoteException; + + + public void pickOptionalTribeCard(String playerUsername,int pos) throws RemoteException; + + public void pickOptionalBuildingCard(String playerUsername,int pos) throws RemoteException; + + + public void noOptionalCard(String playerUsername) throws RemoteException; + + public void slotChoice(String playerUsername,int pos) throws RemoteException; } diff --git a/src/main/java/it/polimi/ingsw/gc14/Network/Observer.java b/src/main/java/it/polimi/ingsw/gc14/Network/Observer.java deleted file mode 100644 index 7677d92..0000000 --- a/src/main/java/it/polimi/ingsw/gc14/Network/Observer.java +++ /dev/null @@ -1,7 +0,0 @@ -package it.polimi.ingsw.gc14.Network; - -import it.polimi.ingsw.gc14.Model.Game; - -public interface Observer { - public void update(Game model); -} diff --git a/src/main/java/it/polimi/ingsw/gc14/Network/RMI/Client/ClientCallbackImpl.java b/src/main/java/it/polimi/ingsw/gc14/Network/RMI/Client/ClientCallbackImpl.java index beb9c91..817e3d3 100644 --- a/src/main/java/it/polimi/ingsw/gc14/Network/RMI/Client/ClientCallbackImpl.java +++ b/src/main/java/it/polimi/ingsw/gc14/Network/RMI/Client/ClientCallbackImpl.java @@ -53,7 +53,7 @@ public class ClientCallbackImpl extends UnicastRemoteObject implements IClientCa @Override public void onAction(NetworkEvent event) throws RemoteException { if(event.getIsError()) { - System.out.println(event.toString()); + clientController.view.showError(event.toString()); } else { event.apply(clientController.localController); clientController.view.render(); diff --git a/src/main/java/it/polimi/ingsw/gc14/Network/RMI/Client/RMIClient.java b/src/main/java/it/polimi/ingsw/gc14/Network/RMI/Client/RMIClient.java index be92164..141e01e 100644 --- a/src/main/java/it/polimi/ingsw/gc14/Network/RMI/Client/RMIClient.java +++ b/src/main/java/it/polimi/ingsw/gc14/Network/RMI/Client/RMIClient.java @@ -1,11 +1,14 @@ package it.polimi.ingsw.gc14.Network.RMI.Client; +import java.net.InetAddress; import java.rmi.RemoteException; import java.rmi.registry.LocateRegistry; import java.rmi.registry.Registry; +import java.util.Objects; import it.polimi.ingsw.gc14.Controller.ClientController; import it.polimi.ingsw.gc14.Network.IClient; import it.polimi.ingsw.gc14.Network.NetworkEvent; +import it.polimi.ingsw.gc14.Network.NetworkEvents.*; import it.polimi.ingsw.gc14.Network.RMI.Common.IClientCallback; import it.polimi.ingsw.gc14.Network.RMI.Common.IGameServer; import it.polimi.ingsw.gc14.Network.RMI.Server.RMIServer; @@ -27,6 +30,7 @@ public class RMIClient implements IClient { /** Client game's controller */ ClientController controller; + private String myIP; /** * Class constructor. @@ -34,10 +38,11 @@ public class RMIClient implements IClient { * @param host the host address of the RMI server * @param port the port of the RMI server */ - public RMIClient(ClientController controller, String host, int port) { + public RMIClient(ClientController controller, String host, int port, String myIP) { this.controller=controller; this.host = host; this.port = port; + this.myIP = myIP; } @@ -51,6 +56,7 @@ public class RMIClient implements IClient { */ public boolean connect(String username,int preferredInt) { try { + System.setProperty("java.rmi.server.hostname", this.myIP); Registry registry = LocateRegistry.getRegistry(host, port); this.stub = (IGameServer) registry.lookup("RMIGameServer"); ClientCallbackImpl callback = new ClientCallbackImpl(controller); @@ -64,17 +70,111 @@ public class RMIClient implements IClient { } - /** - * Sends a {@link NetworkEvent} to the server. - * @param event the event to send - * @throws RemoteException if any RMI error occurs - */ - public void doEvent(NetworkEvent event) { - try { - stub.doEvent(event); - }catch (Exception e) { - } + /** + * Requests to draw a tribe card from the upper list. + * Creates a NetworkEvent and sends it through the network client. + * @param playerUsername the name of the player performing the action + * @param pos the index of the card to draw + */ + public void drawUpperTribeCard(String playerUsername, int pos) throws RemoteException { + stub.drawUpperTribeCard(playerUsername,pos); } + + /** + * Requests to draw a tribe card from the lower list. + * Creates a NetworkEvent and sends it through the network client. + * @param playerUsername the name of the player performing the action + * @param pos the index of the card to draw + */ + public void drawLowerTribeCard(String playerUsername,int pos) throws RemoteException { + stub.drawLowerTribeCard(playerUsername,pos); + } + + + /** + * Requests to draw a building card from the upper list. + * Creates a NetworkEvent and sends it through the network client. + * @param playerUsername the name of the player performing the action + * @param pos the index of the card to draw + */ + public void drawUpperBuildingCard(String playerUsername,int pos) throws RemoteException { + stub.drawUpperBuildingCard(playerUsername,pos); + } + + + /** + * Requests to draw a building card from the lower list. + * Creates a NetworkEvent and sends it through the network client. + * @param playerUsername the name of the player performing the action + * @param pos the index of the card to draw + */ + public void drawLowerBuildingCard(String playerUsername,int pos) throws RemoteException { + stub.drawLowerBuildingCard(playerUsername,pos); + } + + + /** + * Requests to skip drawing from the upper list. + * This action is available only when the upper list is empty or the player cannot draw any card. + * @param playerUsername the name of the player performing the action + */ + public void skipUpper(String playerUsername) throws RemoteException { + stub.skipUpper(playerUsername); + } + + + /** + * Requests to skip drawing from the lower list. + * This action is available only when the lower list is empty or the player cannot draw any card. + * @param playerUsername the name of the player performing the action + */ + public void skipLower(String playerUsername) throws RemoteException { + stub.skipLower(playerUsername); + } + + + /** + * Used to draw a tribe card from the upper list. + * Available only if the player owns the building 12. + * @param playerUsername the name of the player performing the action + * @param pos the index of the card to draw + */ + public void pickOptionalTribeCard(String playerUsername,int pos) throws RemoteException { + stub.pickOptionalTribeCard(playerUsername,pos); + } + + + /** + * Used to draw a building card from the upper list. + * Available only if the player owns the building 12. + * @param playerUsername the name of the player performing the action + * @param pos the index of the card to draw + */ + public void pickOptionalBuildingCard(String playerUsername,int pos) throws RemoteException { + stub.pickOptionalBuildingCard(playerUsername,pos); + } + + + /** + * Used to skip the action of drawing a card from the upper list. + * Available only if the player owns the building 12. + * @param playerUsername the name of the player performing the action + */ + public void noOptionalCard(String playerUsername) throws RemoteException { + stub.noOptionalCard(playerUsername); + } + + + /** + * Used to perform the slot choice action for the specified player at the specified position. + * @param playerUsername the name of the player performing the action + * @param pos the index of the selected slot + */ + public void slotChoice(String playerUsername,int pos) throws RemoteException { + stub.slotChoice(playerUsername,pos); + } + + } \ No newline at end of file diff --git a/src/main/java/it/polimi/ingsw/gc14/Network/RMI/Common/IGameServer.java b/src/main/java/it/polimi/ingsw/gc14/Network/RMI/Common/IGameServer.java index 24fcdce..225bdff 100644 --- a/src/main/java/it/polimi/ingsw/gc14/Network/RMI/Common/IGameServer.java +++ b/src/main/java/it/polimi/ingsw/gc14/Network/RMI/Common/IGameServer.java @@ -30,5 +30,27 @@ public interface IGameServer extends Remote { * @throws RemoteException if an RMI communication error occurs. */ boolean doEvent(NetworkEvent event) throws RemoteException; + void drawUpperTribeCard(String playerUsername, int pos) throws RemoteException; + + void drawLowerTribeCard(String playerUsername,int pos) throws RemoteException; + + void drawUpperBuildingCard(String playerUsername,int pos) throws RemoteException; + + + void drawLowerBuildingCard(String playerUsername,int pos) throws RemoteException; + + void skipUpper(String playerUsername) throws RemoteException; + + void skipLower(String playerUsername) throws RemoteException; + + + void pickOptionalTribeCard(String playerUsername,int pos) throws RemoteException; + + void pickOptionalBuildingCard(String playerUsername,int pos) throws RemoteException; + + + void noOptionalCard(String playerUsername) throws RemoteException; + + void slotChoice(String playerUsername,int pos) throws RemoteException; } diff --git a/src/main/java/it/polimi/ingsw/gc14/Network/RMI/Server/RMIServer.java b/src/main/java/it/polimi/ingsw/gc14/Network/RMI/Server/RMIServer.java index 6fadf03..fdcc868 100644 --- a/src/main/java/it/polimi/ingsw/gc14/Network/RMI/Server/RMIServer.java +++ b/src/main/java/it/polimi/ingsw/gc14/Network/RMI/Server/RMIServer.java @@ -4,14 +4,18 @@ import it.polimi.ingsw.gc14.Controller.GameController; import it.polimi.ingsw.gc14.LimitedList; import it.polimi.ingsw.gc14.Model.Game; import it.polimi.ingsw.gc14.Network.NetworkEvent; +import it.polimi.ingsw.gc14.Network.NetworkEvents.*; import it.polimi.ingsw.gc14.Network.RMI.Common.IClientCallback; import it.polimi.ingsw.gc14.Network.RMI.Common.IGameServer; +import java.net.InetAddress; import java.rmi.RemoteException; import java.rmi.registry.LocateRegistry; import java.rmi.registry.Registry; import java.rmi.server.UnicastRemoteObject; import java.util.Map; +import java.util.Objects; +import java.util.Properties; import java.util.concurrent.BlockingQueue; import java.util.concurrent.ConcurrentHashMap; @@ -22,7 +26,7 @@ import java.rmi.*; * Server RMI. Exposes a method to join the game and one to execute an event. */ public class RMIServer extends UnicastRemoteObject implements IGameServer { - + private String host; /** Server game's controller */ private GameController controller; @@ -56,11 +60,12 @@ public class RMIServer extends UnicastRemoteObject implements IGameServer { * @param playerList The player's usernames list * @throws RemoteException if an RMI error occurs */ - public RMIServer(GameController controller, int nPort, BlockingQueue actionQueue,LimitedList playerList) throws RemoteException { + public RMIServer(GameController controller, int nPort, BlockingQueue actionQueue,LimitedList playerList,String host) throws RemoteException { this.controller = controller; this.nPort = nPort; this.actionQueue = actionQueue; this.playerList = playerList; + this.host = host; } @@ -76,7 +81,6 @@ public class RMIServer extends UnicastRemoteObject implements IGameServer { * @param callback The client's callback interface * @return true if the player successfully joined the game, false otherwise */ - @Override public boolean joinGame(String username, int preferredInt, IClientCallback callback) { if (preferredInt<2 || preferredInt>5) { return false; @@ -90,6 +94,7 @@ public class RMIServer extends UnicastRemoteObject implements IGameServer { if (controller.addPlayer(username)) { clients.put(username, callback); playerList.add(username); + System.out.println("Accepted player: " + username); return true; } return false; @@ -103,11 +108,114 @@ public class RMIServer extends UnicastRemoteObject implements IGameServer { * @param action The desired actio * @return true if the action was successfully added, false otherwise */ - @Override public boolean doEvent(NetworkEvent action) { return actionQueue.offer(action); } + /** + * Requests to draw a tribe card from the upper list. + * Creates a NetworkEvent and sends it through the network client. + * @param playerUsername the name of the player performing the action + * @param pos the index of the card to draw + */ + public void drawUpperTribeCard(String playerUsername, int pos) { + actionQueue.offer(new DrawUpperTribeCard(playerUsername,pos)); + } + + + /** + * Requests to draw a tribe card from the lower list. + * Creates a NetworkEvent and sends it through the network client. + * @param playerUsername the name of the player performing the action + * @param pos the index of the card to draw + */ + public void drawLowerTribeCard(String playerUsername,int pos) { + actionQueue.offer(new DrawLowerTribeCard(playerUsername,pos)); + } + + + /** + * Requests to draw a building card from the upper list. + * Creates a NetworkEvent and sends it through the network client. + * @param playerUsername the name of the player performing the action + * @param pos the index of the card to draw + */ + public void drawUpperBuildingCard(String playerUsername,int pos) { + actionQueue.offer(new DrawUpperBuildingCard(playerUsername,pos)); + } + + + /** + * Requests to draw a building card from the lower list. + * Creates a NetworkEvent and sends it through the network client. + * @param playerUsername the name of the player performing the action + * @param pos the index of the card to draw + */ + public void drawLowerBuildingCard(String playerUsername,int pos) { + actionQueue.offer(new DrawLowerBuildingCard(playerUsername,pos)); + } + + + /** + * Requests to skip drawing from the upper list. + * This action is available only when the upper list is empty or the player cannot draw any card. + * @param playerUsername the name of the player performing the action + */ + public void skipUpper(String playerUsername) { + actionQueue.offer(new SkipUpper(playerUsername)); + } + + + /** + * Requests to skip drawing from the lower list. + * This action is available only when the lower list is empty or the player cannot draw any card. + * @param playerUsername the name of the player performing the action + */ + public void skipLower(String playerUsername) { + actionQueue.offer(new SkipLower(playerUsername)); + } + + + /** + * Used to draw a tribe card from the upper list. + * Available only if the player owns the building 12. + * @param playerUsername the name of the player performing the action + * @param pos the index of the card to draw + */ + public void pickOptionalTribeCard(String playerUsername,int pos) { + actionQueue.offer(new PickOptionalTribeCard(playerUsername,pos)); + } + + + /** + * Used to draw a building card from the upper list. + * Available only if the player owns the building 12. + * @param playerUsername the name of the player performing the action + * @param pos the index of the card to draw + */ + public void pickOptionalBuildingCard(String playerUsername,int pos) { + actionQueue.offer(new PickOptionalBuildingCard(playerUsername,pos)); + } + + + /** + * Used to skip the action of drawing a card from the upper list. + * Available only if the player owns the building 12. + * @param playerUsername the name of the player performing the action + */ + public void noOptionalCard(String playerUsername) { + actionQueue.offer(new NoOptionalCard(playerUsername)); + } + + + /** + * Used to perform the slot choice action for the specified player at the specified position. + * @param playerUsername the name of the player performing the action + * @param pos the index of the selected slot + */ + public void slotChoice(String playerUsername,int pos) { + actionQueue.offer(new SlotChoice(playerUsername,pos)); + } // RMI's internal methods @@ -116,8 +224,9 @@ public class RMIServer extends UnicastRemoteObject implements IGameServer { * @param action The desired action */ public void notifyAll(NetworkEvent action) throws RemoteException { - for (IClientCallback cb : clients.values()) { - cb.onAction(action); + for (Map.Entry entry : clients.entrySet()) { + if(!action.getIsError() ||(action.getIsError()&& action.getUsername().equals(entry.getKey()))) + entry.getValue().onAction(action); } } @@ -141,6 +250,7 @@ public class RMIServer extends UnicastRemoteObject implements IGameServer { */ public boolean start() { try { + System.setProperty("java.rmi.server.hostname", host); // o il tuo IP/hostname registry = LocateRegistry.createRegistry(nPort); registry.rebind("RMIGameServer", this); System.out.println("RMI Server started on port: "+nPort); diff --git a/src/main/java/it/polimi/ingsw/gc14/Network/TCP/Client/TCPClient.java b/src/main/java/it/polimi/ingsw/gc14/Network/TCP/Client/TCPClient.java index 3408e99..e9ef147 100644 --- a/src/main/java/it/polimi/ingsw/gc14/Network/TCP/Client/TCPClient.java +++ b/src/main/java/it/polimi/ingsw/gc14/Network/TCP/Client/TCPClient.java @@ -4,7 +4,7 @@ import it.polimi.ingsw.gc14.Controller.ClientController; import it.polimi.ingsw.gc14.Model.Game; import it.polimi.ingsw.gc14.Network.IClient; import it.polimi.ingsw.gc14.Network.NetworkEvent; -import it.polimi.ingsw.gc14.Network.NetworkEvents.AddPlayer; +import it.polimi.ingsw.gc14.Network.NetworkEvents.*; import java.io.*; import java.net.*; @@ -87,10 +87,17 @@ public class TCPClient implements IClient { private void receiveMessage() { while (true) { try { - Object read = socketReceive.readObject(); + Object read; + try { + read = socketReceive.readObject(); + } catch (IOException e) { + e.printStackTrace(); + break; + } + if (read instanceof NetworkEvent event) { //TODO: avoid instanceof if (event.getIsError()) { - System.out.println(event); + controller.view.showError(event.toString()); } else { event.apply(controller.localController); controller.view.render(); @@ -99,20 +106,124 @@ public class TCPClient implements IClient { controller.setModel(model); controller.view.render(); } - } catch (IOException e) { - e.printStackTrace(); } catch (ClassNotFoundException e) { - throw new RuntimeException(e); + e.printStackTrace(); + break; } } } + /** + * Requests to draw a tribe card from the upper list. + * Creates a NetworkEvent and sends it through the network client. + * @param playerUsername the name of the player performing the action + * @param pos the index of the card to draw + */ + public void drawUpperTribeCard(String playerUsername, int pos) { + doEvent(new DrawUpperTribeCard(playerUsername,pos)); + } + + + /** + * Requests to draw a tribe card from the lower list. + * Creates a NetworkEvent and sends it through the network client. + * @param playerUsername the name of the player performing the action + * @param pos the index of the card to draw + */ + public void drawLowerTribeCard(String playerUsername,int pos) { + doEvent(new DrawLowerTribeCard(playerUsername,pos)); + } + + + /** + * Requests to draw a building card from the upper list. + * Creates a NetworkEvent and sends it through the network client. + * @param playerUsername the name of the player performing the action + * @param pos the index of the card to draw + */ + public void drawUpperBuildingCard(String playerUsername,int pos) { + doEvent(new DrawUpperBuildingCard(playerUsername,pos)); + + } + + + /** + * Requests to draw a building card from the lower list. + * Creates a NetworkEvent and sends it through the network client. + * @param playerUsername the name of the player performing the action + * @param pos the index of the card to draw + */ + public void drawLowerBuildingCard(String playerUsername,int pos) { + doEvent(new DrawLowerBuildingCard(playerUsername,pos)); + } + + + /** + * Requests to skip drawing from the upper list. + * This action is available only when the upper list is empty or the player cannot draw any card. + * @param playerUsername the name of the player performing the action + */ + public void skipUpper(String playerUsername) { + doEvent(new SkipUpper(playerUsername)); + } + + + /** + * Requests to skip drawing from the lower list. + * This action is available only when the lower list is empty or the player cannot draw any card. + * @param playerUsername the name of the player performing the action + */ + public void skipLower(String playerUsername) { + doEvent(new SkipLower(playerUsername)); + } + + + /** + * Used to draw a tribe card from the upper list. + * Available only if the player owns the building 12. + * @param playerUsername the name of the player performing the action + * @param pos the index of the card to draw + */ + public void pickOptionalTribeCard(String playerUsername,int pos) { + doEvent(new PickOptionalTribeCard(playerUsername,pos)); + } + + + /** + * Used to draw a building card from the upper list. + * Available only if the player owns the building 12. + * @param playerUsername the name of the player performing the action + * @param pos the index of the card to draw + */ + public void pickOptionalBuildingCard(String playerUsername,int pos) { + doEvent(new PickOptionalBuildingCard(playerUsername,pos)); + } + + + /** + * Used to skip the action of drawing a card from the upper list. + * Available only if the player owns the building 12. + * @param playerUsername the name of the player performing the action + */ + public void noOptionalCard(String playerUsername) { + doEvent(new NoOptionalCard(playerUsername)); + } + + + /** + * Used to perform the slot choice action for the specified player at the specified position. + * @param playerUsername the name of the player performing the action + * @param pos the index of the selected slot + */ + public void slotChoice(String playerUsername,int pos) { + doEvent(new SlotChoice(playerUsername,pos)); + } /** * Sends a {@link NetworkEvent} to the server. * @param event The NetworkEvent to send. */ - public void doEvent(NetworkEvent event) { + private void doEvent(NetworkEvent event) { try { socketSend.writeObject(event); } catch (IOException e) { diff --git a/src/main/java/it/polimi/ingsw/gc14/Network/TCP/Server/ClientHandler.java b/src/main/java/it/polimi/ingsw/gc14/Network/TCP/Server/ClientHandler.java index 893a303..b64b1f2 100644 --- a/src/main/java/it/polimi/ingsw/gc14/Network/TCP/Server/ClientHandler.java +++ b/src/main/java/it/polimi/ingsw/gc14/Network/TCP/Server/ClientHandler.java @@ -15,7 +15,13 @@ import java.util.concurrent.BlockingQueue; * It is also responsible to send events and game model updates back to the client. */ public class ClientHandler implements Runnable { - + /** + * The username of the connected client on this handler + */ + private final String username; + public String getUsername() { + return username; + } /** The TCP socket */ private Socket clientSocket; @@ -44,7 +50,8 @@ public class ClientHandler implements Runnable { * @param clientHandlers the shared list of all active client handlers. * @param actionQueue the queue containing incoming events. */ - public ClientHandler(Socket clientSocket, ObjectOutputStream out, ObjectInputStream in, List clientHandlers, BlockingQueue actionQueue) { + public ClientHandler(String username, Socket clientSocket, ObjectOutputStream out, ObjectInputStream in, List clientHandlers, BlockingQueue actionQueue) { + this.username=username; this.clientSocket = clientSocket; this.in = in; this.out = out; diff --git a/src/main/java/it/polimi/ingsw/gc14/Network/TCP/Server/TCPServer.java b/src/main/java/it/polimi/ingsw/gc14/Network/TCP/Server/TCPServer.java index 563279a..f420dbb 100644 --- a/src/main/java/it/polimi/ingsw/gc14/Network/TCP/Server/TCPServer.java +++ b/src/main/java/it/polimi/ingsw/gc14/Network/TCP/Server/TCPServer.java @@ -115,7 +115,7 @@ public class TCPServer { clientSocket.getOutputStream().write((int) (1)); System.out.println("Accepted player: " + eventAddPlayer.getUsername()); - ClientHandler clientHandler = new ClientHandler(clientSocket, clientSend, clientReceive, clientHandlers, actionQueue); + ClientHandler clientHandler = new ClientHandler(eventAddPlayer.getUsername(),clientSocket, clientSend, clientReceive, clientHandlers, actionQueue); clientHandlers.add(clientHandler); ConnectedPlayers++; @@ -145,7 +145,10 @@ public class TCPServer { * @param event the network event to send to all connected TCP clients. */ public void notifyAll(NetworkEvent event){ - clientHandlers.forEach((x) -> x.notifyEvent(event)); + clientHandlers.forEach((x) -> { + if(!event.getIsError()||(event.getIsError()&& event.getUsername().equals(x.getUsername()))) + x.notifyEvent(event); + }); } diff --git a/src/main/java/it/polimi/ingsw/gc14/ServerLauncher.java b/src/main/java/it/polimi/ingsw/gc14/ServerLauncher.java index 9c8a10e..0f43343 100644 --- a/src/main/java/it/polimi/ingsw/gc14/ServerLauncher.java +++ b/src/main/java/it/polimi/ingsw/gc14/ServerLauncher.java @@ -7,10 +7,13 @@ import it.polimi.ingsw.gc14.Network.NetworkEvent; import it.polimi.ingsw.gc14.Network.NetworkEvents.AddPlayer; import it.polimi.ingsw.gc14.Network.RMI.Server.RMIServer; import it.polimi.ingsw.gc14.Network.TCP.Server.TCPServer; +import it.polimi.ingsw.gc14.View.TUI.TUI; import java.rmi.RemoteException; +import java.util.*; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; +import java.net.*; /** @@ -56,6 +59,8 @@ public class ServerLauncher { */ static LimitedList playerList; + TUI view; + /** * Class constructor that initializes the attributes. @@ -104,7 +109,14 @@ public class ServerLauncher { playerList = new LimitedList<>(5, ()->{}); BlockingQueue actionQueue = new LinkedBlockingQueue<>(); GameController gameController = new GameController(); - RMIServer serverRMI = new RMIServer(gameController, 1099, actionQueue, playerList); + String IP; + try { + IP=chooseNetworkInterface(new Scanner(System.in)); + } catch (Exception e) { + throw new RuntimeException(e); + } + + RMIServer serverRMI = new RMIServer(gameController, 1099, actionQueue, playerList,IP); TCPServer serverTCP = new TCPServer(gameController, 8080, actionQueue, playerList); ServerLauncher launcher = new ServerLauncher(actionQueue, gameController, serverRMI, serverTCP); @@ -137,11 +149,14 @@ public class ServerLauncher { System.out.println("\n\nNotifying model"); serverRMI.notifyAll(gameController.getModel()); serverTCP.notifyAll(gameController.getModel()); + this.view = new TUI(gameController.getModel()); + this.view.fullRender(); // Game execution while (true) { try { this.doFirstEvent(); + this.view.fullRender(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); break; @@ -150,4 +165,36 @@ public class ServerLauncher { } } } + public static String chooseNetworkInterface(Scanner scanner) throws Exception { + List ips = new ArrayList<>(); + + // Lista tutte le interfacce attive con IP reale + Enumeration interfaces = NetworkInterface.getNetworkInterfaces(); + while (interfaces.hasMoreElements()) { + NetworkInterface ni = interfaces.nextElement(); + + // Salta loopback, interfacce spente o virtuali + if (!ni.isUp() || ni.isLoopback() || ni.isVirtual()) continue; + + Enumeration addresses = ni.getInetAddresses(); + while (addresses.hasMoreElements()) { + InetAddress addr = addresses.nextElement(); + // Solo IPv4 + if (addr instanceof Inet4Address) { + System.out.println("[" + ips.size() + "] " + ni.getDisplayName() + " -> " + addr.getHostAddress()); + ips.add(addr.getHostAddress()); + } + } + } + + if (ips.isEmpty()) throw new Exception("Nessuna interfaccia disponibile"); + if (ips.size() == 1) { + System.out.println("Una sola interfaccia trovata, uso: " + ips.get(0)); + return ips.get(0); + } + + System.out.print("Scegli interfaccia: "); + int choice = Integer.parseInt(scanner.nextLine().trim()); + return ips.get(choice); + } } diff --git a/src/main/java/it/polimi/ingsw/gc14/View/GUI/GUI.java b/src/main/java/it/polimi/ingsw/gc14/View/GUI/GUI.java new file mode 100644 index 0000000..9a49330 --- /dev/null +++ b/src/main/java/it/polimi/ingsw/gc14/View/GUI/GUI.java @@ -0,0 +1,55 @@ +package it.polimi.ingsw.gc14.View.GUI; + +import it.polimi.ingsw.gc14.Controller.ClientController; +import it.polimi.ingsw.gc14.Model.Game; +import it.polimi.ingsw.gc14.View.GUI.MainView; +import it.polimi.ingsw.gc14.View.IView; +import javafx.application.Platform; +import javafx.stage.Stage; + +public class GUI implements IView { // stessa interfaccia che implementa TUI + + private final Stage stage; + private final MainView mainView = new MainView(); + private Game model; + private String username; + + public GUI(Stage stage) { + this.stage = stage; + } + + @Override + public void setModel(Game model) { + this.model = model; + mainView.setModel(model); + } + + /** + * Chiamato da onGameInit e onAction — sempre da thread RMI/TCP. + * Platform.runLater garantisce che la UI venga aggiornata sul JavaFX thread. + */ + @Override + public void render() { + Platform.runLater(() -> { + mainView.render(); + stage.setScene(mainView.getScene()); + }); + } + + @Override + public void showMessage(String message) { + + } + + @Override + public void showError(String message) { + + } + + public void setUsername(String username) { + this.username=username; + } + + // Getter per il launcher + public Stage getStage() { return stage; } +} \ No newline at end of file diff --git a/src/main/java/it/polimi/ingsw/gc14/View/GUI/LoginFXMLController.java b/src/main/java/it/polimi/ingsw/gc14/View/GUI/LoginFXMLController.java new file mode 100644 index 0000000..8e6cba6 --- /dev/null +++ b/src/main/java/it/polimi/ingsw/gc14/View/GUI/LoginFXMLController.java @@ -0,0 +1,44 @@ +package it.polimi.ingsw.gc14.View.GUI; + +import javafx.fxml.FXML; +import javafx.scene.control.*; + +public class LoginFXMLController { + + @FXML private TextField campoNome; + @FXML private TextField campoNumPlayers; + @FXML private TextField campoIP; + @FXML private RadioButton btnRMI; + @FXML private RadioButton btnTCP; + @FXML private Button btnAccedi; + @FXML private Label labelErrore; + + @FXML + public void initialize() { + // I RadioButton vanno collegati a un ToggleGroup a mano + // perché FXML non lo fa automaticamente + ToggleGroup group = new ToggleGroup(); + btnRMI.setToggleGroup(group); + btnTCP.setToggleGroup(group); + } + + // --- Getter esposti a LoginView --- + + public Button getBtnAccedi() { return btnAccedi; } + + public String getNome() { return campoNome.getText().trim(); } + + public int getNumPlayers() { + try { + return Integer.parseInt(campoNumPlayers.getText().trim()); + } catch (NumberFormatException e) { + return -1; + } + } + + public int getNetworkType() { return btnRMI.isSelected() ? 0 : 1; } + + public String getIP() { return campoIP.getText().trim(); } + + public void setErrore(String messaggio) { labelErrore.setText(messaggio); } +} \ No newline at end of file diff --git a/src/main/java/it/polimi/ingsw/gc14/View/GUI/LoginView.java b/src/main/java/it/polimi/ingsw/gc14/View/GUI/LoginView.java new file mode 100644 index 0000000..51eaf1b --- /dev/null +++ b/src/main/java/it/polimi/ingsw/gc14/View/GUI/LoginView.java @@ -0,0 +1,35 @@ +package it.polimi.ingsw.gc14.View.GUI; + +import javafx.fxml.FXMLLoader; +import javafx.scene.Scene; +import javafx.scene.control.Button; + +import java.io.IOException; + +public class LoginView { + + private final Scene scene; + private final LoginFXMLController fxmlController; + + public LoginView() { + try { + FXMLLoader loader = new FXMLLoader( + getClass().getResource("/GUIScene/login.fxml") + ); + scene = new Scene(loader.load(), 350, 380); + fxmlController = loader.getController(); + } catch (IOException e) { + throw new RuntimeException("Impossibile caricare login.fxml", e); + } + } + + // --- Delega tutto al controller FXML --- + + public Scene getScene() { return scene; } + public Button getBtnAccedi() { return fxmlController.getBtnAccedi(); } + public String getNome() { return fxmlController.getNome(); } + public int getNumPlayers() { return fxmlController.getNumPlayers(); } + public int getNetworkType() { return fxmlController.getNetworkType(); } + public String getIP() { return fxmlController.getIP(); } + public void setErrore(String messaggio) { fxmlController.setErrore(messaggio); } +} \ No newline at end of file diff --git a/src/main/java/it/polimi/ingsw/gc14/View/GUI/MainFXMLController.java b/src/main/java/it/polimi/ingsw/gc14/View/GUI/MainFXMLController.java new file mode 100644 index 0000000..496245b --- /dev/null +++ b/src/main/java/it/polimi/ingsw/gc14/View/GUI/MainFXMLController.java @@ -0,0 +1,43 @@ +package it.polimi.ingsw.gc14.View.GUI; + +import it.polimi.ingsw.gc14.Model.Cards.TribeCard; +import it.polimi.ingsw.gc14.Model.Game; +import javafx.fxml.FXML; +import javafx.scene.image.*; +import javafx.scene.layout.*; +import javafx.scene.shape.*; + +import java.util.List; + +public class MainFXMLController { + + @FXML private HBox board; + @FXML private HBox upperList; + @FXML private HBox lowerList; + @FXML private HBox myHand; + @FXML private VBox playersHand; + + private Game model; + + public void setModel(Game model) { + this.model = model; + } + + public void render() { + Image placeholder = new Image(getClass().getResourceAsStream("/GUIImages/Fronts/card-001.png")); + + for (TribeCard card : model.getUpperListTribeCards()) { + ImageView view = new ImageView(placeholder); + view.setFitHeight(250); + view.setPreserveRatio(true); + upperList.getChildren().add(view); + } + + for (TribeCard card : model.getLowerListTribeCards()) { + ImageView view = new ImageView(placeholder); + view.setFitHeight(250); + view.setPreserveRatio(true); + lowerList.getChildren().add(view); + } + } +} diff --git a/src/main/java/it/polimi/ingsw/gc14/View/GUI/MainView.java b/src/main/java/it/polimi/ingsw/gc14/View/GUI/MainView.java new file mode 100644 index 0000000..7df0470 --- /dev/null +++ b/src/main/java/it/polimi/ingsw/gc14/View/GUI/MainView.java @@ -0,0 +1,39 @@ +package it.polimi.ingsw.gc14.View.GUI; + +import it.polimi.ingsw.gc14.Model.Game; +import javafx.fxml.FXMLLoader; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.scene.Scene; +import javafx.scene.control.Label; +import javafx.scene.layout.VBox; + +import java.io.IOException; + +public class MainView { + + private final Scene scene; + private final MainFXMLController fxmlController; + private Game model; + + public MainView() { + try { + FXMLLoader loader = new FXMLLoader( + getClass().getResource("/GUIScene/main.fxml") + ); + scene = new Scene(loader.load(), 1920, 1080); + fxmlController = loader.getController(); + } catch (IOException e) { + throw new RuntimeException("Impossibile caricare login.fxml", e); + } + } + + public Scene getScene() { return scene; } + public void setModel(Game model) { + this.model = model; + fxmlController.setModel(model); + } + public void render() { + fxmlController.render(); + } +} \ No newline at end of file diff --git a/src/main/java/it/polimi/ingsw/gc14/View/IView.java b/src/main/java/it/polimi/ingsw/gc14/View/IView.java index 2169583..5025588 100644 --- a/src/main/java/it/polimi/ingsw/gc14/View/IView.java +++ b/src/main/java/it/polimi/ingsw/gc14/View/IView.java @@ -4,7 +4,7 @@ import it.polimi.ingsw.gc14.Model.Game; import it.polimi.ingsw.gc14.Network.NetworkEvent; public interface IView { - public void update(Game game); + public void setModel(Game game); public void render(); public void showMessage(String message); public void showError(String message); diff --git a/src/main/java/it/polimi/ingsw/gc14/View/TUI/TUI.java b/src/main/java/it/polimi/ingsw/gc14/View/TUI/TUI.java index ecd489e..1253f5c 100644 --- a/src/main/java/it/polimi/ingsw/gc14/View/TUI/TUI.java +++ b/src/main/java/it/polimi/ingsw/gc14/View/TUI/TUI.java @@ -77,7 +77,7 @@ public class TUI implements IView { * @param model the new {@link Game} model; must not be {@code null} */ @Override - public void update(Game model) { + public void setModel(Game model) { this.model = model; } diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index e178647..3adc89b 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -18,4 +18,8 @@ module it.polimi.ingsw.gc14 { exports it.polimi.ingsw.gc14.Network.RMI.Client to java.rmi; exports it.polimi.ingsw.gc14.Network to java.rmi; exports it.polimi.ingsw.gc14.Model to java.rmi, com.google.gson; + + // GUI + opens it.polimi.ingsw.gc14.View.GUI to javafx.fxml; + exports it.polimi.ingsw.gc14.View.GUI; } \ No newline at end of file diff --git a/src/main/resources/GUIImages/Backs/back-001.png b/src/main/resources/GUIImages/Backs/back-001.png new file mode 100644 index 0000000..89dec13 Binary files /dev/null and b/src/main/resources/GUIImages/Backs/back-001.png differ diff --git a/src/main/resources/GUIImages/Backs/back-030.png b/src/main/resources/GUIImages/Backs/back-030.png new file mode 100644 index 0000000..a196534 Binary files /dev/null and b/src/main/resources/GUIImages/Backs/back-030.png differ diff --git a/src/main/resources/GUIImages/Backs/back-058.png b/src/main/resources/GUIImages/Backs/back-058.png new file mode 100644 index 0000000..a71865e Binary files /dev/null and b/src/main/resources/GUIImages/Backs/back-058.png differ diff --git a/src/main/resources/GUIImages/Backs/back-095.png b/src/main/resources/GUIImages/Backs/back-095.png new file mode 100644 index 0000000..8381fbc Binary files /dev/null and b/src/main/resources/GUIImages/Backs/back-095.png differ diff --git a/src/main/resources/GUIImages/Backs/back-097.png b/src/main/resources/GUIImages/Backs/back-097.png new file mode 100644 index 0000000..5905498 Binary files /dev/null and b/src/main/resources/GUIImages/Backs/back-097.png differ diff --git a/src/main/resources/GUIImages/Backs/back-103.png b/src/main/resources/GUIImages/Backs/back-103.png new file mode 100644 index 0000000..033193c Binary files /dev/null and b/src/main/resources/GUIImages/Backs/back-103.png differ diff --git a/src/main/resources/GUIImages/Backs/back-110.png b/src/main/resources/GUIImages/Backs/back-110.png new file mode 100644 index 0000000..efc1db5 Binary files /dev/null and b/src/main/resources/GUIImages/Backs/back-110.png differ diff --git a/src/main/resources/GUIImages/Backs/back-118.png b/src/main/resources/GUIImages/Backs/back-118.png new file mode 100644 index 0000000..21df212 Binary files /dev/null and b/src/main/resources/GUIImages/Backs/back-118.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-001.png b/src/main/resources/GUIImages/Fronts/card-001.png new file mode 100644 index 0000000..6b56265 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-001.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-002.png b/src/main/resources/GUIImages/Fronts/card-002.png new file mode 100644 index 0000000..d4146fb Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-002.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-003.png b/src/main/resources/GUIImages/Fronts/card-003.png new file mode 100644 index 0000000..4e060fc Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-003.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-004.png b/src/main/resources/GUIImages/Fronts/card-004.png new file mode 100644 index 0000000..c6bf04f Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-004.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-005.png b/src/main/resources/GUIImages/Fronts/card-005.png new file mode 100644 index 0000000..70ee4dd Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-005.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-006.png b/src/main/resources/GUIImages/Fronts/card-006.png new file mode 100644 index 0000000..7401038 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-006.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-007.png b/src/main/resources/GUIImages/Fronts/card-007.png new file mode 100644 index 0000000..b487ecf Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-007.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-008.png b/src/main/resources/GUIImages/Fronts/card-008.png new file mode 100644 index 0000000..a6dd5de Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-008.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-009.png b/src/main/resources/GUIImages/Fronts/card-009.png new file mode 100644 index 0000000..be7920f Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-009.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-010.png b/src/main/resources/GUIImages/Fronts/card-010.png new file mode 100644 index 0000000..c74f545 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-010.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-011.png b/src/main/resources/GUIImages/Fronts/card-011.png new file mode 100644 index 0000000..8f5432b Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-011.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-012.png b/src/main/resources/GUIImages/Fronts/card-012.png new file mode 100644 index 0000000..2ce6a2e Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-012.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-013.png b/src/main/resources/GUIImages/Fronts/card-013.png new file mode 100644 index 0000000..06cf152 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-013.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-014.png b/src/main/resources/GUIImages/Fronts/card-014.png new file mode 100644 index 0000000..d144a51 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-014.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-015.png b/src/main/resources/GUIImages/Fronts/card-015.png new file mode 100644 index 0000000..6bc6920 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-015.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-016.png b/src/main/resources/GUIImages/Fronts/card-016.png new file mode 100644 index 0000000..d144a51 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-016.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-017.png b/src/main/resources/GUIImages/Fronts/card-017.png new file mode 100644 index 0000000..43ff517 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-017.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-018.png b/src/main/resources/GUIImages/Fronts/card-018.png new file mode 100644 index 0000000..877e4c3 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-018.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-019.png b/src/main/resources/GUIImages/Fronts/card-019.png new file mode 100644 index 0000000..3b6ac1b Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-019.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-020.png b/src/main/resources/GUIImages/Fronts/card-020.png new file mode 100644 index 0000000..5f3e486 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-020.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-021.png b/src/main/resources/GUIImages/Fronts/card-021.png new file mode 100644 index 0000000..63945c2 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-021.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-022.png b/src/main/resources/GUIImages/Fronts/card-022.png new file mode 100644 index 0000000..8ecadf9 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-022.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-023.png b/src/main/resources/GUIImages/Fronts/card-023.png new file mode 100644 index 0000000..5b761cc Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-023.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-024.png b/src/main/resources/GUIImages/Fronts/card-024.png new file mode 100644 index 0000000..73d7cc5 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-024.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-025.png b/src/main/resources/GUIImages/Fronts/card-025.png new file mode 100644 index 0000000..81d1ce1 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-025.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-026.png b/src/main/resources/GUIImages/Fronts/card-026.png new file mode 100644 index 0000000..05af101 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-026.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-027.png b/src/main/resources/GUIImages/Fronts/card-027.png new file mode 100644 index 0000000..54786a8 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-027.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-028.png b/src/main/resources/GUIImages/Fronts/card-028.png new file mode 100644 index 0000000..79c8ec4 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-028.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-029.png b/src/main/resources/GUIImages/Fronts/card-029.png new file mode 100644 index 0000000..c9f0783 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-029.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-030.png b/src/main/resources/GUIImages/Fronts/card-030.png new file mode 100644 index 0000000..8ec9df7 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-030.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-031.png b/src/main/resources/GUIImages/Fronts/card-031.png new file mode 100644 index 0000000..4e060fc Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-031.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-032.png b/src/main/resources/GUIImages/Fronts/card-032.png new file mode 100644 index 0000000..d2e489e Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-032.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-033.png b/src/main/resources/GUIImages/Fronts/card-033.png new file mode 100644 index 0000000..6b56265 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-033.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-034.png b/src/main/resources/GUIImages/Fronts/card-034.png new file mode 100644 index 0000000..a45d075 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-034.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-035.png b/src/main/resources/GUIImages/Fronts/card-035.png new file mode 100644 index 0000000..55fb912 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-035.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-036.png b/src/main/resources/GUIImages/Fronts/card-036.png new file mode 100644 index 0000000..d74bb4a Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-036.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-037.png b/src/main/resources/GUIImages/Fronts/card-037.png new file mode 100644 index 0000000..a556bcb Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-037.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-038.png b/src/main/resources/GUIImages/Fronts/card-038.png new file mode 100644 index 0000000..4efd17d Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-038.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-039.png b/src/main/resources/GUIImages/Fronts/card-039.png new file mode 100644 index 0000000..cfaa742 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-039.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-040.png b/src/main/resources/GUIImages/Fronts/card-040.png new file mode 100644 index 0000000..c74f545 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-040.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-041.png b/src/main/resources/GUIImages/Fronts/card-041.png new file mode 100644 index 0000000..a5f73b4 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-041.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-042.png b/src/main/resources/GUIImages/Fronts/card-042.png new file mode 100644 index 0000000..97f9071 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-042.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-043.png b/src/main/resources/GUIImages/Fronts/card-043.png new file mode 100644 index 0000000..7cf882e Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-043.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-044.png b/src/main/resources/GUIImages/Fronts/card-044.png new file mode 100644 index 0000000..07376e7 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-044.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-045.png b/src/main/resources/GUIImages/Fronts/card-045.png new file mode 100644 index 0000000..6bc6920 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-045.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-046.png b/src/main/resources/GUIImages/Fronts/card-046.png new file mode 100644 index 0000000..d144a51 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-046.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-047.png b/src/main/resources/GUIImages/Fronts/card-047.png new file mode 100644 index 0000000..6bc6920 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-047.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-048.png b/src/main/resources/GUIImages/Fronts/card-048.png new file mode 100644 index 0000000..6521a0f Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-048.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-049.png b/src/main/resources/GUIImages/Fronts/card-049.png new file mode 100644 index 0000000..a112f1d Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-049.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-050.png b/src/main/resources/GUIImages/Fronts/card-050.png new file mode 100644 index 0000000..ff3fb1e Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-050.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-051.png b/src/main/resources/GUIImages/Fronts/card-051.png new file mode 100644 index 0000000..33eaac8 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-051.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-052.png b/src/main/resources/GUIImages/Fronts/card-052.png new file mode 100644 index 0000000..9c12672 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-052.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-053.png b/src/main/resources/GUIImages/Fronts/card-053.png new file mode 100644 index 0000000..3b6ac1b Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-053.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-054.png b/src/main/resources/GUIImages/Fronts/card-054.png new file mode 100644 index 0000000..2417082 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-054.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-055.png b/src/main/resources/GUIImages/Fronts/card-055.png new file mode 100644 index 0000000..54786a8 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-055.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-056.png b/src/main/resources/GUIImages/Fronts/card-056.png new file mode 100644 index 0000000..de23fad Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-056.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-057.png b/src/main/resources/GUIImages/Fronts/card-057.png new file mode 100644 index 0000000..8aa0fe3 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-057.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-058.png b/src/main/resources/GUIImages/Fronts/card-058.png new file mode 100644 index 0000000..d901205 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-058.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-059.png b/src/main/resources/GUIImages/Fronts/card-059.png new file mode 100644 index 0000000..4e060fc Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-059.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-060.png b/src/main/resources/GUIImages/Fronts/card-060.png new file mode 100644 index 0000000..8ec9df7 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-060.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-061.png b/src/main/resources/GUIImages/Fronts/card-061.png new file mode 100644 index 0000000..6b56265 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-061.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-062.png b/src/main/resources/GUIImages/Fronts/card-062.png new file mode 100644 index 0000000..231d77e Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-062.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-063.png b/src/main/resources/GUIImages/Fronts/card-063.png new file mode 100644 index 0000000..cfaa742 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-063.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-064.png b/src/main/resources/GUIImages/Fronts/card-064.png new file mode 100644 index 0000000..ba715cd Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-064.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-065.png b/src/main/resources/GUIImages/Fronts/card-065.png new file mode 100644 index 0000000..a94ea31 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-065.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-066.png b/src/main/resources/GUIImages/Fronts/card-066.png new file mode 100644 index 0000000..e1f5924 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-066.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-067.png b/src/main/resources/GUIImages/Fronts/card-067.png new file mode 100644 index 0000000..ef3f47a Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-067.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-068.png b/src/main/resources/GUIImages/Fronts/card-068.png new file mode 100644 index 0000000..c74f545 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-068.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-069.png b/src/main/resources/GUIImages/Fronts/card-069.png new file mode 100644 index 0000000..1d77e43 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-069.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-070.png b/src/main/resources/GUIImages/Fronts/card-070.png new file mode 100644 index 0000000..d144a51 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-070.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-071.png b/src/main/resources/GUIImages/Fronts/card-071.png new file mode 100644 index 0000000..6bc6920 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-071.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-072.png b/src/main/resources/GUIImages/Fronts/card-072.png new file mode 100644 index 0000000..d144a51 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-072.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-073.png b/src/main/resources/GUIImages/Fronts/card-073.png new file mode 100644 index 0000000..f0446a3 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-073.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-074.png b/src/main/resources/GUIImages/Fronts/card-074.png new file mode 100644 index 0000000..a9e3503 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-074.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-075.png b/src/main/resources/GUIImages/Fronts/card-075.png new file mode 100644 index 0000000..70334c2 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-075.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-076.png b/src/main/resources/GUIImages/Fronts/card-076.png new file mode 100644 index 0000000..6521a0f Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-076.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-077.png b/src/main/resources/GUIImages/Fronts/card-077.png new file mode 100644 index 0000000..34f1a6d Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-077.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-078.png b/src/main/resources/GUIImages/Fronts/card-078.png new file mode 100644 index 0000000..8eed959 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-078.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-079.png b/src/main/resources/GUIImages/Fronts/card-079.png new file mode 100644 index 0000000..ff46927 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-079.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-080.png b/src/main/resources/GUIImages/Fronts/card-080.png new file mode 100644 index 0000000..7dfaa33 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-080.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-081.png b/src/main/resources/GUIImages/Fronts/card-081.png new file mode 100644 index 0000000..a2e09a2 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-081.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-082.png b/src/main/resources/GUIImages/Fronts/card-082.png new file mode 100644 index 0000000..2417082 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-082.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-083.png b/src/main/resources/GUIImages/Fronts/card-083.png new file mode 100644 index 0000000..a2e09a2 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-083.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-084.png b/src/main/resources/GUIImages/Fronts/card-084.png new file mode 100644 index 0000000..d22b90e Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-084.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-085.png b/src/main/resources/GUIImages/Fronts/card-085.png new file mode 100644 index 0000000..b4ce5ac Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-085.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-086.png b/src/main/resources/GUIImages/Fronts/card-086.png new file mode 100644 index 0000000..6557c97 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-086.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-087.png b/src/main/resources/GUIImages/Fronts/card-087.png new file mode 100644 index 0000000..2ac46e1 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-087.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-088.png b/src/main/resources/GUIImages/Fronts/card-088.png new file mode 100644 index 0000000..c0e6851 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-088.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-089.png b/src/main/resources/GUIImages/Fronts/card-089.png new file mode 100644 index 0000000..7c6071a Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-089.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-090.png b/src/main/resources/GUIImages/Fronts/card-090.png new file mode 100644 index 0000000..0685a4b Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-090.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-091.png b/src/main/resources/GUIImages/Fronts/card-091.png new file mode 100644 index 0000000..ba1af1c Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-091.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-092.png b/src/main/resources/GUIImages/Fronts/card-092.png new file mode 100644 index 0000000..b81cf07 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-092.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-093.png b/src/main/resources/GUIImages/Fronts/card-093.png new file mode 100644 index 0000000..3e628fe Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-093.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-094.png b/src/main/resources/GUIImages/Fronts/card-094.png new file mode 100644 index 0000000..21fa6d7 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-094.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-095.png b/src/main/resources/GUIImages/Fronts/card-095.png new file mode 100644 index 0000000..ebca752 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-095.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-096.png b/src/main/resources/GUIImages/Fronts/card-096.png new file mode 100644 index 0000000..2743bad Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-096.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-097.png b/src/main/resources/GUIImages/Fronts/card-097.png new file mode 100644 index 0000000..42ec113 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-097.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-098.png b/src/main/resources/GUIImages/Fronts/card-098.png new file mode 100644 index 0000000..de64247 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-098.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-099.png b/src/main/resources/GUIImages/Fronts/card-099.png new file mode 100644 index 0000000..067805c Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-099.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-100.png b/src/main/resources/GUIImages/Fronts/card-100.png new file mode 100644 index 0000000..f9f1bf9 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-100.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-101.png b/src/main/resources/GUIImages/Fronts/card-101.png new file mode 100644 index 0000000..e31fa39 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-101.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-102.png b/src/main/resources/GUIImages/Fronts/card-102.png new file mode 100644 index 0000000..b9ebe66 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-102.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-103.png b/src/main/resources/GUIImages/Fronts/card-103.png new file mode 100644 index 0000000..ade84ac Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-103.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-104.png b/src/main/resources/GUIImages/Fronts/card-104.png new file mode 100644 index 0000000..c39591f Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-104.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-105.png b/src/main/resources/GUIImages/Fronts/card-105.png new file mode 100644 index 0000000..9e6ec4c Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-105.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-106.png b/src/main/resources/GUIImages/Fronts/card-106.png new file mode 100644 index 0000000..a0034f2 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-106.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-107.png b/src/main/resources/GUIImages/Fronts/card-107.png new file mode 100644 index 0000000..f9131fc Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-107.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-108.png b/src/main/resources/GUIImages/Fronts/card-108.png new file mode 100644 index 0000000..bf6b3dc Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-108.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-109.png b/src/main/resources/GUIImages/Fronts/card-109.png new file mode 100644 index 0000000..ea4b997 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-109.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-110.png b/src/main/resources/GUIImages/Fronts/card-110.png new file mode 100644 index 0000000..457610b Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-110.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-111.png b/src/main/resources/GUIImages/Fronts/card-111.png new file mode 100644 index 0000000..f5af84e Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-111.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-112.png b/src/main/resources/GUIImages/Fronts/card-112.png new file mode 100644 index 0000000..f21d96c Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-112.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-113.png b/src/main/resources/GUIImages/Fronts/card-113.png new file mode 100644 index 0000000..b1d241c Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-113.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-114.png b/src/main/resources/GUIImages/Fronts/card-114.png new file mode 100644 index 0000000..b1668c5 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-114.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-115.png b/src/main/resources/GUIImages/Fronts/card-115.png new file mode 100644 index 0000000..1f063c1 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-115.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-116.png b/src/main/resources/GUIImages/Fronts/card-116.png new file mode 100644 index 0000000..276758e Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-116.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-117.png b/src/main/resources/GUIImages/Fronts/card-117.png new file mode 100644 index 0000000..ae1e1f4 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-117.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-118.png b/src/main/resources/GUIImages/Fronts/card-118.png new file mode 100644 index 0000000..2b09acc Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-118.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-A.png b/src/main/resources/GUIImages/Fronts/card-A.png new file mode 100644 index 0000000..805ba49 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-A.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-B.png b/src/main/resources/GUIImages/Fronts/card-B.png new file mode 100644 index 0000000..43ce33b Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-B.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-C.png b/src/main/resources/GUIImages/Fronts/card-C.png new file mode 100644 index 0000000..a1ff0f8 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-C.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-D.png b/src/main/resources/GUIImages/Fronts/card-D.png new file mode 100644 index 0000000..c2c06cd Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-D.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-E.png b/src/main/resources/GUIImages/Fronts/card-E.png new file mode 100644 index 0000000..d11087f Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-E.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-F.png b/src/main/resources/GUIImages/Fronts/card-F.png new file mode 100644 index 0000000..d387692 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-F.png differ diff --git a/src/main/resources/GUIImages/Fronts/card-G.png b/src/main/resources/GUIImages/Fronts/card-G.png new file mode 100644 index 0000000..88d1515 Binary files /dev/null and b/src/main/resources/GUIImages/Fronts/card-G.png differ diff --git a/src/main/resources/GUIScene/login.fxml b/src/main/resources/GUIScene/login.fxml new file mode 100644 index 0000000..9e55c8f --- /dev/null +++ b/src/main/resources/GUIScene/login.fxml @@ -0,0 +1,28 @@ + + + + + + + + + +