private function initialize()
    {
        $this->undefinedCardResolution = isset($this->config['options']['undefined_card'])
            ? static::translateUndefinedCardResolution($this->config['options']['undefined_card'])
            : UndefinedCardResolution::DEFAULT_CARD;

        if (isset($this->config['options']['delimiter'])) {
            $this->delimiter = $this->config['options']['delimiter'];
        }

        foreach ($this->config['slots'] as $slotName => &$slotData) {
            $slotData['name'] = $slotName;

            if (is_string($slotData['reel'])) {
                $slotData['reel'] = $this->config['reels'][$slotData['reel']];
            }

            if (!isset($slotData['nested'])) {
                $slotData['nested'] = array();
            }

            $slotData['undefined_card'] = (!isset($slotData['undefined_card']))
                ? $this->undefinedCardResolution
                : static::translateUndefinedCardResolution($slotData['undefined_card']);

            $this->offsetSet($slotName, function () use ($slotData) {
                return new Slot($slotData);
            });
        }
    }
private function initialize()
    {
        $this->undefinedCardResolution = isset($this->config['options']['undefined_card'])
            ? static::translateUndefinedCardResolution($this->config['options']['undefined_card'])
            : UndefinedCardResolution::DEFAULT_CARD;

        if (isset($this->config['options']['delimiter'])) {
            $this->delimiter = $this->config['options']['delimiter'];
        }

        foreach ($this->config['slots'] as $slotName => &$slotData) {
            $slotData['name'] = $slotName;

            if (is_string($slotData['reel'])) {
                $slotData['reel'] = $this->config['reels'][$slotData['reel']];
            }

            if (!isset($slotData['nested'])) {
                $slotData['nested'] = array();
            }

            $slotData['undefined_card'] = (!isset($slotData['undefined_card']))
                ? $this->undefinedCardResolution
                : static::translateUndefinedCardResolution($slotData['undefined_card']);

            $this->offsetSet($slotName, function () use ($slotData) {
                return new Slot($slotData);
            });
        }
    }
private function initialize ( ) { $ this -> undefinedCardResolution = isset ( $ this -> config [ 'options' ] [ 'undefined_card' ] ) ? static :: translateUndefinedCardResolution ( $ this -> config [ 'options' ] [ 'undefined_card' ] ) : UndefinedCardResolution :: DEFAULT_CARD ; if ( isset ( $ this -> config [ 'options' ] [ 'delimiter' ] ) ) { $ this -> delimiter = $ this -> config [ 'options' ] [ 'delimiter' ] ; } foreach ( $ this -> config [ 'slots' ] as $ slotName => & $ slotData ) { $ slotData [ 'name' ] = $ slotName ; if ( is_string ( $ slotData [ 'reel' ] ) ) { $ slotData [ 'reel' ] = $ this -> config [ 'reels' ] [ $ slotData [ 'reel' ] ] ; } if ( ! isset ( $ slotData [ 'nested' ] ) ) { $ slotData [ 'nested' ] = array ( ) ; } $ slotData [ 'undefined_card' ] = ( ! isset ( $ slotData [ 'undefined_card' ] ) ) ? $ this -> undefinedCardResolution : static :: translateUndefinedCardResolution ( $ slotData [ 'undefined_card' ] ) ; $ this -> offsetSet ( $ slotName , function ( ) use ( $ slotData ) { return new Slot ( $ slotData ) ; } ) ; } }
Set up the SlotMachine in a ready to use state
Set up the SlotMachine in a ready to use state