|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.farafin.snEADy.communication.D_Level
public final class D_Level
The Level with all its informations
Field Summary | |
---|---|
java.lang.String |
author
the author of the level |
java.lang.String |
comment
Comment to this arena |
java.lang.String |
fileName
the filename of the level |
int |
height
height of the playfield |
int |
maxPlayer
the number of maximum player this level was designt for |
java.lang.String |
name
name of the arena |
char[][] |
playField
the playfield of the game |
int |
width
width of the playfield |
Fields inherited from interface de.farafin.snEADy.communication.I_PlayFieldConstants |
---|
EXIT, FIELD_B, FIELD_C, FIELD_D, FIELD_E, FIELD_F, FIELD_G, FIELD_H, FIELD_I, FIELD_J, FIELD_K, FIELD_L, FIELD_M, FIELD_N, FIELD_O, FIELD_P, FIELD_Q, FIELD_R, FIELD_S, FIELD_T, FIELD_U, FIELD_V, FIELD_W, FIELD_X, FIELD_Y, FIELD_Z, FREE, GOODY_f, GOODY_g, GOODY_h, GOODY_i, GOODY_j, GOODY_k, GOODY_l, GOODY_LAST, GOODY_m, GOODY_n, GOODY_o, GOODY_p, GOODY_q, GOODY_r, GOODY_s, GOODY_START, GOODY_t, GOODY_u, GOODY_v, GOODY_w, GOODY_x, GOODY_y, GOODY_z, LENGTH, PLAYER_0, PLAYER_1, PLAYER_2, PLAYER_3, PLAYER_4, PLAYER_5, PLAYER_6, PLAYER_7, PLAYER_8, PLAYER_9, POINTS, SHORT, SLOW, SPEED, WALL |
Constructor Summary | |
---|---|
D_Level()
default - constructor |
|
D_Level(D_Level level)
copy - constructor reference-copy of attrbutes: use copy() if you need a full copy |
|
D_Level(java.lang.String name,
int height,
int width,
char[][] playField,
int maxPlayer)
arena-based constructor |
|
D_Level(java.lang.String fileName,
java.lang.String name,
java.lang.String author,
char[][] playField,
int maxPlayer)
constructor |
|
D_Level(java.lang.String fileName,
java.lang.String name,
java.lang.String author,
int height,
int width,
char[][] playField,
int maxPlayer)
create - constructor |
Method Summary | |
---|---|
java.lang.Object |
clone()
|
void |
copyOnMe(D_Level level)
copys all data from level to the lokal instance. there is no new Instance created if
all array sizes fit to each other |
char |
getCharOf(D_Vec2D vec)
returns the character of the specified coordinates |
char |
getCharOf(int y,
int x)
returns the character of the specified coordinates |
int |
getHeight()
|
char[] |
getLineCopy(int l)
|
int |
getMaxPlayer()
|
java.lang.String |
getName()
|
char[][] |
getPlayFieldCopy()
|
char[] |
getRowCopy(int r)
|
int |
getWidth()
|
protected boolean |
isFieldOfLevel(D_Vec2D vec)
tests if the coordinates are element of the playField |
protected boolean |
isFieldOfLevel(int y,
int x)
tests if the coordinates are element of the playField |
boolean |
isFree(D_Vec2D vec)
|
boolean |
isFree(int y,
int x)
|
boolean |
isGoody(D_Vec2D vec)
|
boolean |
isGoody(int y,
int x)
|
boolean |
isSnake(D_Vec2D vec)
|
boolean |
isSnake(int y,
int x)
|
boolean |
isSpecialField(D_Vec2D vec)
|
boolean |
isSpecialField(int y,
int x)
|
boolean |
isWall(D_Vec2D vec)
|
boolean |
isWall(int y,
int x)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public java.lang.String fileName
public java.lang.String name
public java.lang.String comment
public java.lang.String author
public int height
public int width
public char[][] playField
public int maxPlayer
Constructor Detail |
---|
public D_Level()
public D_Level(java.lang.String fileName, java.lang.String name, java.lang.String author, int height, int width, char[][] playField, int maxPlayer)
fileName
- name
- author
- height
- width
- playField
- maxPlayer
- public D_Level(java.lang.String fileName, java.lang.String name, java.lang.String author, char[][] playField, int maxPlayer)
fileName
- name
- author
- playField
- maxPlayer
- public D_Level(D_Level level)
level
- public D_Level(java.lang.String name, int height, int width, char[][] playField, int maxPlayer)
name
- height
- width
- playField
- maxPlayer
- Method Detail |
---|
public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
protected boolean isFieldOfLevel(int y, int x)
y
- linex
- row
protected boolean isFieldOfLevel(D_Vec2D vec)
vec
- coordinate as 2D-vector
public char[][] getPlayFieldCopy()
public char getCharOf(int y, int x)
y
- line numberx
- row number
public char getCharOf(D_Vec2D vec)
vec
- the vector of the field that should returned
public char[] getLineCopy(int l)
l
- lineNumber
public char[] getRowCopy(int r)
r
- rowNumber
public int getHeight()
public int getMaxPlayer()
public java.lang.String getName()
public int getWidth()
public boolean isFree(int y, int x)
y
- linex
- row
I_PlayFieldConstants
public boolean isFree(D_Vec2D vec)
vec
- controll this position
vec
positionI_PlayFieldConstants
public boolean isWall(int y, int x)
y
- linex
- row
I_PlayFieldConstants
public boolean isWall(D_Vec2D vec)
vec
- controll this position
vec
positionI_PlayFieldConstants
public boolean isSnake(int y, int x)
y
- linex
- row
I_PlayFieldConstants
public boolean isSnake(D_Vec2D vec)
vec
- controll this position
vec
positionI_PlayFieldConstants
public boolean isGoody(int y, int x)
y
- linex
- row
I_PlayFieldConstants
public boolean isGoody(D_Vec2D vec)
vec
- controll this position
vec
positionI_PlayFieldConstants
public boolean isSpecialField(int y, int x)
y
- linex
- row
I_PlayFieldConstants
public boolean isSpecialField(D_Vec2D vec)
vec
- controll this position
vec
positionI_PlayFieldConstants
public void copyOnMe(D_Level level)
level
to the lokal instance. there is no new Instance created if
all array sizes fit to each other
level
- the origin where the date should be copyed from
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |