src/Measurements/Experiences/ExperiencesTable.php
/**
     * Casting level to experiences is mostly lossy conversion!
     * Gives all experiences needed to achieve all levels sequentially up to given.
     *
     * @param Level $level
     * @return Experiences
     */
Casting level to experiences is mostly lossy conversion.
Gives all experiences needed to achieve all levels sequentially up to given.

@param Level $level
@return Experiences
Casting level to experiences is mostly lossy conversion . Gives all experiences needed to achieve all levels sequentially up to given . @param Level $level @return Experiences
public function toTotalExperiences(Level $level): Experiences
    {
        $experiencesSum = 0;
        for ($levelValueToCast = $level->getValue(); $levelValueToCast > 0; $levelValueToCast--) {
            if ($levelValueToCast > 1) { 
                $currentLevel = new Level($levelValueToCast, $this);
                $experiencesSum += $currentLevel->getExperiences()->getValue();
            }
        }
        return new Experiences($experiencesSum, $this);
    }
public function toTotalExperiences ( Level $ level ) : Experiences { $ experiencesSum = 0 ; for ( $ levelValueToCast = $ level -> getValue ( ) ; $ levelValueToCast > 0 ; $ levelValueToCast -- ) { if ( $ levelValueToCast > 1 ) { $ currentLevel = new Level ( $ levelValueToCast , $ this ) ; $ experiencesSum += $ currentLevel -> getExperiences ( ) -> getValue ( ) ; } } return new Experiences ( $ experiencesSum , $ this ) ; }
Casting level to experiences is mostly lossy conversion!
Casting level to experiences is mostly lossy conversion!
// main profession has first level for free