1 package erland.game.tileadventure;
2
3 import java.awt.*;
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 public class WorldMapEditor extends TileMapEditor {
25 /*** The level manager to use */
26 protected LevelManager levelManager;
27 /*** The draw map implementation to use */
28 protected DrawMap drawMap;
29 /*** The level manager to use for palette bitmap */
30 protected LevelManager paletteLevelManager;
31 /*** The palette bitmap */
32 protected Image paletteBitmap;
33
34 protected String getLevelFileLabel() {
35 return null;
36 }
37
38 protected String getLevelFileGroupLabel() {
39 return null;
40 }
41
42 protected int getSizeX() {
43 return 10;
44 }
45
46 protected int getSizeY() {
47 return 10;
48 }
49
50 protected int getSizeZ() {
51 return 1;
52 }
53
54 protected int getSelectSizeX() {
55 return 2;
56 }
57
58 protected int getSelectSizeY() {
59 return 10;
60 }
61
62 protected Image getMapBlockImage() {
63 if(paletteBitmap==null) {
64 paletteBitmap = paletteLevelManager.getImage();
65 }
66 return paletteBitmap;
67 }
68
69 protected LevelManager getLevelManager() {
70 levelManager.setContainer(getMapContainer());
71 return levelManager;
72 }
73
74 public void drawMapBlocks(Graphics g, MapObjectContainerInterface blocks) {
75 drawMap.setContainer(getMapContainer());
76 drawMap.removeAllObjectMaps();
77 drawMap.addObjectMap(blocks);
78 drawMap.draw(g);
79 }
80
81 protected void initFinish() {
82 super.initFinish();
83 drawMap = ((TileGameEnvironmentInterface)getEnvironment().getCustomEnvironment()).createBlockMap();
84 levelManager = new WorldEditorLevelManager();
85 levelManager.init(getEnvironment());
86 paletteLevelManager = new RoomEditorLevelManager();
87 paletteLevelManager.init(getEnvironment());
88 paletteBitmap = null;
89 }
90 }