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.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Scanner;
import javax.swing.JFileChooser;
import javax.swing.JPanel;
import de.heatup.logging.Logger;
import de.heatup.objects.*;
@@ -94,32 +91,32 @@ public class MapEngine {
/*
* wird wahrscheinlich anders umgesetzt. methode ist für testzwecke enthalten.
*/
protected void addAllGameTilesToGamePanel(JPanel gamePanel) throws IOException {
int x = 0;
int y = 0;
for (int i = 0; i<mapHeight; i++) {
for (int j = 0; j < mapWidth; j++) {
Objekt newGameTile = new Objekt(getTiles()[i][j]);
newGameTile.setPosition(x, y);
if (x+25 >= 800) {
x = 0;
y += 25;
} else {
x += 25;
}
gamePanel.add(newGameTile.getLabel());
}
}
gamePanel.repaint();
}
/*
* get all tiles in a 2 dimensional char array
*/
private char[][] getTiles() {
return tiles;
}
// protected void addAllGameTilesToGamePanel(JPanel gamePanel) throws IOException {
// int x = 0;
// int y = 0;
// for (int i = 0; i<mapHeight; i++) {
// for (int j = 0; j < mapWidth; j++) {
// Objekt newGameTile = new Objekt(getTiles()[i][j]);
// newGameTile.setPosition(x, y);
// if (x+25 >= 800) {
// x = 0;
// y += 25;
// } else {
// x += 25;
// }
// gamePanel.add(newGameTile.getLabel());
//
// }
//
// }
// gamePanel.repaint();
// }
// /*
// * get all tiles in a 2 dimensional char array
// */
// private char[][] getTiles() {
// return tiles;
// }
private HashMap<Character, ArrayList<Point>> getAllMapTiles() {
return allMapTiles;
}