|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectenergyTycoon.player.Player
energyTycoon.player.FullPlayer
energyTycoon.player.NetworkServerPlayer
public class NetworkServerPlayer
represent a player seen by the server
Field Summary |
---|
Fields inherited from class energyTycoon.player.Player |
---|
myCustomer, supplyings |
Constructor Summary | |
---|---|
NetworkServerPlayer(ServerGame server,
ServerClient client,
int playerId,
java.lang.String playerName,
int money)
|
Method Summary | |
---|---|
void |
addExchange(ExchangeServer exchange)
add the exchange to exchange list |
void |
buildPowerStation(int groupId,
int generation)
|
void |
buy()
Buy to all provider, but providers control all |
void |
changeCityPrice(int cityId,
int price)
the player change his price in the city |
void |
changeExchangeValues(int providerId,
int sellPrice,
int sellMax,
int buyMaxPrice,
int buyMax)
change exchange properties |
void |
compute(int time)
compute the player |
void |
computeEndOfMonth()
to do at the end of the month |
void |
countProCustomers(boolean reset)
Count pro customer number |
void |
delete()
|
void |
disconnectClient()
|
void |
earn(int money)
the player earns money |
void |
gainEnergy(int quantity)
the player gains some energy |
int |
getEnergyLeft()
compute the amount of energy still available for this frame |
int |
getMaxStockPerPro()
compute how much energy is available for each pro customer |
void |
leaveGame(java.lang.String message)
End the game for this player |
void |
looseEnergy(int quantity)
the player loose some energy |
void |
looseMoney(int money)
the player looses money |
boolean |
needBuy()
knowing if the player still need to buy |
void |
powerStation_generationHasBeenChangedTo(int generation)
Say the client his power station has been updated |
void |
powerStation_useRateHasBeenChangedTo(int useRate)
Say the client that his power station changed its use rate |
void |
provide()
Provide all customers |
void |
receiveMessage(java.lang.String message)
|
void |
sell()
Try to sell energy left to everyone |
void |
sendFrameMessage(java.lang.String message)
Send frame informations |
void |
sendMessageToThisPlayer(java.lang.String message)
send message to this player |
void |
sendPlayerList(java.util.Vector<NetworkServerPlayer> players)
send player list to the client |
void |
setAndSendName(java.lang.String name)
change player name and send it to the client |
void |
setInCity(int cityId,
int price)
the player set in the city |
boolean |
startGame()
|
Methods inherited from class energyTycoon.player.Player |
---|
getId, getName |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NetworkServerPlayer(ServerGame server, ServerClient client, int playerId, java.lang.String playerName, int money)
Method Detail |
---|
public void delete()
delete
in class FullPlayer
public boolean startGame()
public void receiveMessage(java.lang.String message)
public void sendMessageToThisPlayer(java.lang.String message)
message
- message to sendpublic void setAndSendName(java.lang.String name)
name
- new namepublic void leaveGame(java.lang.String message)
message
- message to sendpublic void compute(int time)
time
- timer in secondpublic void provide()
public void powerStation_useRateHasBeenChangedTo(int useRate)
useRate
- new use ratepublic void powerStation_generationHasBeenChangedTo(int generation)
generation
- new power station generationpublic void sendFrameMessage(java.lang.String message)
message
- shared informations about gamepublic void countProCustomers(boolean reset)
reset
- true if we must reset the frame transactionpublic int getMaxStockPerPro()
public void buy()
public void sell()
public void earn(int money)
money
- money he earnspublic void looseMoney(int money)
money
- money he loosespublic void looseEnergy(int quantity)
quantity
- energy lostpublic void gainEnergy(int quantity)
quantity
- energy gainedpublic int getEnergyLeft()
public boolean needBuy()
public void disconnectClient()
public void buildPowerStation(int groupId, int generation)
groupId
- generation
- public void setInCity(int cityId, int price)
cityId
- city Idprice
- energy pricepublic void changeCityPrice(int cityId, int price)
cityId
- city Idprice
- energy pricepublic void sendPlayerList(java.util.Vector<NetworkServerPlayer> players)
players
- public void addExchange(ExchangeServer exchange)
exchange
- public void changeExchangeValues(int providerId, int sellPrice, int sellMax, int buyMaxPrice, int buyMax)
providerId
- sellPrice
- sellMax
- buyMaxPrice
- buyMax
- public void computeEndOfMonth()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |