kleinere änderungen, nix wichtiges

This commit is contained in:
toksikk
2014-11-01 21:50:20 +01:00
parent 2ce0459ef1
commit 84175cde3b
+26 -29
View File
@@ -5,14 +5,11 @@ package de.heatup.mapengine;
import java.awt.Point; import java.awt.Point;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Scanner; import java.util.Scanner;
import javax.swing.JFileChooser; import javax.swing.JFileChooser;
import javax.swing.JPanel;
import de.heatup.logging.Logger; import de.heatup.logging.Logger;
import de.heatup.objects.*; import de.heatup.objects.*;
@@ -94,32 +91,32 @@ public class MapEngine {
/* /*
* wird wahrscheinlich anders umgesetzt. methode ist für testzwecke enthalten. * wird wahrscheinlich anders umgesetzt. methode ist für testzwecke enthalten.
*/ */
protected void addAllGameTilesToGamePanel(JPanel gamePanel) throws IOException { // protected void addAllGameTilesToGamePanel(JPanel gamePanel) throws IOException {
int x = 0; // int x = 0;
int y = 0; // int y = 0;
for (int i = 0; i<mapHeight; i++) { // for (int i = 0; i<mapHeight; i++) {
for (int j = 0; j < mapWidth; j++) { // for (int j = 0; j < mapWidth; j++) {
Objekt newGameTile = new Objekt(getTiles()[i][j]); // Objekt newGameTile = new Objekt(getTiles()[i][j]);
newGameTile.setPosition(x, y); // newGameTile.setPosition(x, y);
if (x+25 >= 800) { // if (x+25 >= 800) {
x = 0; // x = 0;
y += 25; // y += 25;
} else { // } else {
x += 25; // x += 25;
} // }
gamePanel.add(newGameTile.getLabel()); // gamePanel.add(newGameTile.getLabel());
//
} // }
//
} // }
gamePanel.repaint(); // gamePanel.repaint();
} // }
/* // /*
* get all tiles in a 2 dimensional char array // * get all tiles in a 2 dimensional char array
*/ // */
private char[][] getTiles() { // private char[][] getTiles() {
return tiles; // return tiles;
} // }
private HashMap<Character, ArrayList<Point>> getAllMapTiles() { private HashMap<Character, ArrayList<Point>> getAllMapTiles() {
return allMapTiles; return allMapTiles;
} }