|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.jetrix.Field
public class Field
A game field.
| Field Summary | |
|---|---|
static byte |
BLOCK_BLUE
|
static byte |
BLOCK_GREEN
|
static byte |
BLOCK_PREVIOUS
|
static byte |
BLOCK_PURPLE
|
static byte |
BLOCK_RED
|
static byte |
BLOCK_VOID
|
static byte |
BLOCK_YELLOW
|
static int |
HEIGHT
|
static int |
WIDTH
|
| Constructor Summary | |
|---|---|
Field()
|
|
Field(byte[][] field)
|
|
| Method Summary | |
|---|---|
void |
clear()
Clear the field. |
boolean |
contains(Special special)
Check if the field contains the specified special block. |
boolean |
containsSpecialBlock()
Check if the field contains a special block. |
byte |
getBlock(int x,
int y)
Return the block at the specified location. (0, 0) is the bottom left block, and (11, 21) is the upper right block. |
String |
getFieldString()
Return the string representing this field as used in the FieldMessage messages. |
int |
getHighest()
Return the height of the highest block. |
boolean |
hasHoles()
Check if the field has holes (i.e. if a gravity block may have an effect). |
boolean |
isEmpty()
Check if the field is empty. |
void |
load(InputStream in)
Load the field from the specified stream |
void |
load(String file)
Load the field from the specified file |
void |
save(String file)
Save the field to the specified file. |
void |
update(FieldMessage message)
Update the field with the specified FieldMessage. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int WIDTH
public static final int HEIGHT
public static final byte BLOCK_VOID
public static final byte BLOCK_BLUE
public static final byte BLOCK_YELLOW
public static final byte BLOCK_GREEN
public static final byte BLOCK_PURPLE
public static final byte BLOCK_RED
public static final byte BLOCK_PREVIOUS
| Constructor Detail |
|---|
public Field()
public Field(byte[][] field)
| Method Detail |
|---|
public boolean isEmpty()
public boolean contains(Special special)
special - the special to checkpublic boolean containsSpecialBlock()
public boolean hasHoles()
public int getHighest()
public void update(FieldMessage message)
public String getFieldString()
FieldMessage messages.
public byte getBlock(int x,
int y)
x - y - public void clear()
public void load(InputStream in)
throws IOException
IOException
public void load(String file)
throws IOException
IOException
public void save(String file)
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||