Class UnitParameters

java.lang.Object
  extended byswarm.BaseImpl
      extended byswarm.objectbase.SwarmObjectImpl
          extended byUnitParameters
All Implemented Interfaces:
swarm.defobj.Create, swarm.defobj.CreateS, swarm.defobj.Customize, swarm.defobj.CustomizeS, swarm.defobj.DefinedObject, swarm.defobj.DefinedObjectS, swarm.defobj.Drop, swarm.defobj.DropS, swarm.defobj.GetName, swarm.defobj.GetNameS, swarm.objectbase.SwarmObject, swarm.objectbase.SwarmObjectS

public class UnitParameters
extends swarm.objectbase.SwarmObjectImpl

This class reads the parameters for each unit

Author:
Dario Landini and Nicola Ormezzano; IO improved by Michele Sonnessa, deeply modified by Pietro Terna to deal with simple or complex units

Field Summary
 int[] simpleUnitProductionPhase
          the vector of simple unit production phase (simple=with a unique activity)
 int totalUnitNumber
          total unit number
 int[] unitNumber
          the vector of the unit numbers
 
Constructor Summary
UnitParameters(swarm.defobj.Zone aZone, int un)
          the constructor of UnitParameters
 
Method Summary
 int getSimpleUnitProductionPhase(int i)
          returning the production phase for a specific simple unit
 int getUnitNumber(int i)
          returning the unit number for a specific (normal) unit
 void lackingData(java.lang.String s)
          conclude execution if data are lacking
 void readUnitData()
          read the unit numbers and production phasesvfrom the unitData/unitBasicData.txt file
 void setParametersTo(int i, Unit aUnit)
          setting the parameters of (normal) units
 
Methods inherited from class swarm.objectbase.SwarmObjectImpl
compare, describe, describeID, drop, getCompleteProbeMap, getDisplayName, getName, getProbeForMessage, getProbeForVariable, getProbeMap, getTypeName, getZone, perform, perform$with, perform$with$with, perform$with$with$with, respondsTo, setDisplayName, xfprint, xfprintid, xprint, xprintid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

unitNumber

public int[] unitNumber
the vector of the unit numbers


simpleUnitProductionPhase

public int[] simpleUnitProductionPhase
the vector of simple unit production phase (simple=with a unique activity)


totalUnitNumber

public int totalUnitNumber
total unit number

Constructor Detail

UnitParameters

public UnitParameters(swarm.defobj.Zone aZone,
                      int un)
the constructor of UnitParameters

Method Detail

readUnitData

public void readUnitData()
read the unit numbers and production phasesvfrom the unitData/unitBasicData.txt file


setParametersTo

public void setParametersTo(int i,
                            Unit aUnit)
setting the parameters of (normal) units


getUnitNumber

public int getUnitNumber(int i)
returning the unit number for a specific (normal) unit


getSimpleUnitProductionPhase

public int getSimpleUnitProductionPhase(int i)
returning the production phase for a specific simple unit


lackingData

public void lackingData(java.lang.String s)
conclude execution if data are lacking