public class TileBlock
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) int |
benefit |
(package private) int |
h |
(package private) int |
occH |
(package private) boolean[] |
occupied |
(package private) int |
occW |
(package private) int |
occX |
(package private) int |
occY |
(package private) int |
w |
(package private) int |
xOff |
(package private) int |
yOff |
Constructor and Description |
---|
TileBlock(int occX,
int occY,
int occW,
int occH,
boolean[] occupied,
int xOff,
int yOff,
int w,
int h)
Construct a tile block this represents a block of contigous
tiles.
|
Modifier and Type | Method and Description |
---|---|
(package private) int |
getBenefit()
Return the number of new tiles computed.
|
(package private) TileBlock[] |
getBestSplit()
Returnes an optimized list of TileBlocks to generate that
tries to minimize the work to benefit ratio, for the set of
blocks defined by this block.
|
(package private) int |
getHeight()
Return the height of this block of tiles
|
(package private) int |
getWidth()
Return the width of this block of tiles
|
(package private) int |
getWork()
Return the approximate amount of work required to compute
those tiles.
|
(package private) static int |
getWork(TileBlock[] blocks)
Returns the total amount of work for the array of tile blocks
|
(package private) int |
getXLoc()
Return the x location of this block of tiles
|
(package private) int |
getYLoc()
Return the y location of this block of tiles
|
boolean |
simplify() |
TileBlock[] |
splitOneGo() |
java.lang.String |
toString()
Really nice to string that outlines what tiles are filled
and what region this block covers.
|
int occX
int occY
int occW
int occH
int xOff
int yOff
int w
int h
int benefit
boolean[] occupied
TileBlock(int occX, int occY, int occW, int occH, boolean[] occupied, int xOff, int yOff, int w, int h)
xOff
- The x index of left edge of the tile block.yOff
- The y index of top edge of the tile block.w
- The number of tiles across in the blockh
- The number of tiles down the blockoccupied
- Which entries in the block are already
computed.public java.lang.String toString()
toString
in class java.lang.Object
int getXLoc()
int getYLoc()
int getWidth()
int getHeight()
int getBenefit()
int getWork()
static int getWork(TileBlock[] blocks)
TileBlock[] getBestSplit()
public TileBlock[] splitOneGo()
public boolean simplify()