|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.freecol.common.model.FreeColObject
net.sf.freecol.common.model.FreeColGameObject
net.sf.freecol.common.model.Game
net.sf.freecol.server.model.ServerGame
public class ServerGame
The server representation of the game.
| Field Summary | |
|---|---|
private static java.util.logging.Logger |
logger
|
| Fields inherited from class net.sf.freecol.common.model.Game |
|---|
CIBOLA_TAG, combatModel, currentPlayer, freeColGameObjectListener, freeColGameObjects, nextId, players, viewOwner |
| Fields inherited from class net.sf.freecol.common.model.FreeColGameObject |
|---|
UNITS_TAG_NAME |
| Fields inherited from class net.sf.freecol.common.model.FreeColObject |
|---|
ARRAY_SIZE, ID_ATTRIBUTE, ID_ATTRIBUTE_TAG, INFINITY, NO_ID, PARTIAL_ATTRIBUTE, UNDEFINED, VALUE_TAG |
| Constructor Summary | |
|---|---|
ServerGame(FreeColGameObjectListener freeColGameObjectListener,
javax.xml.stream.XMLStreamReader in,
java.util.List<java.lang.String> serverStrings,
Specification specification)
Initiate a new ServerGame with information from a
saved game. |
|
ServerGame(Specification specification)
Creates a new game model. |
|
| Method Summary | |
|---|---|
Player |
checkForWinner()
Checks if anybody has won this game. |
void |
csNewTurn(java.util.Random random,
ChangeSet cs)
New turn for this game. |
private void |
csSpanishSuccession(ChangeSet cs,
Event spanishSuccession)
Checks for and if necessary performs the War of Spanish Succession changes. |
java.lang.String |
getNextID()
Get a unique ID to identify a FreeColGameObject. |
java.util.List<ServerModelObject> |
getServerModelObjects()
Collects a list of all the ServerModelObjects in this game. |
java.lang.String |
getServerXMLElementTagName()
Returns the tag name of the root element representing this object. |
boolean |
isNextPlayerInNewTurn()
Is the next player in a new turn? |
private java.lang.Object |
makeServerObject(java.lang.String type,
java.lang.String id)
Makes a trivial server object in this game given a server object tag and an id. |
| Methods inherited from class net.sf.freecol.common.model.FreeColGameObject |
|---|
dispose, disposeList, equals, fundamentalDispose, getFreeColGameObject, getFreeColGameObject, getGame, getIntegerID, hashCode, isDisposed, isUninitialized, newLocation, readFromXML, readFromXMLPartialByClass, setDefaultId, setGame, setId, toString, toXML, toXMLImpl, toXMLPartialByClass, updateFreeColGameObject |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final java.util.logging.Logger logger
| Constructor Detail |
|---|
public ServerGame(Specification specification)
specification - The Specification to use in this game.FreeColServer
public ServerGame(FreeColGameObjectListener freeColGameObjectListener,
javax.xml.stream.XMLStreamReader in,
java.util.List<java.lang.String> serverStrings,
Specification specification)
throws javax.xml.stream.XMLStreamException
ServerGame with information from a
saved game.
freeColGameObjectListener - A listener that should be monitoring
this Game.in - The input stream containing the XML.serverStrings - A list of server object type,ID pairs to create.
in this Game.specification - The Specification to use in this game.
javax.xml.stream.XMLStreamException - if an error occurred during parsing.FreeColServer.loadGame(net.sf.freecol.common.io.FreeColSavegameFile)| Method Detail |
|---|
private java.lang.Object makeServerObject(java.lang.String type,
java.lang.String id)
throws java.lang.ClassNotFoundException,
java.lang.IllegalAccessException,
java.lang.InstantiationException,
java.lang.reflect.InvocationTargetException,
java.lang.NoSuchMethodException
type - The server object tag.id - The id.
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.reflect.InvocationTargetException
java.lang.NoSuchMethodExceptionpublic java.lang.String getNextID()
FreeColGameObject.
public Player checkForWinner()
Player who has won the game or null if none.public boolean isNextPlayerInNewTurn()
public void csNewTurn(java.util.Random random,
ChangeSet cs)
csNewTurn in interface ServerModelObjectrandom - A Random number source.cs - A ChangeSet to update.
private void csSpanishSuccession(ChangeSet cs,
Event spanishSuccession)
cs - A ChangeSet to update.spanishSuccession - an Event valuepublic java.lang.String getServerXMLElementTagName()
getServerXMLElementTagName in interface ServerModelObjectpublic java.util.List<ServerModelObject> getServerModelObjects()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||