Interface Ship

    • Method Detail

      • setRegion

        void setRegion​(Region region)
        Sets the region this ship is in and notifies region about it.
        Specified by:
        setRegion in interface HasRegion
        Parameters:
        region -
      • getRegion

        Region getRegion()
        Returns the region this ship is in.
        Specified by:
        getRegion in interface HasRegion
        Returns:
        The region the ship is in, possibly null
      • getShipType

        ShipType getShipType()
        The type of this ship.
        Returns:
        The type of this ship
      • getMaxCapacity

        int getMaxCapacity()
        Returns the maximum capacity with respect to damages of the ship in silver.
        Returns:
        Returns the maximum capacity with respect to damages of the ship in silver
      • getCargo

        int getCargo()
        Returns the cargo load of this ship.
        Returns:
        Returns the cargo load of this ship or -1 if unknown
      • getLoad

        int getLoad()
        Returns the weight of all units of this ship in silver. This is usually less precise than getCargo().
        Returns:
        The weight of the units on the ship
      • getModifiedLoad

        int getModifiedLoad()
        Returns the weight of all units of this ship in silver based on the modified units.
        Returns:
        The modified weight of the modified units on the ship
      • toString

        java.lang.String toString()
        A string representation of this ship.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A string representation of this ship
      • toString

        java.lang.String toString​(boolean printExtended)
        Returns the string representation of this ship. If printExtended is true, type, damage and remaing capacity are shown, too.
        Parameters:
        printExtended - Whether to return a more detailed description
        Returns:
        A strig representation of this ship
      • getCapacity

        int getCapacity()
        Returns the value of capacity.
        Returns:
        Returns capacity.
      • setCapacity

        void setCapacity​(int capacity)
        Sets the value of capacity.
        Parameters:
        capacity - The value for capacity.
      • getDamageRatio

        int getDamageRatio()
        Returns the value of damageRatio.
        Returns:
        Returns damageRatio.
      • setDamageRatio

        void setDamageRatio​(int damageRatio)
        Sets the value of damageRatio.
        Parameters:
        damageRatio - The value for damageRatio.
      • getDeprecatedCapacity

        int getDeprecatedCapacity()
        Returns the value of deprecatedCapacity.
        Returns:
        Returns deprecatedCapacity.
      • setDeprecatedCapacity

        void setDeprecatedCapacity​(int deprecatedCapacity)
        Sets the value of deprecatedCapacity.
        Parameters:
        deprecatedCapacity - The value for deprecatedCapacity.
      • getDeprecatedLoad

        int getDeprecatedLoad()
        Returns the value of deprecatedLoad.
        Returns:
        Returns deprecatedLoad.
      • setDeprecatedLoad

        void setDeprecatedLoad​(int deprecatedLoad)
        Sets the value of deprecatedLoad.
        Parameters:
        deprecatedLoad - The value for deprecatedLoad.
      • getShoreId

        int getShoreId()
        Returns the value of shoreId.
        Returns:
        Returns shoreId.
      • setShoreId

        void setShoreId​(int shoreId)
        Sets the value of shoreId.
        Parameters:
        shoreId - The value for shoreId.
      • getSize

        int getSize()
        Returns the value of size.
        Returns:
        Returns size.
      • setSize

        void setSize​(int size)
        Sets the value of size.
        Parameters:
        size - The value for size.
      • setCargo

        void setCargo​(int cargo)
        Sets the value of cargo.
        Parameters:
        cargo - The value for cargo.
      • getMaxPersons

        int getMaxPersons()
        Returns the maximum number of persons allowed on board.
      • setMaxPersons

        void setMaxPersons​(int persons)
        Sets the maximum number of persons (default: -1).
        Parameters:
        persons -
        See Also:
        ShipType.getMaxPersons()
      • getPersonLoad

        int getPersonLoad()
        Returns the current weight of the persons currently on board.
      • getModifiedPersonLoad

        int getModifiedPersonLoad()
        Returns the projected weight of the projected peresons on board.
      • setSpeed

        void setSpeed​(int newSpeed)
        Set the ship's current speed
      • getSpeed

        int getSpeed()
        Returns the ship's current speed.
        Returns:
        The current speed, -1 if undefined.