Skip to content

Commit

Permalink
Developing maps edition window
Browse files Browse the repository at this point in the history
  • Loading branch information
cesar-rgon committed Jul 3, 2019
2 parents 16b6b92 + 16e11c3 commit 2a80a14
Show file tree
Hide file tree
Showing 27 changed files with 595 additions and 212 deletions.
54 changes: 27 additions & 27 deletions scripts/sql/script.sql
Original file line number Diff line number Diff line change
Expand Up @@ -96,33 +96,33 @@ INSERT INTO KF2DATABASE.DESCRIPTIONS VALUES (44, 'Shopping Spree', 'Compra compu
INSERT INTO KF2DATABASE.DESCRIPTIONS VALUES (45, 'Spillway', 'Desagüe');
INSERT INTO KF2DATABASE.DESCRIPTIONS VALUES (46, 'Steam Fortress', 'Steam Fortress');

INSERT INTO KF2DATABASE.MAPS VALUES (1, 'KF-BurningParis', 20);
INSERT INTO KF2DATABASE.MAPS VALUES (2, 'KF-Bioticslab', 21);
INSERT INTO KF2DATABASE.MAPS VALUES (3, 'KF-Outpost', 22);
INSERT INTO KF2DATABASE.MAPS VALUES (4, 'KF-VolterManor', 23);
INSERT INTO KF2DATABASE.MAPS VALUES (5, 'KF-Catacombs', 24);
INSERT INTO KF2DATABASE.MAPS VALUES (6, 'KF-EvacuationPoint', 25);
INSERT INTO KF2DATABASE.MAPS VALUES (7, 'KF-Farmhouse', 26);
INSERT INTO KF2DATABASE.MAPS VALUES (8, 'KF-BlackForest', 27);
INSERT INTO KF2DATABASE.MAPS VALUES (9, 'KF-Prison', 28);
INSERT INTO KF2DATABASE.MAPS VALUES (10, 'KF-ContainmentStation', 29);
INSERT INTO KF2DATABASE.MAPS VALUES (11, 'KF-HostileGrounds', 30);
INSERT INTO KF2DATABASE.MAPS VALUES (12, 'KF-InfernalRealm', 31);
INSERT INTO KF2DATABASE.MAPS VALUES (13, 'KF-ZedLanding', 32);
INSERT INTO KF2DATABASE.MAPS VALUES (14, 'KF-Nuked', 33);
INSERT INTO KF2DATABASE.MAPS VALUES (15, 'KF-TheDescent', 34);
INSERT INTO KF2DATABASE.MAPS VALUES (16, 'KF-TragicKingdom', 35);
INSERT INTO KF2DATABASE.MAPS VALUES (17, 'KF-Nightmare', 36);
INSERT INTO KF2DATABASE.MAPS VALUES (18, 'KF-KrampusLair', 37);
INSERT INTO KF2DATABASE.MAPS VALUES (19, 'KF-DieSector', 38);
INSERT INTO KF2DATABASE.MAPS VALUES (20, 'KF-Powercore_Holdout', 39);
INSERT INTO KF2DATABASE.MAPS VALUES (21, 'KF-Airship', 40);
INSERT INTO KF2DATABASE.MAPS VALUES (22, 'KF-Lockdown', 41);
INSERT INTO KF2DATABASE.MAPS VALUES (23, 'KF-MonsterBall', 42);
INSERT INTO KF2DATABASE.MAPS VALUES (24, 'KF-SantasWorkshop', 43);
INSERT INTO KF2DATABASE.MAPS VALUES (25, 'KF-ShoppingSpree', 44);
INSERT INTO KF2DATABASE.MAPS VALUES (26, 'KF-Spillway', 45);
INSERT INTO KF2DATABASE.MAPS VALUES (27, 'KF-SteamFortress', 46);
INSERT INTO KF2DATABASE.MAPS(ID, CODE, ID_DESCRIPTION, OFFICIAL, URL_INFO) VALUES (1, 'KF-BurningParis', 20, TRUE, 'https://wiki.killingfloor2.com/index.php?title=Burning_Paris');
INSERT INTO KF2DATABASE.MAPS(ID, CODE, ID_DESCRIPTION, OFFICIAL, URL_INFO) VALUES (2, 'KF-Bioticslab', 21, TRUE, 'https://wiki.killingfloor2.com/index.php?title=Biotics_Lab_(Killing_Floor_2)');
INSERT INTO KF2DATABASE.MAPS(ID, CODE, ID_DESCRIPTION, OFFICIAL, URL_INFO) VALUES (3, 'KF-Outpost', 22, TRUE, 'https://wiki.killingfloor2.com/index.php?title=Outpost');
INSERT INTO KF2DATABASE.MAPS(ID, CODE, ID_DESCRIPTION, OFFICIAL, URL_INFO) VALUES (4, 'KF-VolterManor', 23, TRUE, 'https://wiki.killingfloor2.com/index.php?title=Volter_Manor');
INSERT INTO KF2DATABASE.MAPS(ID, CODE, ID_DESCRIPTION, OFFICIAL, URL_INFO) VALUES (5, 'KF-Catacombs', 24, TRUE, 'https://wiki.killingfloor2.com/index.php?title=Catacombs');
INSERT INTO KF2DATABASE.MAPS(ID, CODE, ID_DESCRIPTION, OFFICIAL, URL_INFO) VALUES (6, 'KF-EvacuationPoint', 25, TRUE, 'https://wiki.killingfloor2.com/index.php?title=Evacuation_Point');
INSERT INTO KF2DATABASE.MAPS(ID, CODE, ID_DESCRIPTION, OFFICIAL, URL_INFO) VALUES (7, 'KF-Farmhouse', 26, TRUE, 'https://wiki.killingfloor2.com/index.php?title=Farmhouse');
INSERT INTO KF2DATABASE.MAPS(ID, CODE, ID_DESCRIPTION, OFFICIAL, URL_INFO) VALUES (8, 'KF-BlackForest', 27, TRUE, 'https://wiki.killingfloor2.com/index.php?title=Black_Forest');
INSERT INTO KF2DATABASE.MAPS(ID, CODE, ID_DESCRIPTION, OFFICIAL, URL_INFO) VALUES (9, 'KF-Prison', 28, TRUE, 'https://wiki.killingfloor2.com/index.php?title=Prison');
INSERT INTO KF2DATABASE.MAPS(ID, CODE, ID_DESCRIPTION, OFFICIAL, URL_INFO) VALUES (10, 'KF-ContainmentStation', 29, TRUE, 'https://wiki.killingfloor2.com/index.php?title=Containment_Station');
INSERT INTO KF2DATABASE.MAPS(ID, CODE, ID_DESCRIPTION, OFFICIAL, URL_INFO) VALUES (11, 'KF-HostileGrounds', 30, TRUE, 'https://wiki.killingfloor2.com/index.php?title=Hostile_Grounds');
INSERT INTO KF2DATABASE.MAPS(ID, CODE, ID_DESCRIPTION, OFFICIAL, URL_INFO) VALUES (12, 'KF-InfernalRealm', 31, TRUE, 'https://wiki.killingfloor2.com/index.php?title=Infernal_Realm');
INSERT INTO KF2DATABASE.MAPS(ID, CODE, ID_DESCRIPTION, OFFICIAL, URL_INFO) VALUES (13, 'KF-ZedLanding', 32, TRUE, 'https://wiki.killingfloor2.com/index.php?title=ZED_Landing');
INSERT INTO KF2DATABASE.MAPS(ID, CODE, ID_DESCRIPTION, OFFICIAL, URL_INFO) VALUES (14, 'KF-Nuked', 33, TRUE, 'https://wiki.killingfloor2.com/index.php?title=Nuked');
INSERT INTO KF2DATABASE.MAPS(ID, CODE, ID_DESCRIPTION, OFFICIAL, URL_INFO) VALUES (15, 'KF-TheDescent', 34, TRUE, 'https://wiki.killingfloor2.com/index.php?title=The_Descent');
INSERT INTO KF2DATABASE.MAPS(ID, CODE, ID_DESCRIPTION, OFFICIAL, URL_INFO) VALUES (16, 'KF-TragicKingdom', 35, TRUE, 'https://wiki.killingfloor2.com/index.php?title=The_Tragic_Kingdom');
INSERT INTO KF2DATABASE.MAPS(ID, CODE, ID_DESCRIPTION, OFFICIAL, URL_INFO) VALUES (17, 'KF-Nightmare', 36, TRUE, 'https://wiki.killingfloor2.com/index.php?title=Nightmare');
INSERT INTO KF2DATABASE.MAPS(ID, CODE, ID_DESCRIPTION, OFFICIAL, URL_INFO) VALUES (18, 'KF-KrampusLair', 37, TRUE, 'https://wiki.killingfloor2.com/index.php?title=Krampus_Lair');
INSERT INTO KF2DATABASE.MAPS(ID, CODE, ID_DESCRIPTION, OFFICIAL, URL_INFO) VALUES (19, 'KF-DieSector', 38, TRUE, 'https://wiki.killingfloor2.com/index.php?title=DieSector');
INSERT INTO KF2DATABASE.MAPS(ID, CODE, ID_DESCRIPTION, OFFICIAL, URL_INFO) VALUES (20, 'KF-Powercore_Holdout', 39, TRUE, 'https://wiki.killingfloor2.com/index.php?title=Powercore');
INSERT INTO KF2DATABASE.MAPS(ID, CODE, ID_DESCRIPTION, OFFICIAL, URL_INFO) VALUES (21, 'KF-Airship', 40, TRUE, 'https://wiki.killingfloor2.com/index.php?title=Airship');
INSERT INTO KF2DATABASE.MAPS(ID, CODE, ID_DESCRIPTION, OFFICIAL, URL_INFO) VALUES (22, 'KF-Lockdown', 41, TRUE, 'https://wiki.killingfloor2.com/index.php?title=Lockdown');
INSERT INTO KF2DATABASE.MAPS(ID, CODE, ID_DESCRIPTION, OFFICIAL, URL_INFO) VALUES (23, 'KF-MonsterBall', 42, TRUE, 'https://wiki.killingfloor2.com/index.php?title=Monster_Ball');
INSERT INTO KF2DATABASE.MAPS(ID, CODE, ID_DESCRIPTION, OFFICIAL, URL_INFO) VALUES (24, 'KF-SantasWorkshop', 43, TRUE, 'https://wiki.killingfloor2.com/index.php?title=Santa%27s_Workshop');
INSERT INTO KF2DATABASE.MAPS(ID, CODE, ID_DESCRIPTION, OFFICIAL, URL_INFO) VALUES (25, 'KF-ShoppingSpree', 44, TRUE, 'https://wiki.killingfloor2.com/index.php?title=Shopping_Spree');
INSERT INTO KF2DATABASE.MAPS(ID, CODE, ID_DESCRIPTION, OFFICIAL, URL_INFO) VALUES (26, 'KF-Spillway', 45, TRUE, 'https://wiki.killingfloor2.com/index.php?title=Spillway');
INSERT INTO KF2DATABASE.MAPS(ID, CODE, ID_DESCRIPTION, OFFICIAL, URL_INFO) VALUES (27, 'KF-SteamFortress', 46, TRUE, 'https://wiki.killingfloor2.com/index.php?title=Steam_Fortress');


-----------------------------------
Expand Down
1 change: 1 addition & 0 deletions src/main/java/constants/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class Constants {
public static final String MENU_DIFFICULTIES_EDITION = "Difficulties";
public static final String MENU_LENGTH_EDITION = "Length";
public static final String MENU_MAXPLAYERS_EDITION = "Max. players";
public static final String MENU_MAPS_EDITION = "Maps";

// UTILS
public final static String UTILS_AES_ENCRIPTION_KEY = "SimplKillingFloor2ServerLauncher";
Expand Down
37 changes: 37 additions & 0 deletions src/main/java/dtos/MapDto.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package dtos;

public class MapDto {

private final String key;
private final String value;
private final Boolean official;
private final String urlInfo;

public MapDto(String key, String value, Boolean official, String urlInfo) {
this.key = key;
this.value = value;
this.official = official;
this.urlInfo = urlInfo;
}

public String getKey() {
return key;
}

public String getValue() {
return value;
}

public Boolean getOfficial() {
return official;
}

public String getUrlInfo() {
return urlInfo;
}

@Override
public String toString() {
return value;
}
}
6 changes: 3 additions & 3 deletions src/main/java/dtos/ProfileDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class ProfileDto {
private final StringProperty name;
private final SelectDto language;
private final SelectDto gametype;
private final SelectDto map;
private final MapDto map;
private final SelectDto difficulty;
private final SelectDto length;
private final SelectDto maxPlayers;
Expand All @@ -25,7 +25,7 @@ public class ProfileDto {
private final String welcomeMessage;
private final String customParameters;

public ProfileDto(String name, SelectDto language, SelectDto gametype, SelectDto map, SelectDto difficulty, SelectDto length, SelectDto maxPlayers,
public ProfileDto(String name, SelectDto language, SelectDto gametype, MapDto map, SelectDto difficulty, SelectDto length, SelectDto maxPlayers,
String serverName, String serverPassword, Boolean webPage, String webPassword, Integer webPort, Integer gamePort, Integer queryPort,
String yourClan, String yourWebLink, String urlImageServer, String welcomeMessage, String customParameters) {
super();
Expand Down Expand Up @@ -66,7 +66,7 @@ public SelectDto getGametype() {
return gametype;
}

public SelectDto getMap() {
public MapDto getMap() {
return map;
}

Expand Down
12 changes: 8 additions & 4 deletions src/main/java/dtos/factories/MapDtoFactory.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package dtos.factories;

import dtos.MapDto;
import dtos.SelectDto;
import entities.Map;
import javafx.collections.FXCollections;
Expand All @@ -10,12 +11,15 @@

public class MapDtoFactory {

public SelectDto newDto(Map map) {
return new SelectDto(map.getCode(), map.getDescription().getEnglishText());
public MapDto newDto(Map map) {
return new MapDto(map.getCode(),
map.getDescription().getEnglishText(),
map.getOfficial(),
map.getUrlInfo());
}

public ObservableList<SelectDto> newDtos(List<Map> maps) {
List<SelectDto> dtoList = maps.stream().map(this::newDto).collect(Collectors.toList());
public ObservableList<MapDto> newDtos(List<Map> maps) {
List<MapDto> dtoList = maps.stream().map(this::newDto).collect(Collectors.toList());
return FXCollections.observableArrayList(dtoList);
}

Expand Down
26 changes: 25 additions & 1 deletion src/main/java/entities/Map.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,22 @@ public class Map extends CommonEntity {
@JoinColumn(name="ID_DESCRIPTION", referencedColumnName="ID", unique=true, nullable=false)
private Description description;

@Column(name="OFFICIAL", nullable=false)
private Boolean official;

@Column(name="URL_INFO", length=255)
private String urlInfo;

public Map() {
super();
}

public Map(String code, Description description) {
public Map(String code, Description description, Boolean official, String urlInfo) {
super();
this.code = code;
this.description = description;
this.official = official;
this.urlInfo = urlInfo;
}

@Override
Expand Down Expand Up @@ -53,4 +61,20 @@ public Description getDescription() {
public void setDescription(Description description) {
this.description = description;
}

public Boolean getOfficial() {
return official;
}

public void setOfficial(Boolean official) {
this.official = official;
}

public String getUrlInfo() {
return urlInfo;
}

public void setUrlInfo(String urlInfo) {
this.urlInfo = urlInfo;
}
}
11 changes: 11 additions & 0 deletions src/main/java/pojos/session/Session.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package pojos.session;

import dtos.MapDto;
import dtos.ProfileDto;

public class Session {
Expand All @@ -8,13 +9,15 @@ public class Session {

private ProfileDto actualProfile;
private String console;
private MapDto map;

/**
* Singleton constructor
*/
private Session() {
super();
console = "";
map = null;
}

public static Session getInstance() {
Expand All @@ -39,4 +42,12 @@ public String getConsole() {
public void setConsole(String console) {
this.console = console;
}

public MapDto getMap() {
return map;
}

public void setMap(MapDto map) {
this.map = map;
}
}
3 changes: 2 additions & 1 deletion src/main/java/stories/maincontent/MainContentController.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package stories.maincontent;

import dtos.MapDto;
import dtos.ProfileDto;
import dtos.SelectDto;
import javafx.beans.value.ChangeListener;
Expand All @@ -26,7 +27,7 @@ public class MainContentController implements Initializable {
@FXML private ComboBox<ProfileDto> profileSelect;
@FXML private ComboBox<SelectDto> languageSelect;
@FXML private ComboBox<SelectDto> gameTypeSelect;
@FXML private ComboBox<SelectDto> mapSelect;
@FXML private ComboBox<MapDto> mapSelect;
@FXML private ComboBox<SelectDto> difficultySelect;
@FXML private ComboBox<SelectDto> lengthSelect;
@FXML private ComboBox<SelectDto> maxPlayersSelect;
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/stories/maincontent/MainContentFacade.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package stories.maincontent;

import dtos.MapDto;
import dtos.ProfileDto;
import dtos.SelectDto;
import javafx.collections.ObservableList;
Expand All @@ -11,7 +12,7 @@ public interface MainContentFacade {
ObservableList<ProfileDto> listAllProfiles() throws SQLException;
ObservableList<SelectDto> listAllLanguages() throws SQLException;
ObservableList<SelectDto> listAllGameTypes() throws SQLException;
ObservableList<SelectDto> listAllMaps() throws SQLException;
ObservableList<MapDto> listAllMaps() throws SQLException;
ObservableList<SelectDto> listAllDifficulties() throws SQLException;
ObservableList<SelectDto> listAllLengths() throws SQLException;
ObservableList<SelectDto> listAllPlayers() throws SQLException;
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/stories/maincontent/MainContentFacadeImpl.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package stories.maincontent;

import daos.*;
import dtos.MapDto;
import dtos.ProfileDto;
import dtos.SelectDto;
import dtos.factories.*;
Expand Down Expand Up @@ -52,7 +53,7 @@ public ObservableList<SelectDto> listAllGameTypes() throws SQLException {
}

@Override
public ObservableList<SelectDto> listAllMaps() throws SQLException {
public ObservableList<MapDto> listAllMaps() throws SQLException {
List<Map> maps = MapDao.getInstance().listAll();
return mapDtoFactory.newDtos(maps);
}
Expand Down
Loading

0 comments on commit 2a80a14

Please sign in to comment.