1 package erland.game.tileadventure;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 import java.awt.*;
22 import java.util.Vector;
23 import java.util.Arrays;
24
25 public abstract class DrawMap implements MapDrawInterface {
26 private IrregularBlockContainerInterface cont;
27 private MapObjectContainerInterface[] maps = new MapObjectContainerInterface[0];
28
29 public void setContainer(IrregularBlockContainerInterface cont) {
30 this.cont = cont;
31 }
32
33 protected IrregularBlockContainerInterface getContainer() {
34 return cont;
35 }
36
37 public void removeAllObjectMaps() {
38 maps = new MapObjectContainerInterface[0];
39 }
40 public void addObjectMap(MapObjectContainerInterface map) {
41 Vector tmp = new Vector(Arrays.asList(maps));
42 tmp.addElement(map);
43 maps = (MapObjectContainerInterface[]) tmp.toArray(new MapObjectContainerInterface[0]);
44 }
45
46 protected MapObjectContainerInterface[] getMaps() {
47 return maps;
48 }
49
50
51 public abstract void draw(Graphics g);
52 }
53