Class ConstructibleType

  • All Implemented Interfaces:
    java.lang.Cloneable, java.lang.Comparable<java.lang.Object>, Identifiable, Named, Unique
    Direct Known Subclasses:
    BuildingType, ShipType

    public abstract class ConstructibleType
    extends UnitContainerType
    A type abstracting a unit container with building and maintenance costs.
    Author:
    stm
    • Constructor Detail

      • ConstructibleType

        public ConstructibleType​(StringID id)
    • Method Detail

      • addRawMaterial

        public void addRawMaterial​(Item i)
        Add an item needed to construct one size point of this type.
      • getRawMaterials

        public java.util.Collection<Item> getRawMaterials()
        Returns a collection of all items needed to construct one size point of this type.
      • getRawMaterial

        public Item getRawMaterial​(StringID id)
        Returns an item which contains how much is needed to build this type null if this type isn't needed
        Parameters:
        id - An ItemType ID
      • addMaintenance

        public void addMaintenance​(Item i)
        Adds an item needed for upkeep.
      • getMaintenanceItems

        public java.util.Collection<Item> getMaintenanceItems()
        Returns a collections of all items neede for upkeep.
      • getMaintenance

        public Item getMaintenance​(ID id)
        Returns an item which contains how much is needed to upkeep this type or null if this type isn't needed
        Parameters:
        id - An ItemType ID
      • setBuildSkillLevel

        public void setBuildSkillLevel​(int l)
        Sets the minimum level to construct one unit of this type.
      • getBuildSkillLevel

        public int getBuildSkillLevel()
        Returns the minimum level to construct one unit of this type.
      • setMaxSize

        public void setMaxSize​(int m)
        Sets the maximum size. A value < 0 means that there is no maximum.
      • getMaxSize

        public int getMaxSize()
        Returns the maximum size. A value < 0 means that there is no maximum.