rborges/dnd-5e-wrapper

此包的最新版本(dev-main)没有提供许可证信息。

使用 symfony 开发的 Dnd 5e PHP 包装器

dev-main 2022-01-31 20:32 UTC

This package is auto-updated.

Last update: 2024-09-29 05:57:03 UTC


README

安装

您可以将仓库克隆到您选择的路径,或者通过 composer 安装。

composer require rborges/dnd-5e-wrapper

用法

总共有12个实体,包括这些

use Dnd5eApi\DndApi;

$dndApi = new DndApi();
//get dnd classes
$class = $dnd->classes();
//get specific class
$bard = $class->bard();
//get bard proficiencies
$bardProficiencies = $bard->getProficiencies();
//get dnd races
$race = $dnd->races();
$dwarf = $race->dwarf();
$dwarfStartingProficencies = $dwarf->getStartingProficiencies();

测试

要测试应用程序,请简单使用

composer test

数据

此应用程序使用 'Dungeons and Dragons 5th Edition REST API v1' api 作为数据的来源。您可以在 这里 找到。

要求

  • PHP >= 7.3
  • OpenSSL PHP 扩展
  • PDO PHP 扩展
  • Mbstring PHP 扩展