private void startProduction ( Featurable featurable ) { final Transformable transformable = featurable . getFeature ( Transformable . class ) ; final Producible producible = featurable . getFeature ( Producible . class ) ; transformable . setLocation ( producible . getX ( ) , producible . getY ( ) ) ; handler . add ( featurable ) ; currentObject = featurable ; speed = stepsPerSecond / rate . getAsInt ( ) ; steps = current . getFeature ( Producible . class ) . getSteps ( ) ; progress = 0.0 ; for ( final ProducerListener listener : listeners ) { listener . notifyStartProduction ( featurable ) ; } for ( final ProducibleListener listener : featurable . getFeature ( Producible . class ) . getListeners ( ) ) { listener . notifyProductionStarted ( this ) ; } }
Start production of this element . Get its corresponding instance and add it to the handler . Featurable will be removed from handler if production is cancelled .