Class MaintenanceRelation


  • public class MaintenanceRelation
    extends UnitContainerRelation
    A relation indicating that a unit pays maintenance of a building or ship.
    • Field Detail

      • itemType

        public ItemType itemType
        The required item type
      • warning

        public boolean warning
        indicates whether there is some kind of problem with this relation
    • Constructor Detail

      • MaintenanceRelation

        public MaintenanceRelation​(Unit unit,
                                   UnitContainer container,
                                   int amount,
                                   ItemType itemType,
                                   java.lang.String reason,
                                   java.lang.String icon,
                                   int line,
                                   boolean warning)
        Creates a new MaintenanceRelation object.
        Parameters:
        unit - The maintaining unit
        container - the maintained building
        amount - The costs in silver
        itemType -
        line - The line in the source's orders
        warning -
    • Method Detail

      • getCosts

        public int getCosts()
        Returns the value of costs.
        Returns:
        Returns costs.
      • setCosts

        public void setCosts​(int costs)
        Sets the value of costs.
        Parameters:
        costs - The value for costs.
      • getReason

        public java.lang.String getReason()
        Returns a localized reason for this relation.
      • setReason

        public void setReason​(java.lang.String reason)
        Parameters:
        reason -
      • getIcon

        public java.lang.String getIcon()
        Returns an icon name associated with this relation.
      • setIcon

        public void setIcon​(java.lang.String name)
        Parameters:
        name -