Package ruscz.game.gameOfProd.Map
Class MapManager
- java.lang.Object
-
- ruscz.game.gameOfProd.Map.MapManager
-
public class MapManager extends java.lang.ObjectThis class manages all currently loaded maps and transfers hero between maps
-
-
Field Summary
Fields Modifier and Type Field Description private MapactualMapprivate WindowOfFreeMove.Canvascanvasprivate LoadManagerloadManagerprivate java.util.LinkedList<Map>mapsprivate SaveManagersaveManagerprivate WindowOfFreeMovewindow
-
Constructor Summary
Constructors Constructor Description MapManager(java.util.LinkedList<Map> maps, WindowOfFreeMove.Canvas canvas, WindowOfFreeMove window)
-
Method Summary
Modifier and Type Method Description voidcreateMap()Sets person on a new map based on SPAWN cellMapgetActualMap()LoadManagergetLoadManager()java.util.LinkedList<Map>getMaps()SaveManagergetSaveManager()WindowOfFreeMovegetWindow()voidrepaintCanvas()voidresizeCanvas(int[] size)Sets canvas size based on current mapvoidsetMap(Map map)Sets map as the one that is currently used, if that map is not present in map list, the map is addedprivate voidsetPersonByMoveToEvent()Sets person on a new map based on MOVETO or DOORTO cell
-
-
-
Field Detail
-
canvas
private final WindowOfFreeMove.Canvas canvas
-
maps
private final java.util.LinkedList<Map> maps
-
actualMap
private Map actualMap
-
saveManager
private final SaveManager saveManager
-
window
private final WindowOfFreeMove window
-
loadManager
private final LoadManager loadManager
-
-
Constructor Detail
-
MapManager
public MapManager(java.util.LinkedList<Map> maps, WindowOfFreeMove.Canvas canvas, WindowOfFreeMove window)
-
-
Method Detail
-
setMap
public void setMap(Map map)
Sets map as the one that is currently used, if that map is not present in map list, the map is added- Parameters:
map- is map to be set
-
getActualMap
public Map getActualMap()
-
getMaps
public java.util.LinkedList<Map> getMaps()
-
getWindow
public WindowOfFreeMove getWindow()
-
getLoadManager
public LoadManager getLoadManager()
-
getSaveManager
public SaveManager getSaveManager()
-
createMap
public void createMap()
Sets person on a new map based on SPAWN cell
-
setPersonByMoveToEvent
private void setPersonByMoveToEvent()
Sets person on a new map based on MOVETO or DOORTO cell
-
repaintCanvas
public void repaintCanvas()
-
resizeCanvas
public void resizeCanvas(int[] size)
Sets canvas size based on current map- Parameters:
size- is array of new sizes for canvas
-
-