|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--nankin.zheng.gatem.model.Role
|
+--nankin.zheng.gatem.model.Background
Background is in charge of the background of game, and it keeps and updates the viewport of the game.
Viewport is the visual part of the game background. Before every role is drawn onto the screen, the position of the viewport should be notified to DisplayCache.
NOTE that Background extends Role, and only one method notifyViewport() is added.
| Field Summary | |
protected Position |
viewport
Positon of the viewport. |
| Fields inherited from class nankin.zheng.gatem.model.Role |
attrSet, container, env, view |
| Constructor Summary | |
Background(GameContainer gcont,
Env environ,
BackgroundView v)
Constructor. |
|
| Method Summary | |
void |
notifyViewport()
Notify the viewport of the game to DisplayCache. |
void |
testInitialization()
Verify whether this Background object is initialized properly. |
java.lang.String |
toString()
Convert to String. |
| Methods inherited from class nankin.zheng.gatem.model.Role |
act, draw, getCreatedInstanceCount, init, receiveGameEvent |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected Position viewport
| Constructor Detail |
public Background(GameContainer gcont,
Env environ,
BackgroundView v)
throws GameException
gcont - game container.environ - game environment.v - RoleView object.
GameException - if cannot set background of game container| Method Detail |
public void testInitialization()
throws GameException
testInitialization in class RoleGameException - if it is not initialized properly.
public void notifyViewport()
throws GameException
GameExceptionpublic java.lang.String toString()
toString in class Role
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||