承接 egusakov/characteristics-generator 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

egusakov/characteristics-generator

Composer 安装命令:

composer require egusakov/characteristics-generator

包简介

A simple library that allows you to generate character characteristics depending on their rarity

README 文档

README

Characteristics Generator is a simple PHP library for generating character characteristics based on their rarity. It is ideal for game and application developers who need to create unique character attributes.

Basic features available out of the box:

  1. Health
  2. Power
  3. Defense
  4. Agility
  5. Rarity
  6. Energy

Installing

The recommended way to install Characteristics Generator is via Composer.

composer require Eegusakov/characteristics-generator

Simple example

use Eegusakov\CharacteristicsGenerator\CharacteristicsFactory;
use Eegusakov\CharacteristicsGenerator\Entities\ValidRange;
use Eegusakov\CharacteristicsGenerator\Rarity\Common;
use Eegusakov\CharacteristicsGenerator\Rarity\Epic;
use Eegusakov\CharacteristicsGenerator\Rarity\Legendary;
use Eegusakov\CharacteristicsGenerator\Rarity\Rare;
use Eegusakov\CharacteristicsGenerator\Rarity\Uncommon;

$factory = new CharacteristicsFactory(
    new Common(50, 3, new ValidRange(20, 40)),
    new Uncommon(25, 4, new ValidRange(30, 50)),
    new Rare(15, 5, new ValidRange(40, 60)),
    new Epic(7, 8, new ValidRange(50, 80)),
    new Legendary(3, 10, new ValidRange(80, 100))
);

$characteristics = $factory->create();

License

This project is licensed under the MIT license - see the LICENSE file for details

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-02-04