gamesmkt / fishpond
Fishpond 是一个游戏抽象层。
v1.0.11
2020-04-20 17:16 UTC
Requires
- php: >=7.2
- graham-campbell/guzzle-factory: ^3
- guzzlehttp/guzzle: ^6.5
- illuminate/log: ~5.5 || ^6.8 || ^7.0
- illuminate/support: ~5.5 || ^6.8 || ^7.0
- ramsey/uuid: ^3.9
Requires (Dev)
- mockery/mockery: ^1.0
- phpunit/phpunit: ^8.0
This package is auto-updated.
Last update: 2024-09-20 19:09:37 UTC
README
Fishpond 是一个游戏抽象层。
安装
composer require gamesmkt/fishpond
创建一个适配器
适配器是什么
适配器可以被当作一个插头 - 补充原先不兼容的 API 之间的差距。适配器的工作是将请求转换为游戏厂商可以理解的调用,并重新格式化响应以符合通用游戏厂商的接口。
请勿直接使用适配器,仅应将其用于创建Gamesmkt\Fishpond\FishpondInterface
。
实现主接口
适配器需要实现 Gamesmkt\Fishpond\AdapterInterface
。这个 interface 指示需要实现的 all methods。适配器的 interface 类似于 Gamesmkt\Fishpond\FishpondInterface
,method names 相同,但 response 通常不同。
适配器的 response 通常是包含 requested value 的 array。因为调用游戏厂商返回的值通常比 client 最初 requested 的要多。
响应值
key | 描述 | 类型 |
---|---|---|