|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.b3dgs.lionengine.game.purviews.Configurable
com.b3dgs.lionengine.game.Entity
com.b3dgs.lionengine.game.strategy.AbstractEntry<TTile,TSkill,TAttr>
com.b3dgs.lionengine.game.strategy.AbstractBuilding<TTile,TSkill,TAttr>
TTile
- tile type used.TSkill
- skill type used.TAttr
- attributes type used.public abstract class AbstractBuilding<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
This class represents any kind of building as a standard. It includes any future manufactory, defensive building, and more.
Field Summary | |
---|---|
protected BuilderAbility<TTile,TSkill,TAttr> |
builder
Builder reference. |
Fields inherited from class com.b3dgs.lionengine.game.strategy.AbstractEntry |
---|
anim, animName, attr, icon, id, lastAttacker, life, map, offsetX, offsetY, sprite |
Fields inherited from class com.b3dgs.lionengine.game.Entity |
---|
collisionable, height, mirrorable, width, x, xOld, y, yOld |
Constructor Summary | |
---|---|
AbstractBuilding(java.lang.String data,
PathBasedMap<TTile> map,
java.awt.image.BufferedImage surface,
TAttr attr)
Create a new building. |
Method Summary | |
---|---|
int |
getBuildingProgress()
Get the current building progress in percent. |
boolean |
isUnderConstruction()
Get constructing state. |
abstract void |
onConstructed()
Action called when construction is done. |
abstract void |
onConstructing()
Action called while the building is under construction. |
abstract void |
onDestroyed()
Action called when the building is destroyed (no life remains). |
abstract void |
onStartConstruction()
Action called when builder is going to start construction. |
void |
place(int tx,
int ty)
Set specific location in tile. |
void |
setBuilder(BuilderAbility<TTile,TSkill,TAttr> builder)
Store builder reference. |
void |
setBuildingTime(long buildingTime)
Set the time needed for the construction (in milliseconds). |
void |
startConstruction(int tx,
int ty)
Begin construction to specified location, prepare all states. |
void |
update(Keyboard keyboard,
Mouse mouse,
float extrp)
Main routine, has to be called in a game loop. |
void |
updateConstruction(float extrp)
Update construction progress. |
void |
updateMirror()
Deprecated. Call update function instead, as it override it. Call it manually only if you plan a specific update. |
Methods inherited from class com.b3dgs.lionengine.game.strategy.AbstractEntry |
---|
addSkill, applyOrder, applyOrder, getAnimState, getDistance, getDistance, getFieldOfView, getFrame, getHeight, getHeightInTile, getLayer, getLayerOld, getOrderedSkill, getOwnerID, getRealFrame, getSkill, getSkills, getWidth, getWidthInTile, getXInTile, getXOffset, getYInTile, getYOffset, hasChangedLayer, isActive, isAlive, isOver, isRemoved, isSelected, isUnselected, isVisible, onHit, onKilled, onOrdered, onOrderedFail, onSelection, play, play, play, remove, removeRef, removeSkill, render, setActive, setAlive, setAnimation, setFieldOfView, setFrame, setLayer, setLayerChanged, setOrderedSkill, setOver, setOwnerID, setSelection, setSkipLastFrameOnReverse, setVisibility, stopAnimation, unselect, updateAnimation |
Methods inherited from class com.b3dgs.lionengine.game.Entity |
---|
backupCoord, cancelMirror, collide, collide, getCancelMirror, getCollision, getMirror, getRay, getX, getXOld, getXReal, getY, getYOld, getYReal, invertYAxis, mirror, move, renderCollision, updateCollision |
Methods inherited from class com.b3dgs.lionengine.game.purviews.Configurable |
---|
checkInstruction, getAnim, getCollArea, getData, getDataBool, getDataInt, getDataString, getRange, loadData |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected BuilderAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes> builder
Constructor Detail |
---|
public AbstractBuilding(java.lang.String data, PathBasedMap<TTile> map, java.awt.image.BufferedImage surface, TAttr attr)
data
- building data file path.map
- map reference.surface
- building image file path.attr
- attributes reference.Method Detail |
---|
public void update(Keyboard keyboard, Mouse mouse, float extrp)
AbstractEntry
update
in class AbstractEntry<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
keyboard
- keyboard reference.mouse
- mouse reference.extrp
- extrapolation value.@Deprecated public void updateMirror()
Mirrorable
updateMirror
in interface Mirrorable
updateMirror
in class Entity
public void place(int tx, int ty)
AbstractEntry
place
in class AbstractEntry<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
tx
- horizontal tile location.ty
- vertical tile location.public void startConstruction(int tx, int ty)
tx
- location x in tile.ty
- location y in tile.public void updateConstruction(float extrp)
extrp
- public void setBuilder(BuilderAbility<TTile,TSkill,TAttr> builder)
builder
- builder reference.public void setBuildingTime(long buildingTime)
buildingTime
- number of milliseconds.public int getBuildingProgress()
public boolean isUnderConstruction()
public abstract void onStartConstruction()
public abstract void onConstructing()
public abstract void onConstructed()
public abstract void onDestroyed()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |