Class Player

    • Field Detail

      • uuid

        private java.lang.String uuid
      • fleet

        private final javafx.collections.ObservableList<IShip> fleet
      • selectableVessel

        private final javafx.collections.ObservableList<INavigableVessel> selectableVessel
      • careerLevel

        private ICareer careerLevel
      • spouse

        private java.util.Optional<ISpouseData> spouse
      • company

        private final ICompany company
      • clientServerEventBus

        @Autowired
        @Qualifier("serverClientEventBus")
        private com.google.common.eventbus.AsyncEventBus clientServerEventBus
      • luidProvider

        @Autowired
        private LUIDProvider luidProvider
      • criminalDrive

        private int criminalDrive
      • children

        private java.util.List<IChild> children
    • Method Detail

      • getName

        public java.lang.String getName()
        Description copied from interface: ICitizen
        Retrieve the players name
        Specified by:
        getName in interface ICitizen
        Specified by:
        getName in interface IShipOwner
        Returns:
        first name of the citizen.
      • getLastName

        public java.lang.String getLastName()
        Description copied from interface: ICitizen
        Get a players last name
        Specified by:
        getLastName in interface ICitizen
        Specified by:
        getLastName in interface IShipOwner
        Returns:
        last name of the citizen
      • getHometown

        public ICity getHometown()
        Description copied from interface: ICitizen
        Retreive the hometown of the citizen.
        Specified by:
        getHometown in interface ICitizen
        Returns:
        home city of the citizen.
      • getFleet

        public java.util.List<IShip> getFleet()
        Description copied from interface: IPlayer
        Get a list of all ships
        Specified by:
        getFleet in interface IPlayer
        Returns:
        list of the players ships.
      • getSelectableVessels

        public java.util.List<INavigableVessel> getSelectableVessels()
        Description copied from interface: IPlayer
        Provide a different view on the fleet by containing all the vessels that can be selected.
        Specified by:
        getSelectableVessels in interface IPlayer
        Returns:
        list of vessels that can be activated.
      • addSelectableVessel

        public void addSelectableVessel​(INavigableVessel vessel)
        Description copied from interface: IPlayer
        Add a selectable vessel to the list.
        Specified by:
        addSelectableVessel in interface IPlayer
        Parameters:
        vessel - to be added
      • removeSelectableVessel

        public void removeSelectableVessel​(INavigableVessel vessel)
        Description copied from interface: IPlayer
        Remove a selectable vessel from the list.
        Specified by:
        removeSelectableVessel in interface IPlayer
        Parameters:
        vessel - to be removed.
      • addShip

        public void addShip​(IShip ship)
        Description copied from interface: IPlayer
        Add a new ship for the player
        Specified by:
        addShip in interface IPlayer
        Parameters:
        ship - to be added to the fleet.
      • removeShip

        public void removeShip​(IShip ship)
        Description copied from interface: IPlayer
        Remove a ship for the player
        Specified by:
        removeShip in interface IPlayer
        Parameters:
        ship - to be removed from the fleet.
      • findBuildings

        public java.util.List<IBuilding> findBuildings​(ICity city)
        Description copied from interface: IPlayer
        Find all buildings of the player in the city
        Specified by:
        findBuildings in interface IPlayer
        Parameters:
        city - where to search for buildings.
        Returns:
        list of buildings in city owned by the player.
      • findTradingOffice

        public java.util.Optional<ITradingOffice> findTradingOffice​(ICity city)
        Description copied from interface: IPlayer
        Find the trading office of the player in the city.
        Specified by:
        findTradingOffice in interface IPlayer
        Parameters:
        city - where to look for a trading office
        Returns:
        Optional trading office. Empty if there is none in the city.
      • findBuildings

        public <T extends IBuilding> java.util.List<T> findBuildings​(ICity city,
                                                                     java.lang.Class<T> buildingClass)
        Description copied from interface: IPlayer
        Find all buildings in the city that are some subtype of the indicated class
        Specified by:
        findBuildings in interface IPlayer
        Parameters:
        city - in which to look for buildings
        buildingClass - class of the building that is searched
        Returns:
        type cast list of the buildings in city.
      • marry

        public void marry​(ISpouseData spouse)
        Marry a spouse
        Specified by:
        marry in interface IPlayer
        Parameters:
        spouse - to be married
      • spouseDies

        public void spouseDies()
        Description copied from interface: IPlayer
        Widow and become unmarried again.
        Specified by:
        spouseDies in interface IPlayer
      • getPersonalData

        public IPersonalData getPersonalData()
        Description copied from interface: IPlayer
        Retrieve the personal data of the player
        Specified by:
        getPersonalData in interface IPlayer
        Returns:
        personal data of the player.
      • getSpouseData

        public java.util.Optional<ISpouseData> getSpouseData()
        Description copied from interface: IPlayer
        Retrieve the personal data of the players spouse.
        Specified by:
        getSpouseData in interface IPlayer
        Returns:
        Optional spouse data. Empty if the player is not married.
      • updateRank

        public void updateRank​(ESocialRank rank)
        Description copied from interface: IPlayer
        Update to the new social rank
        Specified by:
        updateRank in interface IPlayer
        Parameters:
        rank - new social rank.
      • findShips

        public java.util.List<INavigableVessel> findShips​(ICity city)
        Description copied from interface: IPlayer
        Find all ships in a city
        Specified by:
        findShips in interface IPlayer
        Parameters:
        city - in which to fin ships
        Returns:
        list of vessels in the city
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • receiveSum

        public void receiveSum​(long amount)
        Description copied from interface: ICreditor
        Handle method for recieving a payment
        Specified by:
        receiveSum in interface ICreditor
        Parameters:
        amount - paid money amount.
      • updateCrimialDrive

        public void updateCrimialDrive​(int value)
        Description copied from interface: IPlayer
        Update the new value indicating the level of criminallity of the player
        Specified by:
        updateCrimialDrive in interface IPlayer
        Parameters:
        value - new criminal drive value.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object