You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
649 B
35 lines
649 B
10 years ago
|
package mightypork.rogue.world.level.render;
|
||
10 years ago
|
|
||
|
|
||
10 years ago
|
import mightypork.rogue.world.level.MapAccess;
|
||
10 years ago
|
import mightypork.util.constraints.rect.Rect;
|
||
|
import mightypork.util.constraints.rect.builders.TiledRect;
|
||
|
|
||
|
|
||
|
public abstract class MapRenderContext {
|
||
|
|
||
|
protected final MapAccess map;
|
||
|
protected final TiledRect tiler;
|
||
|
private final Rect mapRect;
|
||
|
|
||
|
|
||
|
public MapRenderContext(MapAccess map, Rect drawArea)
|
||
|
{
|
||
|
this.map = map;
|
||
|
this.tiler = drawArea.tiles(map.getWidth(), map.getHeight());
|
||
|
this.mapRect = drawArea;
|
||
|
}
|
||
|
|
||
|
|
||
|
public Rect getRectForTile(int x, int y)
|
||
|
{
|
||
|
return tiler.tile(x, y);
|
||
|
}
|
||
|
|
||
|
|
||
|
public Rect getMapRect()
|
||
|
{
|
||
|
return mapRect;
|
||
|
}
|
||
|
}
|