|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectFaction
public class Faction
Contains MMS Faction data for a single faction
Field Summary | |
---|---|
(package private) int |
M_CANCEL
|
private java.lang.String |
m_factionName
|
(package private) int |
M_NO
|
private java.util.Vector<java.lang.String> |
m_properties
|
(package private) int |
M_YES
|
Constructor Summary | |
---|---|
Faction()
Default constructor - creates an empty Faction; not preferred |
|
Faction(java.lang.String factionName)
Preferred constructor - creates faction with the given name |
Method Summary | |
---|---|
void |
addAllProperties(java.util.Vector<java.lang.String> vList)
Adds all the Faction properties to the given vector |
void |
addFactionProperty(java.lang.String mmsLine)
Given the string for the property, add it to the list of properties |
void |
addUnit(java.lang.String newUnit)
Add a new Unit to the list |
void |
addUnitProperties(java.util.Vector<java.lang.String> vList,
int unitIdx)
Add all non-unit declarations to the given vector |
void |
addUnitProperty(int unitIdx,
java.lang.String propVal)
Adds a new property for the given Unit |
void |
addUnits(java.util.Vector<java.lang.String> vList)
Add all units to the given vector |
void |
changeName(java.lang.String newName)
Replaces all properties with the new name |
Faction |
clone()
Clone class for a deep copy |
java.lang.String |
getFactionForScenarioFile()
Return this faction for the output file buffer of a scenario |
java.lang.String |
getFactionProperty(int idx)
Return the element at the given index (zero based) as a String |
java.lang.String |
getLocation()
|
java.lang.String |
getName()
|
java.lang.String |
getPropertyValue(java.lang.String lParam)
Return the propery value for the given property string |
int |
getUnitCount()
|
java.lang.String |
getUnitValue(java.lang.String lParam)
Return the Unit value for the given property string |
boolean |
propertyIsUnit(java.lang.String lParam)
Determine if given property is a Unit declaration |
boolean |
removeProperty(java.lang.String prop)
Remove the given property from the list |
void |
removeUnit(int oldUnitNum)
Remove the Unit and all its properties |
void |
replaceUnit(java.lang.String oldUnit,
java.lang.String newUnit)
Replace a Unit with new Unit info |
void |
replaceUnitProperty(int unitIdx,
java.lang.String oldVal,
java.lang.String newVal)
Replace property for the given Unit and property |
void |
setLocation(java.lang.String newLoc)
Sets the location property to the given location |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
final int M_NO
final int M_YES
final int M_CANCEL
private java.lang.String m_factionName
private java.util.Vector<java.lang.String> m_properties
Constructor Detail |
---|
public Faction()
public Faction(java.lang.String factionName)
Method Detail |
---|
public Faction clone()
clone
in class java.lang.Object
public java.lang.String getName()
public void addFactionProperty(java.lang.String mmsLine)
mmsLine
- The line for the property (e.g. Unit_Rangers_1=Stone Rhino SERO,Capt Black,3,3)public java.lang.String getFactionProperty(int idx)
idx
- Zero based index
public void addAllProperties(java.util.Vector<java.lang.String> vList)
vList
- String vector that will receive all Faction propertiespublic void addUnits(java.util.Vector<java.lang.String> vList)
vList
- String vector that will receive list of Unitspublic void addUnitProperties(java.util.Vector<java.lang.String> vList, int unitIdx)
vList
- String vector that will receive list of UnitsunitIdx
- Unit number; a number less than 1 implies get all unit propertiespublic boolean propertyIsUnit(java.lang.String lParam)
lParam
- Property to check
public java.lang.String getUnitValue(java.lang.String lParam)
lParam
- Full property string
public java.lang.String getPropertyValue(java.lang.String lParam)
lParam
- Full property string
public java.lang.String getLocation()
public boolean removeProperty(java.lang.String prop)
prop
- Entire property string
public void addUnit(java.lang.String newUnit)
newUnit
- Unit value of format: mech,pilot,x,y,...public void replaceUnit(java.lang.String oldUnit, java.lang.String newUnit)
oldUnit
- - current Unit to replacenewUnit
- - new Unit descriptionpublic int getUnitCount()
public void removeUnit(int oldUnitNum)
oldUnitNum
- Unit numberpublic void addUnitProperty(int unitIdx, java.lang.String propVal)
unitIdx
- Unit numberpropVal
- Property and valuepublic void replaceUnitProperty(int unitIdx, java.lang.String oldVal, java.lang.String newVal)
unitIdx
- Unit numberoldVal
- Old property and valuenewVal
- New property and valuepublic void setLocation(java.lang.String newLoc)
newLoc
- Location (N, NE, S, etc.)public void changeName(java.lang.String newName)
newName
- New name of Factionpublic java.lang.String getFactionForScenarioFile()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |