|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectch.sahits.game.rendering.AbstractRenderPart
ch.sahits.game.graphic.display.gameplay.MainView
public class MainView
This represents the main game screen
| Field Summary | |
|---|---|
private CityPlayerProxy |
city
Model of the city currently displayed. |
private OpenPatricianGameDialog |
dialog
|
private double |
dialogScale
Scale of the dialog |
private static String[] |
imageNames
|
private BufferedImage |
img
This image holds the background of the currently rendered View |
private ch.sahits.game.graphic.image.ImagesLoader |
loader
|
private static String[] |
polyNames
|
private static byte |
PORT_SCENE
Indicate that currently the port scene is displayed |
private Map<Integer,NamedPolygon> |
portPolygons
Store the polygons for checking against clicking them Using a TreeMap so it may be possible do define polygons that cover the same are but in a different z-order. |
private byte |
viewState
Use low level byte to indicate what is displayed instead of an enum. |
| Fields inherited from class ch.sahits.game.rendering.AbstractRenderPart |
|---|
rect |
| Constructor Summary | |
|---|---|
MainView(Rectangle rect,
ch.sahits.game.graphic.image.ImagesLoader loader,
ch.sahits.game.openpatrician.client.IClient cl)
Instantiate the main view with the port scene of the players home town |
|
| Method Summary | |
|---|---|
private String |
findPolygon(int x,
int y)
Find the polygon name that contains the coordinates. |
void |
gameRender(Graphics gScr)
|
void |
gameUpdate(ch.sahits.game.event.Event e,
Object eventNotice)
|
private void |
initPortPolygons(double scale,
Rectangle bounds)
Setting the positions of the polygons on the screen |
private void |
resetDialog()
Scale the dialog so it has the correct proportions |
| Methods inherited from class ch.sahits.game.rendering.AbstractRenderPart |
|---|
getBounds, isEnabled, setEnabled |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final BufferedImage img
private OpenPatricianGameDialog dialog
private final double dialogScale
private static final String[] polyNames
private static final String[] imageNames
private final ch.sahits.game.graphic.image.ImagesLoader loader
private Map<Integer,NamedPolygon> portPolygons
private static final byte PORT_SCENE
private byte viewState
private CityPlayerProxy city
| Constructor Detail |
|---|
public MainView(Rectangle rect,
ch.sahits.game.graphic.image.ImagesLoader loader,
ch.sahits.game.openpatrician.client.IClient cl)
rect - loader - cl - | Method Detail |
|---|
private void resetDialog()
public void gameRender(Graphics gScr)
gameRender in interface ch.sahits.game.rendering.Renderable
public void gameUpdate(ch.sahits.game.event.Event e,
Object eventNotice)
gameUpdate in interface ch.sahits.game.event.IEventListenergameUpdate in interface ch.sahits.game.rendering.Renderable
private String findPolygon(int x,
int y)
x - coordinatey - coordinate
private void initPortPolygons(double scale,
Rectangle bounds)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||