level editor tests

This commit is contained in:
musilto9 2020-05-27 21:40:04 +02:00
parent 1b6eb4d50a
commit fd6992b0d1
22 changed files with 423 additions and 128 deletions

View File

@ -11,19 +11,6 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-module-junit4:2.0.6" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-module-junit4-common:2.0.6" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-reflect:2.0.6" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy:1.9.10" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy-agent:1.9.10" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-core:2.0.6" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.javassist:javassist:3.27.0-GA" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-api-mockito2:2.0.6" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-api-support:2.0.6" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:2.28.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.6" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter:5.7.0-M1" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-api:5.7.0-M1" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.apiguardian:apiguardian-api:1.1.0" level="project" />
@ -45,5 +32,6 @@
<orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-api-support:2.0.6" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:2.28.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.6" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: commons-io:commons-io:2.5" level="project" />
</component>
</module>

View File

@ -38,5 +38,11 @@
<version>2.0.6</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@ -10,7 +10,6 @@ import java.awt.*;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.LinkedList;
import java.util.Objects;
import java.util.Scanner;
public class ChestCell extends InteractionCell {
@ -137,17 +136,6 @@ public class ChestCell extends InteractionCell {
}
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
ChestCell cell = (ChestCell) o;
return showItem == cell.showItem &&
isActive == cell.isActive &&
Objects.equals(chestInventory, cell.chestInventory);
}
public boolean isActive() {
return isActive;
}

View File

@ -63,16 +63,6 @@ public class DoorCell extends InteractionCell {
}
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
DoorCell doorCell = (DoorCell) o;
return isLocked == doorCell.isLocked &&
directionVert == doorCell.directionVert;
}
public boolean isOpen() {
return isOpen;
}

View File

@ -53,16 +53,4 @@ public class EventMoveToCell extends Cell {
getY() * getSize(), getSize(), getSize(), null);
// g.drawString(Integer.toString(getId()), getX()* WindowOfFreeMove.CELL_SIZE, getY()* WindowOfFreeMove.CELL_SIZE);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
EventMoveToCell that = (EventMoveToCell) o;
return id == that.id &&
directionOut == that.directionOut &&
paint == that.paint &&
map.getName().equals(that.getMap().getName());
}
}

View File

@ -12,7 +12,6 @@ import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Objects;
import java.util.Scanner;
public class Npc extends Person {
@ -115,23 +114,6 @@ public class Npc extends Person {
}
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
Npc npc = (Npc) o;
return direction == npc.direction &&
width == npc.width &&
height == npc.height &&
offsetX == npc.offsetX &&
offsetY == npc.offsetY &&
widthCoef == npc.widthCoef &&
heightCoef == npc.heightCoef &&
Objects.equals(name, npc.name) &&
Objects.equals(imageNpc, npc.imageNpc);
}
public void setDirection(int direction) {
this.direction = direction;
}

View File

@ -14,13 +14,4 @@ public class RandomEncounterCell extends Cell {
this.level = lvl;
this.game = game;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
RandomEncounterCell that = (RandomEncounterCell) o;
return level == that.level;
}
}

View File

@ -37,11 +37,11 @@ public class ImageCell {
String data = scanner.nextLine();
if (data.contains("<tileset>")) {
String[] mapInfo = data.split(" ");
imageTileset(mapInfo);
imageTileset(mapInfo[1]);
}
else if (data.contains("<items>")) {
String[] mapInfo = data.split(" ");
imageItem(mapInfo);
imageItem(mapInfo[1]);
}
else if (data.contains("<cellmap>")) {
String[] mapInfo = data.split(" ");
@ -62,16 +62,16 @@ public class ImageCell {
}
}
private void imageTileset(String[] mapInfo) {
public void imageTileset(String tilesetInfo) {
try {
image = ImageIO.read(new File("src/main/resources/tilesets/" + mapInfo[1]));
image = ImageIO.read(new File("src/main/resources/tilesets/" + tilesetInfo));
} catch (IOException e) {
e.printStackTrace();
}
int width = Integer.parseInt(mapInfo[2]);
int height = Integer.parseInt(mapInfo[3]);
int tileSize = Integer.parseInt(mapInfo[4]);
int width = image.getWidth();
int height = image.getHeight();
int tileSize = 32;
int Xtiles = width / tileSize;
int Ytiles = height / tileSize;
@ -131,15 +131,15 @@ public class ImageCell {
cellMap.put(cellInfo[1], Integer.parseInt(cellInfo[2]));
}
public void imageItem(String[] itemInfo) {
public void imageItem(String itemInfo) {
int imageWidth = 0;
int imageHeight = 0;
int size = 0;
try {
image = ImageIO.read(new File("src/main/resources/items/" + itemInfo[1]));
imageWidth = Integer.parseInt(itemInfo[2]);
imageHeight = Integer.parseInt(itemInfo[3]);
size = Integer.parseInt(itemInfo[4]);
image = ImageIO.read(new File("src/main/resources/items/" + itemInfo));
imageWidth = image.getWidth();
imageHeight = image.getHeight();
size = 32;
} catch (IOException e) {
e.printStackTrace();
}
@ -177,6 +177,14 @@ public class ImageCell {
public int[][] getMapBackground() { return mapBackground; }
public void setMapBackground(int[][] mapBackground) {
this.mapBackground = mapBackground;
}
public void setMapForeground(int[][] mapForeground) {
this.mapForeground = mapForeground;
}
public void paintBackground(Graphics g, int x, int y) {
g.drawImage(imagesOfTiles.get(mapBackground[x][y]), x * WindowOfFreeMove.CELL_SIZE,
y * WindowOfFreeMove.CELL_SIZE, WindowOfFreeMove.CELL_SIZE, WindowOfFreeMove.CELL_SIZE, null);

View File

@ -1,8 +1,5 @@
package ruscz.game.gameOfProd.LevelEditor;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
@ -60,8 +57,8 @@ public class EditorSaveManager {
for (int i = 0; i < editor.getMapHeight(); i++) {
for (int j = 0; j < editor.getMapWidth(); j++) {
if (j != 0) info += " ";
if (set[j][i].split(",")[0].contains("door")) info += "EMPTY";
else info += set[j][i];
if (set[i][j].split(",")[0].contains("door")) info += "EMPTY";
else info += set[i][j];
if (j == editor.getMapWidth() - 1 && i != editor.getMapHeight() - 1) info += System.lineSeparator();
}
}
@ -78,8 +75,7 @@ public class EditorSaveManager {
int[][] set = editor.getMap().getImageCell().getMapBackground();
String info = "";
for (String tileset : editor.getOverview().getActiveTilesets()) {
BufferedImage image = ImageIO.read(new File("src/main/resources/tilesets/" + tileset));
info += "<tileset> " + tileset + " " + image.getWidth() + " " + image.getHeight() + " 32" + System.lineSeparator();
info += "<tileset> " + tileset + System.lineSeparator();
}
for (String key : editor.getCellMap().keySet()) {
info += "<cellmap> " + key + " " + editor.getCellMap().get(key) + System.lineSeparator();

View File

@ -116,7 +116,7 @@ public class LevelEditor extends JFrame {
setResizable(false);
}
private void createNewMap(String name, int width, int height) {
public void createNewMap(String name, int width, int height) {
TypeOfCell[][] mapArray = new TypeOfCell[width][height];
for (int i = 0; i < width; i++) {
Arrays.fill(mapArray[i], TypeOfCell.EMPTY);
@ -136,7 +136,7 @@ public class LevelEditor extends JFrame {
startMapEditor();
}
private void startMapEditor() {
public void startMapEditor() {
JPanel menu = new JPanel();
menu.setBounds(0, 0, 1300, 1000);
@ -263,7 +263,7 @@ public class LevelEditor extends JFrame {
private void initializeCellMap() {
cellMap.put("BLOCK", 0);
cellMap.put("INTER", 0);
cellMap.put("EVENT", 0);
cellMap.put("TRIGGER", 0);
cellMap.put("MOVETO", 0);
cellMap.put("DOOR/DOORTO", 0);
@ -306,6 +306,10 @@ public class LevelEditor extends JFrame {
return imagesOfTiles;
}
public void setImagesOfTiles(LinkedList<BufferedImage> imagesOfTiles) {
this.imagesOfTiles = imagesOfTiles;
}
public InfoManager getInfoManager() {
return infoManager;
}
@ -316,8 +320,14 @@ public class LevelEditor extends JFrame {
public HashMap<String, Integer> getCellMap() { return cellMap; }
public void setCellMap(HashMap<String, Integer> cellMap) {
this.cellMap = cellMap;
}
public String[][] getCellArray() { return cellArray; }
public void setCellArray(String[][] cellArray) { this.cellArray = cellArray; }
public void setOverview(TilesetOverview overview) {
this.overview = overview;
}

View File

@ -82,7 +82,7 @@ public class TilesetOverview extends JFrame {
offset += 70;
}
private void generateOverview() {
public void generateOverview() {
tilesetOffset = 0;
imagesOfTiles = new LinkedList<>();
tilesetPanel.removeAll();
@ -151,5 +151,7 @@ public class TilesetOverview extends JFrame {
public LinkedList<String> getActiveTilesets() { return activeTilesets; }
public void setActiveTilesets(LinkedList<String> activeTilesets) { this.activeTilesets = activeTilesets; }
public JLabel getInfo() { return info; }
}

View File

@ -1,7 +1,7 @@
<tileset> A5_Tiles.png 256 512 32
<tileset> Openspace1.png 512 512 32
<tileset> Openspace2.png 512 512 32
<tileset> D_Inside_House.png 512 512 32
<tileset> A5_Tiles.png
<tileset> Openspace1.png
<tileset> Openspace2.png
<tileset> D_Inside_House.png
<cellmap> BLOCK 2
<cellmap> MOVETO 1
<cellmap> EVENT 0

View File

@ -1,7 +1,7 @@
<tileset> A5_Tiles.png 256 512 32
<tileset> Openspace1.png 512 512 32
<tileset> Openspace2.png 512 512 32
<tileset> D_Inside_House.png 512 512 32
<tileset> A5_Tiles.png
<tileset> Openspace1.png
<tileset> Openspace2.png
<tileset> D_Inside_House.png
<cellmap> BLOCK 2
<cellmap> MOVETO 1
<cellmap> EVENT 3

View File

@ -1,8 +1,8 @@
<tileset> A5_Tiles.png 256 512 32
<tileset> Openspace1.png 512 512 32
<tileset> Openspace2.png 512 512 32
<tileset> D_Inside_House.png 512 512 32
<items> TransparentIcons.png 512 640 32
<tileset> A5_Tiles.png
<tileset> Openspace1.png
<tileset> Openspace2.png
<tileset> D_Inside_House.png
<items> TransparentIcons.png
<cellmap> BLOCK 2
<cellmap> MOVETO 1
<cellmap> EVENT 0

View File

@ -1,4 +1,4 @@
<tileset> CertificateOfShame.png 650 500 50
<tileset> CertificateOfShame.png
<cellmap> BLOCK 0
<cellmap> MOVETO 0
<cellmap> EVENT 0

View File

@ -1,6 +1,6 @@
<tileset> A2_Ground.png 512 384 32 192
<tileset> D_OutDoor.png 512 512 32 256
<tileset> tutorialtiles.png 288 96 32 448
<tileset> A2_Ground.png
<tileset> D_OutDoor.png
<tileset> tutorialtiles.png
<cellmap> BLOCK 120
<cellmap> MOVETO 277
<cellmap> EVENT 334

View File

@ -1,10 +1,36 @@
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

View File

@ -1,10 +1,12 @@
<tileset> A2_Ground.png 512 384 32
<tileset> D_OutDoor.png 512 512 32
<tileset> A2_Ground.png
<tileset> D_OutDoor.png
<cellmap> CHEST 0
<cellmap> TRIGGER 147
<cellmap> BLOCK 120
<cellmap> MOVETO 277
<cellmap> EVENT 334
<cellmap> TRIGGER 147
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
<cellmap> DOOR/DOORTO 0
<soundmap> DOOR qubodup-DoorOpen01-changed.wav qubodup-DoorClose02-changed.wav doorLocked.wav
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY
EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY
EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY
EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY BLOCK BLOCK BLOCK EMPTY EMPTY EMPTY EMPTY
EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY BLOCK BLOCK BLOCK EMPTY EMPTY EMPTY EMPTY
EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY BLOCK BLOCK BLOCK EMPTY EMPTY EMPTY EMPTY
EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY
EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY
EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY
BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK EMPTY BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK EMPTY BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK
EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY TRIGGER,roses-are-red EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY
BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK EMPTY BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK EMPTY BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK
EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK
EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK BLOCK EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY
EMPTY EMPTY EMPTY EMPTY BLOCK BLOCK EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY
EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY
EMPTY EMPTY EMPTY EMPTY BLOCK BLOCK EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY
EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY
EMPTY EMPTY EMPTY EMPTY BLOCK BLOCK EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY EMPTY
EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY BLOCK EMPTY BLOCK BLOCK EMPTY EMPTY EMPTY EMPTY
EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY
EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY
BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK EMPTY BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK EMPTY BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK
EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY SPAWN EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY
BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK EMPTY BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK EMPTY BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK
BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY BLOCK EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY BLOCK EMPTY EMPTY EMPTY BLOCK EMPTY EMPTY BLOCK
BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK BLOCK BLOCK BLOCK BLOCK EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY BLOCK EMPTY EMPTY EMPTY BLOCK EMPTY EMPTY BLOCK
BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY BLOCK EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY BLOCK EMPTY EMPTY EMPTY BLOCK EMPTY EMPTY BLOCK
BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY BLOCK BLOCK EMPTY BLOCK BLOCK EMPTY EMPTY BLOCK
BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK
BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY BLOCK BLOCK EMPTY BLOCK BLOCK EMPTY EMPTY BLOCK
BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK BLOCK BLOCK EMPTY BLOCK EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY BLOCK EMPTY EMPTY EMPTY BLOCK EMPTY EMPTY BLOCK
BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY BLOCK EMPTY EMPTY EMPTY BLOCK EMPTY EMPTY BLOCK
BLOCK EMPTY EMPTY EMPTY BLOCK EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY BLOCK EMPTY EMPTY EMPTY BLOCK EMPTY EMPTY BLOCK
BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK EMPTY BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK EMPTY BLOCK BLOCK BLOCK BLOCK EMPTY EMPTY EMPTY BLOCK BLOCK BLOCK BLOCK

View File

@ -0,0 +1,199 @@
package ruscz.game.gameOfProd.LevelEditor;
import org.apache.commons.io.FileUtils;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import ruscz.game.gameOfProd.Cells.TypeOfCell;
import ruscz.game.gameOfProd.Image.ImageCell;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Scanner;
import java.util.stream.Stream;
public class LevelEditorTest {
public static Stream<Arguments> argumentsStream() {
return Stream.of(
Arguments.of((Object) new String[]{"A2_Ground.png"}),
Arguments.of((Object) new String[]{"A2_Ground.png", "A5_Tiles.png"}),
Arguments.of((Object) new String[]{"Openspace1.png", "Openspace2.png", "CertificateOfShame.png"}),
Arguments.of((Object) new String[]{"D_Inside_House.png", "D_OutDoor.png", "dark-door.png", "tutorialtiles.png"})
);
}
@ParameterizedTest
@MethodSource("argumentsStream")
public void generateOverview_generateTilesetsFromImages_CorrectlyGeneratedTilesets(String[] tilesets) {
//Arrange
TilesetOverview tilesetOverview;
LinkedList<String> activeTilesets;
ImageCell imageCell;
//Act
tilesetOverview = new TilesetOverview();
tilesetOverview.setVisible(false);
activeTilesets = new LinkedList<>();
imageCell = new ImageCell();
for (String tileset : tilesets) {
activeTilesets.add(tileset);
imageCell.imageTileset(tileset);
}
tilesetOverview.setActiveTilesets(activeTilesets);
tilesetOverview.generateOverview();
//Assert
for (int i = 0; i < tilesetOverview.getImagesOfTiles().size(); i++) {
Assertions.assertTrue(compareImages(tilesetOverview.getImagesOfTiles().get(i), imageCell.getImagesOfTiles().get(i)));
}
}
public static Stream<Arguments> argumentsStream2() {
return Stream.of(
Arguments.of("test", 10, 10)
);
}
@ParameterizedTest
@MethodSource("argumentsStream2")
public void createMap_createNewMapForLevelEditor_CorrectlyCreatedMap(String name, int width, int height) {
//Arrange
LevelEditor levelEditor;
TypeOfCell[][] mapArray;
//Act
levelEditor = new LevelEditor();
levelEditor.setVisible(false);
levelEditor.createNewMap(name, width, height);
mapArray = new TypeOfCell[width][height];
for (int i = 0; i < width; i++) {
Arrays.fill(mapArray[i], TypeOfCell.EMPTY);
}
//Assert
Assertions.assertEquals(width, levelEditor.getMapWidth());
Assertions.assertEquals(height, levelEditor.getMapHeight());
Assertions.assertEquals(name, levelEditor.getMap().getName());
for (int i = 0; i < mapArray.length; i++) {
for (int j = 0; j < mapArray[0].length; j++) {
Assertions.assertEquals(mapArray[i][j], levelEditor.getMap().getMapArray()[i][j]);
}
}
}
@Test
public void saveMap_saveMapToFiles_CorrectlySavedMap() throws IOException {
//Arrange
LevelEditor levelEditor;
TilesetOverview tilesetOverview;
EditorSaveManager editorSaveManager;
String[][] cellArray;
int[][] mapForeground;
int[][] mapBackground;
Scanner scanner;
File file;
//Act
levelEditor = new LevelEditor();
levelEditor.setVisible(false);
levelEditor.createNewMap("test", 36, 36);
levelEditor.startMapEditor();
cellArray = new String[36][36];
file = new File("src/main/resources/maps/999/m6.txt");
scanner = new Scanner(file);
scanner.nextLine();
int i = 0;
while (scanner.hasNextLine()) {
cellArray[i] = scanner.nextLine().split(" ");
i++;
}
levelEditor.setCellArray(cellArray);
mapBackground = new int[36][36];
file = new File("src/main/resources/maps/999/m6-tileset.txt");
scanner = new Scanner(file);
i = 0;
while (scanner.hasNextLine()) {
String line = scanner.nextLine();
if (!line.contains("<tileset>") && !line.contains("<cellmap>") && !line.contains("<soundmap>") && !line.contains("<items>")) {
String[] values = line.split(" ");
for (int j = 0; j < values.length; j++) {
mapBackground[j][i] = Integer.parseInt(values[j]);
}
i++;
}
}
levelEditor.getMap().getImageCell().setMapBackground(mapBackground);
mapForeground = new int[36][36];
file = new File("src/main/resources/maps/999/m6-objectset.txt");
scanner = new Scanner(file);
i = 0;
while (scanner.hasNextLine()) {
String[] values = scanner.nextLine().split(" ");
for (int j = 0; j < values.length; j++) {
mapForeground[j][i] = Integer.parseInt(values[j]);
}
i++;
}
levelEditor.getMap().getImageCell().setMapForeground(mapForeground);
levelEditor.setOverview(new TilesetOverview());
tilesetOverview = levelEditor.getOverview();
tilesetOverview.setVisible(false);
LinkedList<String> activeTilesets = new LinkedList<>();
activeTilesets.add("A2_Ground.png");
activeTilesets.add("D_OutDoor.png");
tilesetOverview.setActiveTilesets(activeTilesets);
tilesetOverview.generateOverview();
levelEditor.setImagesOfTiles(tilesetOverview.getImagesOfTiles());
HashMap<String, Integer> cellMap = new HashMap<>();
cellMap.put("BLOCK", 120);
cellMap.put("EVENT", 334);
cellMap.put("TRIGGER", 147);
cellMap.put("MOVETO", 277);
cellMap.put("DOOR/DOORTO", 0);
cellMap.put("CHEST", 0);
levelEditor.setCellMap(cellMap);
editorSaveManager = new EditorSaveManager(levelEditor);
editorSaveManager.saveMap();
//Assert
File file1 = new File("src/main/resources/maps/999/m6.txt");
File file2 = new File("src/main/resources/maps/custom/test.txt");
File file1Tileset = new File("src/main/resources/maps/999/m6-tileset.txt");
File file2Tileset = new File("src/main/resources/maps/custom/test-tileset.txt");
File file1Objectset = new File("src/main/resources/maps/999/m6-objectset.txt");
File file2Objectset = new File("src/main/resources/maps/custom/test-objectset.txt");
Assertions.assertTrue(FileUtils.contentEquals(file1, file2));
Assertions.assertTrue(FileUtils.contentEquals(file1Tileset, file2Tileset));
Assertions.assertTrue(FileUtils.contentEquals(file1Objectset, file2Objectset));
}
public static boolean compareImages(BufferedImage imgA, BufferedImage imgB) {
if (imgA.getWidth() != imgB.getWidth() || imgA.getHeight() != imgB.getHeight()) {
return false;
}
int width = imgA.getWidth();
int height = imgA.getHeight();
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
if (imgA.getRGB(x, y) != imgB.getRGB(x, y)) {
return false;
}
}
}
return true;
}
}