|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Callback interface for objects wanting to know whenever any object is added to, or removed from, a GameMap.
Note: the methods of this interface won't be called while the map is loading. This speeds up map loading, as thousands of objects are added to the map. It also makes implementations of this interface more deterministic, since objects can be added to a map in any order - your listener may be added after an object that it's interesting in hearing about. You can use the "done-loading" map method-hook to check whether a given object is in a given position after it finishes loading.
Method Summary | |
void |
objectAdded(GameMap map,
int x,
int y,
GameObject obj)
A reference to a GameObject was added to the map at the specified location. |
void |
objectRemoved(GameMap map,
int x,
int y,
GameObject obj)
A reference to a GameObject was removed from the map at the specified location. |
Method Detail |
public void objectAdded(GameMap map, int x, int y, GameObject obj)
Note that when a large object is moving in the map, any locations that it occupies both before and after the move may or may not get add() and remove() called for them, depending on the map implementation.
map
- the map calling this methodx
- the map x location where the object was addedy
- the map y location where the object was addedobj
- the GameObject being added.public void objectRemoved(GameMap map, int x, int y, GameObject obj)
Note that the object may not be entirely gone from the map when this is called - it may still have other references in other locations. To be notified when an object is completely removed from the map, get on the object's "remove" method-hook.
map
- the map calling this methodx
- the map x location where the object reference was removedy
- the map y location where the object reference was removedobj
- the GameObject reference being removed from this location
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |