trismegiste/rpg-name-generator
最新稳定版本:v1.3
Composer 安装命令:
composer require trismegiste/rpg-name-generator
包简介
Library for generating random names (for table-top roleplaying games)
README 文档
README
The RPG character name generator library is designed to create list of random names used for table-top role-playing games.
This library was extracted from the website PHP-Character-Name-Generator from Mark Tasaka after a heavy overhaul and with the help of nikic/PHP-Parser (by the way, this tool is awesome)
This library is fully tested with PhpUnit, 100% code coverage.
Install
With Composer :
composer require trismegiste/rpg-name-generator
Usage
See phpunit tests for how to use this library :
$repo = new FileRepository(); print_r($repo->getSurnameListFor('japanese')); print_r($repo->getGivenNameListFor('female', 'japanese'));
RandomizerDecorator class is a decorator for adding randomizing capabilities :
$repo = new RandomizerDecorator(new FileRepository()); print_r($repo->getSurnameListFor('random')); // gets the list of surnames from a random language echo $repo->getRandomGivenNameFor('female', 'chinese'); // picks one random chinese female given name echo $repo->getRandomSurnameFor('french'); // picks one random french surname echo $repo->getRandomSurnameFor('random'); // picks one random surname from a random language (full random)
Test
With PhpUnit :
vendor/bin/phpunit
Code coverage
With phpdbg :
phpdbg -qrr vendor/bin/phpunit firefox doc/coverage/index.html
统计信息
- 总下载量: 72
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-11-25