fvfvfvfv / codyfight-php
Codyfight的PHP客户端
dev-main
2024-06-20 12:31 UTC
Requires
- php: ^8.1
- guzzlehttp/guzzle: ^7.0
This package is auto-updated.
Last update: 2024-09-20 13:04:53 UTC
README
安装
composer install fvfvfvfv/codyfight-php
使用
在能够与Codyfight API交互之前,您需要生成一个CKey
创建一个Codyfight实例
$codyfight = new \Fvfvfvfv\CodyfightClient\Codyfight($cKey);
开始游戏
$game = $codyfight->init(\Fvfvfvfv\CodyfightClient\Enums\GameMode::FRIENDLY, 'foo')
与Codyfight API的每次交互都会返回一个Game
类实例。此实例包含API返回的所有数据。
将来,此客户端将扩展以将返回的数据转换为相关类。
可用方法
$codyfight->init(\Fvfvfvfv\CodyfightClient\Enums\GameMode::FRIENDLY, 'foo'); // Initializes a new game $codyfight->check(); // Returns a Game instance without performing any action $codyfight->cast($skillId, $x, $y); // Cast a skill onto the specified tile $dodyfight->move($x, $y); // Moves the player to the specified tile $codyFight->surrender(); // Surrenders the game