|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.b3dgs.lionengine.game.hacknslash.AbstractItem<TTile>
public abstract class AbstractItem<TTile extends AbstractPathTile>
Represents an item which can be hold by a Hero. Items has to be handled by an AbstractItemHandler. They can be placed in a bag, represented by a box. Each item has its own box size, in order to fill the bag.
AbstractItemHandler
,
AbstractHero
Field Summary | |
---|---|
protected int |
boxSize
|
protected int |
heightOnMap
|
protected int |
heightOnPanel
|
protected int |
widthOnMap
|
protected int |
widthOnPanel
|
protected int |
x
|
protected int |
y
|
Constructor Summary | |
---|---|
AbstractItem(int boxSize,
int widthOnPanel,
int heightOnPanel,
int widthOnMap,
int heightOnMap)
Create a new abstract item. |
Method Summary | |
---|---|
abstract boolean |
canBePicked(Entity owner)
Check if item can be picked from the map. |
boolean |
collideOnMap(StrategyCursor cursor)
Check if cursor hit item on map. |
boolean |
collideOnPanel(AbstractItem<TTile> item)
Check if item collide with another item on bag. |
boolean |
collideOnPanel(StrategyCursor cursor,
int offsetX,
int offsetY)
Check if cursor collide current item. |
void |
drop(TileBasedMap<TTile> map)
Drop item on map from owner location. |
int |
getHeightOnMap()
Get item height (in tile). |
int |
getHeightOnPanel()
Get item height (in box). |
int |
getWidthOnMap()
Get item width (in tile). |
int |
getWidthOnPanel()
Get item width (in box). |
void |
placeOnMap(int tx,
int ty)
Set item location on map. |
void |
placeOnPanel(int bx,
int by)
Set item location in bag. |
abstract void |
render(java.awt.Graphics2D g,
int panelX,
int panelY)
Render item on bag. |
abstract void |
render(java.awt.Graphics2D g,
StrategyCamera camera,
TileBasedMap<TTile> map)
Render item on map. |
void |
setOwner(Entity owner)
Set item owner reference. |
abstract void |
update(StrategyCursor cursor)
Update item on bag. |
abstract void |
update(StrategyCursor cursor,
TileBasedMap<TTile> map)
Update item on map. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int x
protected int y
protected int widthOnPanel
protected int heightOnPanel
protected int widthOnMap
protected int heightOnMap
protected int boxSize
Constructor Detail |
---|
public AbstractItem(int boxSize, int widthOnPanel, int heightOnPanel, int widthOnMap, int heightOnMap)
boxSize
- size of a box from the bag grid (in pixel).widthOnPanel
- item width (in box).heightOnPanel
- item height (in box).widthOnMap
- item width (in tile).heightOnMap
- item height (in tile).Method Detail |
---|
public void setOwner(Entity owner)
owner
- owner reference.public void drop(TileBasedMap<TTile> map)
map
- map reference.public void placeOnPanel(int bx, int by)
bx
- location x (in box).by
- location y (in box).public void placeOnMap(int tx, int ty)
tx
- location x (in tile).ty
- location y (in tile).public boolean collideOnPanel(AbstractItem<TTile> item)
item
- collide item reference.
public boolean collideOnPanel(StrategyCursor cursor, int offsetX, int offsetY)
cursor
- cursor reference.offsetX
- bag panel location x.offsetY
- bag panel location y.
public boolean collideOnMap(StrategyCursor cursor)
cursor
- cursor reference.
public abstract boolean canBePicked(Entity owner)
owner
- future owner reference.
public abstract void update(StrategyCursor cursor, TileBasedMap<TTile> map)
cursor
- cursor reference.map
- map reference.public abstract void update(StrategyCursor cursor)
cursor
- cursor reference.public abstract void render(java.awt.Graphics2D g, int panelX, int panelY)
g
- graphics output.panelX
- bag panel location x.panelY
- bag panel location y.public abstract void render(java.awt.Graphics2D g, StrategyCamera camera, TileBasedMap<TTile> map)
g
- graphics output.camera
- camera reference.map
- map reference.public int getWidthOnPanel()
public int getHeightOnPanel()
public int getWidthOnMap()
public int getHeightOnMap()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |