erland.game.tetris
Class TetrisModelNetworked

java.lang.Object
  extended by erland.game.tetris.TetrisModelNetworked
All Implemented Interfaces:
TetrisModelInterface, NetworkClientListenerInterface

public class TetrisModelNetworked
extends Object
implements TetrisModelInterface, NetworkClientListenerInterface


Constructor Summary
TetrisModelNetworked(String hostname, String username, String password)
           
 
Method Summary
 void connected(NetworkConnectionInterface connection)
           
 void disconnected(NetworkConnectionInterface connection)
           
protected  erland.game.tetris.Block getBlockFromString(erland.game.tetris.Block oldBlock, String message)
           
 String getHighScore()
           
 String getLevel()
           
 erland.game.tetris.BlockContainerData getMainContainer()
           
 erland.game.tetris.Block getNextBlock()
           
 String getOpponentLevel()
           
 erland.game.tetris.BlockContainerData getOpponentMainContainer()
           
 String getOpponentScore()
           
 String getScore()
           
 void init(GameEnvironmentInterface environment)
           
protected  void initNewGame()
           
 boolean isCompleted()
           
 boolean isEnd()
           
 boolean isMultiplayer()
           
 boolean isOpponentConnected()
           
 boolean isStarted()
           
 void message(NetworkConnectionInterface connection, String message)
           
 void moveDown()
           
 void moveLeft()
           
 void moveRight()
           
 void rotate()
           
 void startGame()
           
 void update()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TetrisModelNetworked

public TetrisModelNetworked(String hostname,
                            String username,
                            String password)
Method Detail

getMainContainer

public erland.game.tetris.BlockContainerData getMainContainer()
Specified by:
getMainContainer in interface TetrisModelInterface

getNextBlock

public erland.game.tetris.Block getNextBlock()
Specified by:
getNextBlock in interface TetrisModelInterface

getOpponentMainContainer

public erland.game.tetris.BlockContainerData getOpponentMainContainer()
Specified by:
getOpponentMainContainer in interface TetrisModelInterface

isEnd

public boolean isEnd()
Specified by:
isEnd in interface TetrisModelInterface

isStarted

public boolean isStarted()
Specified by:
isStarted in interface TetrisModelInterface

isCompleted

public boolean isCompleted()
Specified by:
isCompleted in interface TetrisModelInterface

getHighScore

public String getHighScore()
Specified by:
getHighScore in interface TetrisModelInterface

getScore

public String getScore()
Specified by:
getScore in interface TetrisModelInterface

getOpponentScore

public String getOpponentScore()
Specified by:
getOpponentScore in interface TetrisModelInterface

getLevel

public String getLevel()
Specified by:
getLevel in interface TetrisModelInterface

getOpponentLevel

public String getOpponentLevel()
Specified by:
getOpponentLevel in interface TetrisModelInterface

isMultiplayer

public boolean isMultiplayer()
Specified by:
isMultiplayer in interface TetrisModelInterface

isOpponentConnected

public boolean isOpponentConnected()
Specified by:
isOpponentConnected in interface TetrisModelInterface

init

public void init(GameEnvironmentInterface environment)
Specified by:
init in interface TetrisModelInterface

initNewGame

protected void initNewGame()

moveLeft

public void moveLeft()
Specified by:
moveLeft in interface TetrisModelInterface

moveRight

public void moveRight()
Specified by:
moveRight in interface TetrisModelInterface

rotate

public void rotate()
Specified by:
rotate in interface TetrisModelInterface

moveDown

public void moveDown()
Specified by:
moveDown in interface TetrisModelInterface

startGame

public void startGame()
Specified by:
startGame in interface TetrisModelInterface

update

public void update()
Specified by:
update in interface TetrisModelInterface

connected

public void connected(NetworkConnectionInterface connection)
Specified by:
connected in interface NetworkClientListenerInterface

disconnected

public void disconnected(NetworkConnectionInterface connection)
Specified by:
disconnected in interface NetworkClientListenerInterface

message

public void message(NetworkConnectionInterface connection,
                    String message)
Specified by:
message in interface NetworkClientListenerInterface

getBlockFromString

protected erland.game.tetris.Block getBlockFromString(erland.game.tetris.Block oldBlock,
                                                      String message)


Copyright © 2003-2006 Erland Isaksson. All Rights Reserved.