Interface ITradingOffice

  • All Superinterfaces:
    IBuilding
    All Known Implementing Classes:
    TradingOffice

    public interface ITradingOffice
    extends IBuilding
    The trading office (Kontor) is the trading point in a city. You can buy/sell between the trading office and the city. You can move wares and wares between your storage and any ship currently in the city.
    Author:
    Andi Hotz, (c) Sahits GmbH, 2011 Created on Dec 17, 2011
    • Method Detail

      • getWare

        AmountablePrice<IWare> getWare​(IWare ware)
        Retrieve the amount of ware in storage
        Parameters:
        ware - to be checked in the trading office.
        Returns:
        amount and price of the ware stored in the trading office.
      • hasWeapons

        boolean hasWeapons()
        check if there are any weapons in storage
        Returns:
        true if weapons are stored.
      • move

        @Deprecated
        int move​(IWare ware,
                 int amount)
        Deprecated.
        Add or remove ware from the storage. If the amount is negative it will be removed. If the full amount is not available only the available will be moved and returned. The amount is in the ware specific size. The price of the wares is computed based on the amount
        Parameters:
        ware - to be moved in/out of the trading office
        amount - of ware to be moved.
        Returns:
        amount that is acctualy moved
      • move

        int move​(IWeapon weapons,
                 int amount)
        Add or remove weapon from the storage. If the amount is negative it will be removed. If the full amount is not available only the available will be moved and returned. The amount is in the ware specific size.
        Parameters:
        weapons - weapon that should be moved
        amount - of weapons that should be moved
        Returns:
        actual amount moved
      • capacityProperty

        javafx.beans.property.IntegerProperty capacityProperty()
        Retrieve the storage capacity of the trading office and all other storages in the same city
        Returns:
        storage capacity in barrels
      • move

        int move​(IWare ware,
                 int moved,
                 int avgPrice)
        Move the ware into/from the storage with a price attached.
        Parameters:
        ware - to be moved
        moved - amount to be moved. Negative values indicate removal of the ware from the trading office.
        avgPrice - average price to use on the amount of ware
        Returns:
        the amount that was actually moved. If the ware was to be removed the returned value is <= 0.
      • getBalanceLastWeek

        IBalanceSheet getBalanceLastWeek()
        Retrieve the balance sheet for last completed week.
        Returns:
        last weeks balance sheet
      • getCurrentWeek

        IBalanceSheet getCurrentWeek()
        Retrieve the balance sheet for the current week
        Returns:
        current weeks balance sheet
      • getSteward

        java.util.Optional<ISteward> getSteward()
        Retrieve the steward of the trading office (manager). May be null if no manager is employed
        Returns:
        Optional steward. Empty if none is hired.
      • setSteward

        void setSteward​(ISteward steward)
        Setting the steward. May be null to indicate firing the steward
        Parameters:
        steward - to set/unset (null)
      • getOfficeTrading

        IAutomatedTrading getOfficeTrading()
        Get the trading object of the office
        Returns:
        Automated trading instance for this office
      • getWeaponStorage

        IWeaponStorage getWeaponStorage()
        Retrieve the weapon storage for this trading office
        Returns:
        storage of the weapons
      • getStorage

        IStorage getStorage()
        Retrieve an overview over the storage
        Returns:
        ware storage
      • storedAmountBinding

        javafx.beans.binding.IntegerBinding storedAmountBinding()
        Binding representing the current stored amount.
        Returns:
        integer binding of the stored amount in barrels.
      • stewardProperty

        javafx.beans.property.ObjectProperty<ISteward> stewardProperty()
        Property holding the steward.
        Returns:
        object property for the steward
      • storageManagerPresentBinding

        javafx.beans.binding.BooleanBinding storageManagerPresentBinding()
        Binding indicating the presence of a steward.
        Returns:
        boolean binding for the presence of a steward.
      • getOccupiedSpace

        int getOccupiedSpace()
        Retrieve tha amount of occupied space not available to the player.
        Returns:
        occupied space in barrels
      • setOccupiedSpace

        void setOccupiedSpace​(int space)
        Set the amount of occupied space not available to the player.
        Parameters:
        space - new occupied space
      • getCity

        ICity getCity()
        Retrieve the city the trading office is located in.
        Specified by:
        getCity in interface IBuilding
        Returns:
        city in which the trading office is located.
      • replaceBalanceSheet

        void replaceBalanceSheet​(IBalanceSheet newWeek)
        Replace the last weeks balance sheet with the current week and set the new balance sheet for this week.
        Parameters:
        newWeek - balance sheet to replace the old one.
      • getEstablishedDate

        java.time.LocalDateTime getEstablishedDate()
        Retrieve the date when the trading office was established.
        Returns:
        date when the trading office was built.