Skip to content
Snippets Groups Projects
Commit adea871c authored by Schuh Martin's avatar Schuh Martin
Browse files

Update: Minor Fixes

parent 6c4d4c17
No related branches found
No related tags found
4 merge requests!74V1,!73Initial commit,!71Merge DataBase into Development,!7Merge DataBase to development
......@@ -8,8 +8,8 @@ public class MapData {
private String mapID;
private String mapName;
private int mapWidth;
private int mapHeight;
private int mapWidth; //included for future use (to allow maps of different size)
private int mapHeight; //included for future use (to allow maps of different size)
private String mapData;
protected MapData(String mapID, String mapName, int mapWidth, int mapHeight, String mapData) {
......
......@@ -21,9 +21,9 @@ public class Persistence {
private String sizeString; //??
protected static PlayerStatistics statistics = new PlayerStatistics("", 0,0,0,0,0,0);
//suggestion: rename to "playerData"
protected OracleDB db = new OracleDB(); //for testing purposes; evtl. Methoden von OracleDB static machen und von GSON Handler
OracleDB db = new OracleDB(); //for testing purposes; evtl. Methoden von OracleDB static machen und von GSON Handler
private Persistence (){}
......
......@@ -14,29 +14,37 @@ public class RuntimeInfo {
private LinkedHashMap<String, String> mapNames;
public MapData mapCreated; //to store parsed Data from MapCreator for Upload to SQL
public String communityMapSelected;
protected ArrayList<String> coreMapsListLocal; //include mapID
protected ArrayList<String> communityMapsListLocal; //include mapID
protected ArrayList<String> coreMapsListLocal;
protected ArrayList<String> communityMapsListLocal;
protected ArrayList<String> communityMapsListRemote;
protected String mapDataGame;
public String mapTileString; //Maxe chose this name
private RuntimeInfo(){};
public static RuntimeInfo getInstance(){
return runtimeInfoSingleton;
}
private void setMap(String mapSelected, boolean choseCoremaps){
public String getMapDataGame() {
return mapDataGame;
}
private void setGameMap(String mapSelected, boolean choseCoremaps){
mapSelected = mapSelected.substring(mapSelected.indexOf("(") + 1, mapSelected.length() - 1);
if(choseCoremaps) {
for (int mapListIndex = 0; mapListIndex < persistenceInst.coreMaps.size(); mapListIndex++) {
if (persistenceInst.coreMaps.get(mapListIndex).getMapID().equals("mapSelected")) {
mapTileString = persistenceInst.coreMaps.get(mapListIndex).getMapID();
mapDataGame = persistenceInst.coreMaps.get(mapListIndex).getMapID();
}
}
}
else {
for (int mapListIndex = 0; mapListIndex < persistenceInst.communityMaps.size(); mapListIndex++) {
if (persistenceInst.communityMaps.get(mapListIndex).getMapID().equals("mapSelected")) {
mapTileString = persistenceInst.coreMaps.get(mapListIndex).getMapID();
mapDataGame = persistenceInst.coreMaps.get(mapListIndex).getMapID();
}
}
}
......@@ -58,14 +66,14 @@ public class RuntimeInfo {
public void createCoreMapsList(){
for(int i = 0; i < persistenceInst.coreMaps.size(); i++){
coreMapsListLocal.add(persistenceInst.coreMaps.get(i).getMapName());
coreMapsListLocal.add(persistenceInst.coreMaps.get(i).getMapName() + " (" + persistenceInst.coreMaps.get(i).getMapID() + ")");
}
}
public void createCommunityMapsListLocal(){
try {
for (int i = 0; i < persistenceInst.communityMaps.size(); i++) {
communityMapsListLocal.add(persistenceInst.communityMaps.get(i).getMapName());
communityMapsListLocal.add(persistenceInst.communityMaps.get(i).getMapName() + " (" + persistenceInst.communityMaps.get(i).getMapID() + ")");
}
}
catch (Exception e){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment