Class BuildingType

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

    public class BuildingType
    extends ConstructibleType
    Stores attributes for a type of building.
    Version:
    $Revision: 203 $
    Author:
    $Author: $
    • Constructor Detail

      • BuildingType

        public BuildingType​(StringID id)
        Creates a new BuildingType object.
    • Method Detail

      • getSkillBonus

        public int getSkillBonus​(SkillType skillType)
        Returns the bonus this building provides to the given skill.
      • setSkillBonus

        public void setSkillBonus​(SkillType skillType,
                                  int bonus)
        Sets the bonus this building provides to the given skill.
      • addRegionType

        public void addRegionType​(RegionType type)
        Registers type as allowed region type for this building.
        Parameters:
        type -
      • containsRegionType

        public boolean containsRegionType​(RegionType type)
        Returns true if either no RegionType has been registered by addRegionType(RegionType) or if at least one RegionType has been registered and type is one of the allowed types.
        Parameters:
        type -
      • regionTypes

        public java.util.Collection<RegionType> regionTypes()
        Returns a list of allowed RegionTypes. An empty list indicates that any type is allowed!
      • isMaintainedByRegionOwner

        public boolean isMaintainedByRegionOwner()
      • setMaintendByRegionOwner

        public void setMaintendByRegionOwner​(boolean isMaintained)