|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
energyTycoon.game.Game
energyTycoon.game.ClientGame
public class ClientGame
Client Game engine, will connect to server
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class energyTycoon.game.Game |
---|
MESS_ALERT, MESS_INFO, MESS_PERSO, MESS_SUCCESS |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
ClientGame(Client client,
int gameId,
int playerId,
java.lang.String gameName,
int scriptId,
int startMoney,
int nbMaxPlayer,
int nbPlayer)
Client Game engine constructor |
Method Summary | |
---|---|
void |
addCustomer(Customer cust)
add a customer to the list |
void |
addPlayer(int playerId,
java.lang.String playerName)
add a distant player |
void |
addPowerStationGroup(PowerStationGroup psg)
add a power station group |
void |
addPowerStationType(PowerStationType pst)
add a power station type |
void |
changeDate(int day,
Season season,
int year)
change date |
void |
compute()
compute a frame |
java.util.Vector<Customer> |
getAllCustomers()
|
java.util.List<ExchangeClient> |
getAllExchanges()
return exchange list |
City |
getCity(int id)
get the city with the given id |
NetworkDistantPlayer |
getPlayerFromId(int playerId)
get a distant player from his id |
int |
getPlayerId()
get the player Id |
PowerStationGroup |
getPowerStationGroupFromId(int id)
get a power group from its id |
PowerStationType |
getPowerStationTypeFromId(int id)
|
boolean |
isCustomerCity(int id)
knowing if a customer is a city |
void |
looseOnePlayer(int playerId)
A player disconnect |
void |
newPlayer(int playerId,
java.lang.String playerName)
|
void |
powerStation_askBuild(int playerId,
int powerStationTypeId)
|
void |
powerStation_askChangeUseRate(int powerStationId,
int useRate)
|
void |
powerStation_askDelete(int powerStationId)
|
void |
powerStation_askRestore(int powerStationId)
|
void |
powerStation_askUpdate(int powerStationId,
int generation)
|
void |
run()
run the thread |
void |
sendNetworkMessage(java.lang.String message)
send network message |
void |
setIsNight(boolean isNight)
set if it is the night or not |
void |
setTime(int time)
set game timer |
void |
setWeather(int weather)
|
void |
setWind(int wind)
|
Methods inherited from class energyTycoon.game.Game |
---|
getDay, getGameId, getGameName, getHour, getNbFramePerYear, getNbMaxPlayer, getNbPlayer, getScriptId, getSeason, getStringDate, getTime, getWeather, getWind, getYearTime, isNight, setStartDate |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ClientGame(Client client, int gameId, int playerId, java.lang.String gameName, int scriptId, int startMoney, int nbMaxPlayer, int nbPlayer)
client
- client referencegameId
- game identifiergameName
- name of the gamescriptId
- script identifierstartMoney
- money the player start withnbMaxPlayer
- maximum number of playernbPlayer
- current playersMethod Detail |
---|
public void compute()
Game
compute
in class Game
public void run()
Game
run
in interface java.lang.Runnable
run
in class Game
public int getPlayerId()
public void powerStation_askUpdate(int powerStationId, int generation)
powerStationId
- generation
- public void powerStation_askRestore(int powerStationId)
powerStationId
- public void powerStation_askChangeUseRate(int powerStationId, int useRate)
powerStationId
- useRate
- public void powerStation_askDelete(int powerStationId)
powerStationId
- public void powerStation_askBuild(int playerId, int powerStationTypeId)
playerId
- powerStationTypeId
- public void looseOnePlayer(int playerId)
playerId
- public void newPlayer(int playerId, java.lang.String playerName)
playerId
- playerName
- public void addPowerStationType(PowerStationType pst)
addPowerStationType
in interface PowerStationListener
pst
- public void addPowerStationGroup(PowerStationGroup psg)
psg
- public PowerStationGroup getPowerStationGroupFromId(int id)
id
-
public PowerStationType getPowerStationTypeFromId(int id)
public void addCustomer(Customer cust)
cust
- public java.util.Vector<Customer> getAllCustomers()
public boolean isCustomerCity(int id)
id
- customer id
public City getCity(int id)
getCity
in class Game
id
- customer id
public void changeDate(int day, Season season, int year)
day
- season
- year
- public void setTime(int time)
time
- public void setWeather(int weather)
public void setWind(int wind)
public void addPlayer(int playerId, java.lang.String playerName)
playerId
- playerName
- public java.util.List<ExchangeClient> getAllExchanges()
public void sendNetworkMessage(java.lang.String message)
message
- public NetworkDistantPlayer getPlayerFromId(int playerId)
playerId
-
public void setIsNight(boolean isNight)
isNight
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |