27 |
int height; |
int height; |
28 |
|
|
29 |
|
|
30 |
public Door(Block sign, int width, int height) { |
public Door(Block sign, int width, int height, DoorStorage store) throws ConflictingDoorException{ |
31 |
leftUpper = sign.getLocation().clone(); |
leftUpper = sign.getLocation().clone(); |
32 |
|
|
33 |
this.width = width; |
this.width = width; |
57 |
material = leftUpper.getBlock().getTypeId(); |
material = leftUpper.getBlock().getTypeId(); |
58 |
|
|
59 |
loadBlocks(); |
loadBlocks(); |
60 |
|
|
61 |
|
|
62 |
|
for (int w=0; w<width; w++) { |
63 |
|
for (int h=0; h<height; h++) { |
64 |
|
Door d = store.findDoor( blocks[w][h] ); |
65 |
|
if (d != null) { |
66 |
|
throw new ConflictingDoorException(); |
67 |
|
} |
68 |
|
} |
69 |
|
} |
70 |
|
|
71 |
} |
} |
72 |
|
|
81 |
|
|
82 |
width = Integer.parseInt( parts[6] ); |
width = Integer.parseInt( parts[6] ); |
83 |
height = Integer.parseInt( parts[7] ); |
height = Integer.parseInt( parts[7] ); |
84 |
|
|
85 |
|
|
86 |
|
blocks = new Location[width][height]; |
87 |
|
|
88 |
loadBlocks(); |
loadBlocks(); |
89 |
} |
} |
175 |
} |
} |
176 |
} |
} |
177 |
|
|
|
} |
|
178 |
|
} |