Example #1
0
 /**
  * @param MeleeWeaponCode $meleeWeaponCode
  * @return MeleeWeaponsTable
  * @throws \DrdPlus\Tables\Armaments\Exceptions\UnknownMeleeWeapon
  */
 public function getMeleeWeaponsTableByMeleeWeaponCode(MeleeWeaponCode $meleeWeaponCode)
 {
     if ($meleeWeaponCode->isAxe()) {
         return $this->getAxesTable();
     }
     if ($meleeWeaponCode->isKnifeOrDagger()) {
         return $this->getKnifesAndDaggersTable();
     }
     if ($meleeWeaponCode->isMaceOrClub()) {
         return $this->getMacesAndClubsTable();
     }
     if ($meleeWeaponCode->isMorningstarOrMorgenstern()) {
         return $this->getMorningstarsAndMorgensternsTable();
     }
     if ($meleeWeaponCode->isSaberOrBowieKnife()) {
         return $this->getSabersAndBowieKnifesTable();
     }
     if ($meleeWeaponCode->isStaffOrSpear()) {
         return $this->getStaffsAndSpearsTable();
     }
     if ($meleeWeaponCode->isSword()) {
         return $this->getSwordsTable();
     }
     if ($meleeWeaponCode->isUnarmed()) {
         return $this->getUnarmedTable();
     }
     if ($meleeWeaponCode->isVoulgeOrTrident()) {
         return $this->getVoulgesAndTridentsTable();
     }
     throw new UnknownMeleeWeapon("Unknown type of melee weapon '{$meleeWeaponCode}'");
 }