|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--Mappy.Block
Mappy Block v1.10
This class represents a Block as used by Mappy.
A Block may contain up to 4 layers of images (1 background layer
and 3 foreground layers), 7 fields of User data, quadratic collision information
and 4 other flags.
| Field Summary | |
int |
BACKGROUND
A Block Image layer. |
int |
COLLISION_BOTTOM_LEFT
A flag used in collision detection. |
int |
COLLISION_BOTTOM_RIGHT
A flag used in collision detection. |
int |
COLLISION_TOP_LEFT
A flag used in collision detection. |
int |
COLLISION_TOP_RIGHT
A flag used in collision detection. |
int |
FOREGROUND1
A Block Image layer. |
int |
FOREGROUND2
A Block Image layer. |
int |
FOREGROUND3
A Block Image layer. |
int |
MAX_USER_DATA
A minimum index for User Data. |
int |
MIN_USER_DATA
A minimum index for User Data. |
int |
TRIGGER
A User defined flag. |
int |
UNUSED1
A User defined flag. |
int |
UNUSED2
A User defined flag. |
int |
UNUSED3
A User defined flag. |
| Constructor Summary | |
protected |
Mappy.Block()
Only Mappycan contruct Block classes. |
| Method Summary | |
void |
debug(java.lang.String strText)
Logs the Block's current state. |
boolean |
getFlag(int intFlag)
Returns the specified Flag. |
int |
getImageIndex(int intImageLayer)
Returns the Image index of the given Block layer. |
int |
getUserData(int intIndex)
Returns the specified User Data. |
void |
setFlag(int intFlag,
boolean blnNewFlag)
Sets the specified Flag. |
void |
setImageIndex(int intImageLayer,
int intNewImageIndex)
Sets the Image of the given Block layer. |
void |
setUserData(int intIndex,
int intNewUserData)
Sets the specified User Data. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public final int BACKGROUND
Block Image layer.
setImageIndex(int, int),
getImageIndex(int),
Constant Field Valuespublic final int FOREGROUND1
Block Image layer.
setImageIndex(int, int),
getImageIndex(int),
Constant Field Valuespublic final int FOREGROUND2
Block Image layer.
setImageIndex(int, int),
getImageIndex(int),
Constant Field Valuespublic final int FOREGROUND3
Block Image layer.
setImageIndex(int, int),
getImageIndex(int),
Constant Field Valuespublic final int MIN_USER_DATA
setUserData(int, int),
getUserData(int),
Constant Field Valuespublic final int MAX_USER_DATA
setUserData(int, int),
getUserData(int),
Constant Field Valuespublic final int COLLISION_TOP_LEFT
setFlag(int, boolean),
getFlag(int),
Constant Field Valuespublic final int COLLISION_TOP_RIGHT
setFlag(int, boolean),
getFlag(int),
Constant Field Valuespublic final int COLLISION_BOTTOM_LEFT
setFlag(int, boolean),
getFlag(int),
Constant Field Valuespublic final int COLLISION_BOTTOM_RIGHT
setFlag(int, boolean),
getFlag(int),
Constant Field Valuespublic final int TRIGGER
setFlag(int, boolean),
getFlag(int),
Constant Field Valuespublic final int UNUSED1
setFlag(int, boolean),
getFlag(int),
Constant Field Valuespublic final int UNUSED2
setFlag(int, boolean),
getFlag(int),
Constant Field Valuespublic final int UNUSED3
setFlag(int, boolean),
getFlag(int),
Constant Field Values| Constructor Detail |
protected Mappy.Block()
Mappycan contruct Block classes.
| Method Detail |
public void setImageIndex(int intImageLayer,
int intNewImageIndex)
Block layer.
intImageLayer - the layer who's image is to be updated.intNewImageIndex - the index of the new Image.getImageIndex(int),
BACKGROUND,
FOREGROUND1,
FOREGROUND2,
FOREGROUND3public int getImageIndex(int intImageLayer)
Block layer.
intImageLayer - the Block layer who's Image
index is to be returned.
Block layer.setImageIndex(int, int),
BACKGROUND,
FOREGROUND1,
FOREGROUND2,
FOREGROUND3
public void setUserData(int intIndex,
int intNewUserData)
intIndex is out of bounds then an error is logged
(not thrown) and the method aborted.
intIndex - the User Data to be updated.intNewUserData - the new User Data.getUserData(int),
MIN_USER_DATA,
MAX_USER_DATApublic int getUserData(int intIndex)
intIndex is out of bounds then an error is logged
(not thrown) and the method aborted.
intIndex - the User Data to be returned.
setUserData(int, int),
MIN_USER_DATA,
MAX_USER_DATA
public void setFlag(int intFlag,
boolean blnNewFlag)
intFlag is unknown then an error is logged (not
thrown) and the method aborted.
intFlag - the Flag to be set.blnNewFlag - the new Flag.getFlag(int),
COLLISION_TOP_LEFT,
COLLISION_TOP_RIGHT,
COLLISION_BOTTOM_LEFT,
COLLISION_BOTTOM_RIGHT,
TRIGGER,
UNUSED1,
UNUSED2,
UNUSED3public boolean getFlag(int intFlag)
intFlag is unknown then an error is logged (not
thrown) and the method aborted.
intFlag - the Flag to be returned.
setFlag(int, boolean),
COLLISION_TOP_LEFT,
COLLISION_TOP_RIGHT,
COLLISION_BOTTOM_LEFT,
COLLISION_BOTTOM_RIGHT,
TRIGGER,
UNUSED1,
UNUSED2,
UNUSED3public void debug(java.lang.String strText)
Block's current state.
strText - the purpose of the debug, this decription is logged
along with the Block's state.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||