|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectMIDlet
client.framework.models.AbstractGame
client.brickblock.fwimpl.BrickBlock
public class BrickBlock
The implementation of the abstract class AbstractGame
,
which contains the most important data for running a game in
the framework framework.
In addition to the default features offered by
AbstractGame
, this class contain support for
sending and receiving information about placing and picking
up PowerUp
objects.
Field Summary |
---|
Fields inherited from class client.framework.models.AbstractGame |
---|
communicator, game, lobby, MOVEMENT_PREDICTION, parser, self, SEP_ACTION, TEAMCOLORS |
Constructor Summary | |
---|---|
BrickBlock()
|
Method Summary | |
---|---|
protected GameView |
createGameView()
Returns a new GameView instance, which is this
game's implementation of the GameView class. |
protected void |
createSpecialSettings()
Not implemented. |
void |
fireForceMove(AbstractPlayer other,
int[] movement)
Called when the local player "force moves" (pushes) another player. |
void |
firePowerupPickedUp(Powerup powerup)
Called when the local player picks up a power up. |
BBBoard |
getGameBoard()
Returns the active game board used in the game. |
java.lang.String |
getGameName()
Returns the name of this game; "BrickBlock". |
protected boolean |
handleSpecialSettings(boolean init)
Not implemented. |
AbstractPlayer |
newPlayer(java.lang.String address,
java.lang.String name)
Returns a new BBPlayer instance, which is this
game's implementation of the AbstractPlayer
class. |
protected void |
notifyAboutSpecialActionReceived(AbstractPlayer sender,
java.lang.String action,
java.lang.String[][] values)
This method is responsible for parsing the incoming actions that can not be parsed by the notifyAboutMessageReceived() method in
AbstractGame . |
void |
startFramework(java.lang.String name,
java.lang.String[] addresses,
int packetSize)
Initialises the framework. |
Methods inherited from class client.framework.models.AbstractGame |
---|
addPlayer, addSetting, destroyApp, fireChangeSettingsSelected, fireHitTrap, fireMessagesChanged, firePlayerListChanged, firePlayerReady, fireReadySelected, fireReturnToGameSelected, fireSelfMoved, fireSessionSelected, fireSettingsUpdated, flashAndVibrate, getNumberOfPlayers, getParser, getPlayer, getPlayerlist, getSelf, getSessions, getSettings, getView, isTeamsEnabled, loadGame, notifyAboutMessageReceived, pauseApp, quit, refreshSessionList, removePlayer, sendPlayerInfo, setView, showAlert, startApp, startGame, stopGame, viewLobby |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BrickBlock()
Method Detail |
---|
public void startFramework(java.lang.String name, java.lang.String[] addresses, int packetSize)
startFramework
in class AbstractGame
name
- The name of the local player.addresses
- The address(es) of the server(s) to connect topacketSize
- The maximum packet size (when using UDP)public AbstractPlayer newPlayer(java.lang.String address, java.lang.String name)
BBPlayer
instance, which is this
game's implementation of the AbstractPlayer
class.
newPlayer
in class AbstractGame
address
- The player's address.name
- The player's name.
BBPlayer
instance.AbstractPlayer.AbstractPlayer(String, String, int, int)
protected GameView createGameView()
GameView
instance, which is this
game's implementation of the GameView
class.
createGameView
in class AbstractGame
BBBoard
using this as its model.public BBBoard getGameBoard()
createGameView()
public java.lang.String getGameName()
getGameName
in class AbstractGame
public void firePowerupPickedUp(Powerup powerup)
Communicator
object.
powerup
- The power up picked up or timed outMessageParser.createMessage(client.framework.network.parser.Action, Object[][])
,
Communicator.sendMessage(Object, boolean)
public void fireForceMove(AbstractPlayer other, int[] movement)
other
- The player that is pushed.movement
- How much the player is pushed.MessageParser.createMessage(client.framework.network.parser.Action, Object[][])
,
Communicator.sendMessage(Object, boolean)
protected void notifyAboutSpecialActionReceived(AbstractPlayer sender, java.lang.String action, java.lang.String[][] values)
notifyAboutMessageReceived()
method in
AbstractGame
.
These actions are related to either positioning power up or trap
objects on the board, players picking up power up
objects, power ups being deactivated, or one player pushing another on the game
board. Dependent of what kind of action is received,
different methods are called.
notifyAboutSpecialActionReceived
in class AbstractGame
sender
- The sender of the action.action
- The action that has been performed.values
- String containing a single value or a composite value.AbstractGame.notifyAboutMessageReceived(String)
protected void createSpecialSettings()
protected boolean handleSpecialSettings(boolean init)
handleSpecialSettings
in class AbstractGame
init
- Whether the check is performed on game initialisation.
AbstractGame.handleSettings(boolean)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |