Class ShipModelForShipList


  • public class ShipModelForShipList
    extends java.lang.Object
    UI model for an entry in the ship list dialog.
    Author:
    Andi Hotz, (c) Sahits GmbH, 2018 Created on Jul 12, 2018
    • Field Detail

      • ship

        private final IShip ship
      • shipService

        @Autowired
        private ShipService shipService
      • messageSource

        @Autowired
        private org.springframework.context.MessageSource messageSource
      • locale

        @Autowired
        private Locale locale
    • Constructor Detail

      • ShipModelForShipList

        public ShipModelForShipList​(IShip ship)
    • Method Detail

      • getParent

        public java.util.Optional<ShipModelForShipList> getParent()
        If the ship belongs to a convoy retrieve the parent ship.
        Returns:
        Optional parent reference, not present when a vessel has no parent (i.e. not a convoy member)
      • getShipName

        public java.lang.String getShipName()
        Retrieve the name of the ship.
        Returns:
        ship name.
      • getShipType

        public EShipType getShipType()
        Retrieve the ship type.
        Returns:
        ship type.
      • travelingState

        public javafx.beans.property.ObjectProperty<EShipTravelState> travelingState()
        Property of the travel state.
        Returns:
        observable of the travel state
      • destination

        public javafx.beans.binding.StringBinding destination()
        Destination city name of the travel. This may be an empty string.
        Returns:
        string binding representing the destination
      • getHealth

        public int getHealth()
        Retrieve the ships health.
        Returns:
        ship health.
      • loadedWares

        public javafx.beans.binding.IntegerBinding loadedWares()
        Binding of the loaded amount of wares in barrels.
        Returns:
        loaded ware binding.
      • getValue

        public int getValue()
        Get the ship's value.
        Returns:
        ship value.
      • isPlayersShip

        public boolean isPlayersShip​(IHumanPlayer player)
        Check if the represented ship belongs to the current player.
        Parameters:
        player - to check against owner
        Returns:
        true if player and ship owner match
      • isAutotrading

        public boolean isAutotrading()
        Check if the ship is on an auto trade route.
        Returns:
        true if the ship is on a trade route.