/** * @return array|string[] */ private function getNonBaseNonDerivedPropertyCodes() { return array_diff(PropertyCode::getPossibleValues(), PropertyCode::getBasePropertyPossibleValues(), PropertyCode::getDerivedPropertyPossibleValues(), PropertyCode::getRemarkableSensePropertyPossibleValues()); }
/** * @param string $basePropertyCode * @param GenderCode $genderCode * @param Tables $tables * @return int * @throws \DrdPlus\Races\Exceptions\UnknownBasePropertyCode * @throws \DrdPlus\Races\Exceptions\UnknownPropertyCode */ public function getBaseProperty($basePropertyCode, GenderCode $genderCode, Tables $tables) { if (in_array($basePropertyCode, PropertyCode::getBasePropertyPossibleValues(), true)) { return $this->getProperty($basePropertyCode, $genderCode, $tables); } throw new Exceptions\UnknownBasePropertyCode('Unknown base property ' . ValueDescriber::describe($basePropertyCode)); }
private function setUpBaseProperties(Race $race, GenderCode $genderCode, ExceptionalityProperties $exceptionalityProperties, ProfessionLevels $professionLevels, Tables $tables) { $propertyValues = []; foreach (PropertyCode::getBasePropertyPossibleValues() as $basePropertyCode) { $propertyValues[$basePropertyCode] = $this->calculateFirstLevelBaseProperty($basePropertyCode, $race, $genderCode, $tables, $exceptionalityProperties, $professionLevels); } $this->firstLevelUnlimitedStrength = Strength::getIt($propertyValues[Strength::STRENGTH]); $this->firstLevelStrength = $this->getLimitedProperty($race, $genderCode, $tables, $this->firstLevelUnlimitedStrength); $this->firstLevelUnlimitedAgility = Agility::getIt($propertyValues[Agility::AGILITY]); $this->firstLevelAgility = $this->getLimitedProperty($race, $genderCode, $tables, $this->firstLevelUnlimitedAgility); $this->firstLevelUnlimitedKnack = Knack::getIt($propertyValues[Knack::KNACK]); $this->firstLevelKnack = $this->getLimitedProperty($race, $genderCode, $tables, $this->firstLevelUnlimitedKnack); $this->firstLevelUnlimitedWill = Will::getIt($propertyValues[Will::WILL]); $this->firstLevelWill = $this->getLimitedProperty($race, $genderCode, $tables, $this->firstLevelUnlimitedWill); $this->firstLevelUnlimitedIntelligence = Intelligence::getIt($propertyValues[Intelligence::INTELLIGENCE]); $this->firstLevelIntelligence = $this->getLimitedProperty($race, $genderCode, $tables, $this->firstLevelUnlimitedIntelligence); $this->firstLevelUnlimitedCharisma = Charisma::getIt($propertyValues[Charisma::CHARISMA]); $this->firstLevelCharisma = $this->getLimitedProperty($race, $genderCode, $tables, $this->firstLevelUnlimitedCharisma); }
/** * @test */ public function I_can_get_base_property_codes() { self::assertEquals($expectedCodes = ['strength', 'agility', 'knack', 'will', 'intelligence', 'charisma'], PropertyCode::getBasePropertyPossibleValues()); }