|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.b3dgs.lionengine.game.AbstractWorld
public abstract class AbstractWorld
Default world model, designed to contain game elements (map, player, entitys...). This model already handle support of filtering, intermediate buffer, and useful tools.
Field Summary | |
---|---|
float |
factX
Screen factor (horizontal-vertical); difference between current/ref width-height. |
float |
factY
Screen factor (horizontal-vertical); difference between current/ref width-height. |
int |
height
Screen size (width-height). |
Initializer |
init
Initializer reference. |
protected int |
mapViewH
Represents the number of visible horizontal-vertical tiles. |
protected int |
mapViewV
Represents the number of visible horizontal-vertical tiles. |
Screen |
screen
Screen reference. |
int |
width
Screen size (width-height). |
Constructor Summary | |
---|---|
AbstractWorld(Screen screen)
Create a new world. |
Method Summary | |
---|---|
void |
calculateMapView(TileBasedMap<?> map)
Need to be called when the map is built, in order to know its visibility on screen. |
void |
calculateMapView(TileBasedMap<?> map,
AbstractControlPanel<?,?,?> panel)
Calculate map view from a control panel (mainly for strategy game). |
int |
getHorizontalMapView()
Get the number of horizontal viewable map tiles. |
int |
getVerticalMapView()
Get the number of vertical viewable map tiles. |
protected abstract void |
load(FileReader file)
Internal world loads. |
protected abstract void |
load(XMLNode world)
Internal world loads. |
void |
loadFromFile(java.lang.String filename)
Load world from the specified file. |
void |
loadFromXML(java.lang.String filename)
Load world from the specified file in XML. |
protected abstract void |
render(java.awt.Graphics2D g)
Internal world rendering. |
protected abstract void |
save(FileWriter file)
Internal world saves. |
protected abstract void |
save(XMLNode world)
Internal world saves. |
void |
saveToFile(java.lang.String filename)
Save world to the specified file. |
void |
saveToXML(java.lang.String filename)
Save world to the specified file using XML. |
abstract void |
update(Keyboard keyboard,
Mouse mouse,
float extrp)
Update world, and input calls. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final Screen screen
public final Initializer init
public final int width
public final int height
public final float factX
public final float factY
protected int mapViewH
protected int mapViewV
Constructor Detail |
---|
public AbstractWorld(Screen screen)
screen
- screen reference.Method Detail |
---|
public void calculateMapView(TileBasedMap<?> map)
map
- map reference.public void calculateMapView(TileBasedMap<?> map, AbstractControlPanel<?,?,?> panel)
map
- map reference.panel
- control panel reference.public int getHorizontalMapView()
public int getVerticalMapView()
public abstract void update(Keyboard keyboard, Mouse mouse, float extrp)
keyboard
- keyboard reference.mouse
- mouse reference.extrp
- extrapolation value.protected abstract void render(java.awt.Graphics2D g)
g
- graphic output.protected abstract void save(FileWriter file) throws java.io.IOException
file
- file writer reference.
java.io.IOException
- error on writing.protected abstract void load(FileReader file) throws java.io.IOException
file
- file reader reference.
java.io.IOException
- error on reading.protected abstract void save(XMLNode world)
world
- node reference.protected abstract void load(XMLNode world)
world
- node reference.public final void saveToFile(java.lang.String filename)
filename
- output file.public final void saveToXML(java.lang.String filename)
filename
- output file.public final void loadFromFile(java.lang.String filename)
filename
- input file.public final void loadFromXML(java.lang.String filename)
filename
- input file.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |