Package ruscz.game.gameOfProd.Image
Class ImageCell
- java.lang.Object
-
- ruscz.game.gameOfProd.Image.ImageCell
-
public class ImageCell extends java.lang.ObjectThis class manages and holds tileset and all matrices of images to be pained
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.HashMap<java.lang.String,java.lang.Integer>cellMapprivate static java.awt.image.BufferedImageimageprivate ImageDoorimageDoorprivate java.util.LinkedList<java.awt.image.BufferedImage>imagesOfItemsprivate java.util.LinkedList<java.awt.image.BufferedImage>imagesOfTilesprivate static java.util.logging.LoggerLOGprivate int[][]mapBackgroundprivate int[][]mapForeground
-
Constructor Summary
Constructors Constructor Description ImageCell()
-
Method Summary
Modifier and Type Method Description ImageDoorgetImageDoor()intgetImageFromCellMap(java.lang.String cell)java.util.LinkedList<java.awt.image.BufferedImage>getImagesOfItems()java.util.LinkedList<java.awt.image.BufferedImage>getImagesOfTiles()int[][]getMapBackground()int[][]getMapForeground()voidimageItem(java.lang.String itemInfo)Parses item image into arrayvoidimageObjectset(java.lang.String file)Parses (map-name)-objectset.txt file into a matrixvoidimageTileset(java.lang.String[] tilesetInfo)Parses tileset image into a tileset (array)voidloadCellMap(java.lang.String[] cellInfo)Parses text into a hash mapvoidpaintBackground(java.awt.Graphics g, int x, int y)voidpaintForeground(java.awt.Graphics g, int x, int y)voidreadMapFile(int width, int height)Creates new matrices based on width and height valuesvoidreadMapFile(java.lang.String name)Reads and parses (map-name)-tileset.txt file into matrices and arrays, separates values and passes them on for further parsingvoidsetMapBackground(int[][] mapBackground)voidsetMapForeground(int[][] mapForeground)
-
-
-
Field Detail
-
image
private static java.awt.image.BufferedImage image
-
imagesOfTiles
private java.util.LinkedList<java.awt.image.BufferedImage> imagesOfTiles
-
cellMap
private java.util.HashMap<java.lang.String,java.lang.Integer> cellMap
-
imageDoor
private ImageDoor imageDoor
-
imagesOfItems
private java.util.LinkedList<java.awt.image.BufferedImage> imagesOfItems
-
mapBackground
private int[][] mapBackground
-
mapForeground
private int[][] mapForeground
-
LOG
private static final java.util.logging.Logger LOG
-
-
Method Detail
-
readMapFile
public void readMapFile(int width, int height)Creates new matrices based on width and height values- Parameters:
width- is width of new mapheight- is height of new map
-
readMapFile
public void readMapFile(java.lang.String name)
Reads and parses (map-name)-tileset.txt file into matrices and arrays, separates values and passes them on for further parsing- Parameters:
name- is name of map file
-
imageTileset
public void imageTileset(java.lang.String[] tilesetInfo)
Parses tileset image into a tileset (array)- Parameters:
tilesetInfo- is name of tileset image
-
imageObjectset
public void imageObjectset(java.lang.String file)
Parses (map-name)-objectset.txt file into a matrix- Parameters:
file- is name of map tp be parsed
-
loadCellMap
public void loadCellMap(java.lang.String[] cellInfo)
Parses text into a hash map- Parameters:
cellInfo- is text representation of cellMap
-
imageItem
public void imageItem(java.lang.String itemInfo)
Parses item image into array- Parameters:
itemInfo- is name of item image
-
getImagesOfItems
public java.util.LinkedList<java.awt.image.BufferedImage> getImagesOfItems()
-
getImageFromCellMap
public int getImageFromCellMap(java.lang.String cell)
-
getImagesOfTiles
public java.util.LinkedList<java.awt.image.BufferedImage> getImagesOfTiles()
-
getImageDoor
public ImageDoor getImageDoor()
-
getMapForeground
public int[][] getMapForeground()
-
getMapBackground
public int[][] getMapBackground()
-
setMapBackground
public void setMapBackground(int[][] mapBackground)
-
setMapForeground
public void setMapForeground(int[][] mapForeground)
-
paintBackground
public void paintBackground(java.awt.Graphics g, int x, int y)
-
paintForeground
public void paintForeground(java.awt.Graphics g, int x, int y)
-
-