|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectenergyTycoon.client.ClientManagement
public class ClientManagement
client management class
Constructor Summary | |
---|---|
ClientManagement()
|
Method Summary | |
---|---|
void |
buildPowerStation(PowerStationGroup psg,
int generation)
build a power station |
void |
changeBudget(int newBudget,
int knowingBudget)
change research budget |
void |
changePriceInCity(int cityId,
int price)
the player change his price |
void |
createDistantGame(java.lang.String gameName,
int scriptId,
int startingMoney,
int maxPlayer)
open a game on a server |
PhysicPlayer |
createPhysicPlayer(int playerId)
|
java.util.List<PowerStationType> |
getAllAvailablePowerStationType(int groupId)
|
java.util.Vector<Customer> |
getAllCustomers()
get all customers |
java.util.List<PowerStationGroup> |
getAllGroupsAvailable()
get all groups that player can build |
java.util.List<PowerStation> |
getAllStations()
get all player stations |
ClientGame |
getGame()
get the game |
java.util.Vector<java.lang.String> |
getLocalScripts()
return all existing scripts |
PhysicPlayer |
getPlayer()
get the user player |
java.lang.String[] |
getScripts()
return all existing scripts |
void |
giveUpConnection()
forget server connection |
void |
joinGame(int gameId)
join a distant game |
void |
joinServer(java.lang.String server,
int port)
try to connect to server |
void |
leaveGame()
|
void |
leaveServer()
Disconnect from server |
void |
lostConnection()
|
void |
quitGame()
Quit the current game |
void |
quitMenu()
exit menu (cross) |
void |
runServer(java.lang.String gameName,
int scriptId,
int startingMoney,
int maxPlayer,
int port)
host a game on the client computer |
void |
sendChatMessage(java.lang.String message)
Send a chat message to other players |
void |
setGame(ClientGame game)
|
void |
setInCity(int cityId,
int price)
the player want to set in a city |
void |
setScripts(java.lang.String[] scripts)
Change script list |
void |
startGame()
start the game (play button pressed) |
void |
startMenu()
launch menu |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClientManagement()
Method Detail |
---|
public void startMenu()
public void quitMenu()
quitMenu
in interface MenuListener
public java.lang.String[] getScripts()
getScripts
in interface MenuListener
public java.util.Vector<java.lang.String> getLocalScripts()
getLocalScripts
in interface MenuListener
public void joinServer(java.lang.String server, int port)
joinServer
in interface MenuListener
server
- server nameport
- port to connect onpublic void giveUpConnection()
giveUpConnection
in interface MenuListener
public void runServer(java.lang.String gameName, int scriptId, int startingMoney, int maxPlayer, int port)
runServer
in interface MenuListener
scriptId
- script idgameName
- game namestartingMoney
- the money players start withmaxPlayer
- maximum player numberport
- server portpublic void joinGame(int gameId)
joinGame
in interface MenuListener
gameId
- game identifierpublic void createDistantGame(java.lang.String gameName, int scriptId, int startingMoney, int maxPlayer)
createDistantGame
in interface MenuListener
scriptId
- script idgameName
- game namestartingMoney
- money players start withmaxPlayer
- maximum number of player in this gamepublic void quitGame()
quitGame
in interface GameListener
quitGame
in interface MenuListener
public void startGame()
startGame
in interface MenuListener
public void sendChatMessage(java.lang.String message)
sendChatMessage
in interface GameListener
sendChatMessage
in interface MenuListener
message
- message the user sendpublic void setScripts(java.lang.String[] scripts)
scripts
- scripts arraypublic void leaveGame()
leaveGame
in interface MenuListener
public void leaveServer()
leaveServer
in interface MenuListener
public void lostConnection()
public java.util.List<PowerStation> getAllStations()
GameListener
getAllStations
in interface GameListener
public java.util.List<PowerStationType> getAllAvailablePowerStationType(int groupId)
getAllAvailablePowerStationType
in interface GameListener
public PhysicPlayer createPhysicPlayer(int playerId)
public java.util.List<PowerStationGroup> getAllGroupsAvailable()
GameListener
getAllGroupsAvailable
in interface GameListener
public java.util.Vector<Customer> getAllCustomers()
getAllCustomers
in interface GameListener
public void setGame(ClientGame game)
game
- public void buildPowerStation(PowerStationGroup psg, int generation)
buildPowerStation
in interface GameListener
psg
- groupgeneration
- power generationpublic ClientGame getGame()
getGame
in interface GameListener
public void setInCity(int cityId, int price)
setInCity
in interface GameListener
cityId
- the city Id where we want to setprice
- energy price for this citypublic void changePriceInCity(int cityId, int price)
changePriceInCity
in interface GameListener
cityId
- the city Id where we want to change priceprice
- energy price for this citypublic void changeBudget(int newBudget, int knowingBudget)
changeBudget
in interface GameListener
newBudget
- knowingBudget
- public PhysicPlayer getPlayer()
getPlayer
in interface GameListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |