Class RequiredWareCityStorage


  • public class RequiredWareCityStorage
    extends java.lang.Object
    Class to store the required amount in to facilitate the binding. Based on the amount in storage and in the city together with the required amount bindings for the buy amount and buy price is calculated, along with the possibility that not enough wares can be purchased.
    Author:
    Andi Hotz, (c) Sahits GmbH, 2017 Created on Sep 16, 2017
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private javafx.beans.binding.IntegerBinding buyAmount  
      private javafx.beans.binding.IntegerBinding buyPrice  
      private javafx.beans.binding.BooleanBinding canBuy  
      private javafx.beans.property.IntegerProperty inCity  
      private javafx.beans.property.IntegerProperty inStorage  
      private javafx.beans.property.IntegerProperty required  
    • Constructor Summary

      Constructors 
      Constructor Description
      RequiredWareCityStorage​(int needed, javafx.beans.property.IntegerProperty inStorageAmount, javafx.beans.property.IntegerProperty inCityAmount, IWare ware, ComputablePriceV2 computablePrice)  
    • Field Detail

      • required

        private javafx.beans.property.IntegerProperty required
      • inStorage

        private final javafx.beans.property.IntegerProperty inStorage
      • inCity

        private final javafx.beans.property.IntegerProperty inCity
      • buyAmount

        private javafx.beans.binding.IntegerBinding buyAmount
      • buyPrice

        private javafx.beans.binding.IntegerBinding buyPrice
      • canBuy

        private javafx.beans.binding.BooleanBinding canBuy
    • Constructor Detail

      • RequiredWareCityStorage

        public RequiredWareCityStorage​(int needed,
                                       javafx.beans.property.IntegerProperty inStorageAmount,
                                       javafx.beans.property.IntegerProperty inCityAmount,
                                       IWare ware,
                                       ComputablePriceV2 computablePrice)
    • Method Detail

      • requiredProperty

        public javafx.beans.property.IntegerProperty requiredProperty()
      • setRequired

        public void setRequired​(int required)
      • inStorageProperty

        public javafx.beans.property.IntegerProperty inStorageProperty()
      • inCityProperty

        public javafx.beans.property.IntegerProperty inCityProperty()
      • getBuyAmount

        public java.lang.Number getBuyAmount()
      • buyAmountProperty

        public javafx.beans.binding.IntegerBinding buyAmountProperty()
      • getBuyPrice

        public java.lang.Number getBuyPrice()
      • buyPriceProperty

        public javafx.beans.binding.IntegerBinding buyPriceProperty()
      • getCanBuy

        public java.lang.Boolean getCanBuy()
      • canBuyProperty

        public javafx.beans.binding.BooleanBinding canBuyProperty()