Modifier and Type | Field and Description |
---|---|
protected Block[] |
blocks |
static int |
BUFFER |
protected short |
CLEAR |
protected int |
comboMultiplier |
protected long |
comboScore |
static int |
DEFAULT_HEIGHT |
static int |
DEFAULT_WIDTH |
protected static Block |
GARBAGE_BLOCK |
int |
HEIGHT |
protected ShapeType |
hold |
protected long |
lines |
protected short[] |
mask |
protected ShapeType[] |
next |
protected boolean |
noBlocks |
protected long |
score |
protected static long |
SPAWN_MASK |
protected long[] |
typeBlitCounts |
protected short |
WALL |
int |
WIDTH |
Modifier and Type | Method and Description |
---|---|
void |
blit(int xyshape,
long id)
|
Block |
block(int x,
int y)
Returns the block at the specified row
y and col x |
void |
clear(int y)
Clears row
y , shifting all above rows down |
int |
clearLines()
Find and clear any solid lines, and return the number of lines cleared
|
Field |
clone() |
void |
copyFrom(Field other) |
protected short |
get(int y) |
long |
getComboScore() |
ShapeType |
getHold() |
long |
getLines() |
ShapeType[] |
getNext() |
long |
getScore() |
long[] |
getTypeBlitCounts() |
protected long |
imask(int y)
Returns an intersection mask starting at row
y |
boolean |
intersects(int xyshape)
Returns whether
s intersects with existing blocks according to the mask |
boolean |
isNoBlocks() |
boolean |
isSpawnEndangered() |
short |
mask(int y)
Returns a mask of cols 0-9 at row
y |
boolean |
masked(int x,
int y)
Returns whether the block at row
y col x is masked |
void |
reset() |
protected void |
set(int y,
short v) |
void |
setBlock(int x,
int y,
Block b) |
void |
setHold(ShapeType hold) |
void |
setNext(ShapeType[] next) |
void |
setNoBlocks(boolean noBlocks) |
void |
shiftUp(short trashMask) |
String |
toString() |
public static final int DEFAULT_WIDTH
public static final int DEFAULT_HEIGHT
public static final int BUFFER
protected static final long SPAWN_MASK
protected static final Block GARBAGE_BLOCK
public final int WIDTH
public final int HEIGHT
protected final short WALL
protected final short CLEAR
protected short[] mask
protected Block[] blocks
protected long lines
protected long score
protected int comboMultiplier
protected long comboScore
protected long[] typeBlitCounts
protected boolean noBlocks
protected ShapeType hold
protected ShapeType[] next
public void copyFrom(Field other)
public void reset()
protected short get(int y)
protected void set(int y, short v)
protected long imask(int y)
y
y
- public boolean intersects(int xyshape)
s
intersects with existing blocks according to the masks
- public boolean isSpawnEndangered()
public void blit(int xyshape, long id)
s
- public void clear(int y)
y
, shifting all above rows downy
- public int clearLines()
public void shiftUp(short trashMask)
public boolean masked(int x, int y)
y
col x
is maskedx
- y
- public short mask(int y)
y
y
- public Block block(int x, int y)
y
and col x
x
- 0 <= x < WIDTHy
- -4 <= y < HEIGHT + 4public void setBlock(int x, int y, Block b)
public long getLines()
public long getScore()
public long getComboScore()
public long[] getTypeBlitCounts()
public boolean isNoBlocks()
public void setNoBlocks(boolean noBlocks)
public ShapeType getHold()
public void setHold(ShapeType hold)
public ShapeType[] getNext()
public void setNext(ShapeType[] next)
Copyright © 2015. All rights reserved.