com.eoi.freya.basic
Class BasicPlayer
java.lang.Object
|
+--com.eoi.freya.game.XMLObject
|
+--com.eoi.freya.basic.BasicPlayer
- All Implemented Interfaces:
- Player
- public class BasicPlayer
- extends XMLObject
- implements Player
A BasicPlayer Object represents an in-game player and is a container for all the data that
player has. Units and Groups make up the majority of this. A BasicPlayer can persist itself.
Field Summary |
protected java.util.HashMap |
groups
|
protected com.eoi.freya.basic.Document |
playerDoc
|
protected java.util.HashMap |
units
|
Methods inherited from class com.eoi.freya.game.XMLObject |
addElement, getElement, getInfo, getIntSetting, getIterator, getName, getSetting, isSetting, setBooleanSetting, setInfo, setIntSetting, setName, setSetting |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.eoi.freya.player.Player |
getName |
playerDoc
protected com.eoi.freya.basic.Document playerDoc
units
protected java.util.HashMap units
groups
protected java.util.HashMap groups
BasicPlayer
public BasicPlayer()
BasicPlayer
public BasicPlayer(org.jdom.Element info)
getFilename
public java.lang.String getFilename()
- Specified by:
getFilename
in interface Player
getUnit
public Unit getUnit(java.lang.String unitName)
- Specified by:
getUnit
in interface Player
getRace
public java.lang.String getRace()
setRace
public void setRace(java.lang.String race)
getUnits
public java.util.Iterator getUnits()
- Specified by:
getUnits
in interface Player
getGroup
public BasicGroup getGroup(java.lang.String unitName)
getGroups
public java.util.Iterator getGroups()
addUnit
public void addUnit(BasicUnit unit)
addGroup
public void addGroup(BasicGroup group)
buildUnits
public void buildUnits()
buildGroups
public void buildGroups()
load
public void load(java.lang.String name)
- Specified by:
load
in interface Player
write
public void write()
- Specified by:
write
in interface Player
Freya Engine, The Turn Based Game Engine
Copyright(c) 2002 Alexander Bilton
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA