Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace AqwSocketClient\Interfaces; |
| 6 | |
| 7 | use AqwSocketClient\Packet; |
| 8 | use AqwSocketClient\Scripts\ClientContext; |
| 9 | |
| 10 | /** |
| 11 | * Represents the game client to a {@see AqwSocketClient\Server} |
| 12 | */ |
| 13 | interface ClientInterface |
| 14 | { |
| 15 | public function connect(): void; |
| 16 | |
| 17 | public function disconnect(): void; |
| 18 | |
| 19 | public function isConnected(): bool; |
| 20 | |
| 21 | /** |
| 22 | * Returns the next messages from server |
| 23 | * |
| 24 | * @return MessageInterface[] |
| 25 | * */ |
| 26 | public function receive(): array; |
| 27 | |
| 28 | public function send(Packet $packet): void; |
| 29 | |
| 30 | public function run(ScriptInterface $script): void; |
| 31 | |
| 32 | /** |
| 33 | * Returns the context from the last {@see ClientInterface::run()} call. |
| 34 | * |
| 35 | * Returns null if {@see ClientInterface::run()} has not been called yet. |
| 36 | */ |
| 37 | public function context(): ?ClientContext; |
| 38 | } |