Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
1package org.bukkit.map;
2
3import org.bukkit.entity.Player;
4
5/**
6 * Represents a renderer for a map.
7 */
8public abstract class MapRenderer {
9
10 private boolean contextual;
11
12 /**
13 * Initialize the map renderer base to be non-contextual. See {@link isContextual}.
14 */
15 public MapRenderer() {
16 this(false);
17 }
18
19 /**
20 * Initialize the map renderer base with the given contextual status.
21 *
22 * @param contextual Whether the renderer is contextual. See {@link isContextual}.
23 */
24 public MapRenderer(boolean contextual) {
25 this.contextual = contextual;
26 }
27
28 /**
29 * Get whether the renderer is contextual, i.e. has different canvases for
30 * different players.
31 *
32 * @return True if contextual, false otherwise.
33 */
34 final public boolean isContextual() {
35 return contextual;
36 }
37
38 /**
39 * Initialize this MapRenderer for the given map.
40 *
41 * @param map The MapView being initialized.
42 */
43 public void initialize(MapView map) {
44 }
45
46 /**
47 * Render to the given map.
48 *
49 * @param map The MapView being rendered to.
50 * @param canvas The canvas to use for rendering.
51 * @param player The player who triggered the rendering.
52 */
53 abstract public void render(MapView map, MapCanvas canvas, Player player);
54
55}