1 package erland.game.tileadventure.rect;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 import erland.game.tileadventure.*;
22
23 import java.awt.*;
24 import java.util.Vector;
25
26 public class RectDrawMap extends DrawMap {
27 public void draw(Graphics g) {
28 BitmapObject.drawCount = 0;
29 MapObjectContainerInterface[] maps = getMaps();
30 if(maps.length>0) {
31 MapObjectContainerInterface main = (MapObjectContainerInterface) maps[0];
32 for(int z=0;z<main.getSizeZ();z++) {
33 for(int y=0;y<main.getSizeY();y++) {
34 for(int x=0;x<main.getSizeX();x++) {
35 drawTile(maps, x, y, z, g);
36 }
37 }
38 }
39 }
40 }
41
42 private void drawTile(MapObjectContainerInterface[] maps, int x, int y, int z, Graphics g) {
43 MapObjectInterface obj = maps[0].getBlock(x,y,z);
44 if(obj!=null) {
45 obj.draw(g);
46 }
47 for(int i=1;i<maps.length;i++) {
48 MapObjectContainerInterface map = (MapObjectContainerInterface) maps[i];
49 obj = map.getBlock(x,y,z);
50 if(obj!=null) {
51 obj.draw(g);
52 }
53 }
54 }
55 }
56