mirror of
https://github.com/jokerx3/HeatUp
synced 2026-07-27 08:49:44 +02:00
kleinere änderungen, nix wichtiges
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user