Zappy Server
C++ game server: world, rules, scheduler, network
Loading...
Searching...
No Matches
AiParser Class Reference

Parses a raw AI client line into a typed Ai::Command. More...

#include <AiParser.hpp>

+ Collaboration diagram for AiParser:

Static Public Member Functions

static std::optional< Ai::Commandparse (std::string_view line)
 Parse one line from an AI client (no trailing newline).
 

Detailed Description

Parses a raw AI client line into a typed Ai::Command.

Strict and case-sensitive. Returns nullopt on unknown or malformed input. The caller (CommandDispatcher) handles sending "ko\n" back to the client.

See also
G-YEP-400_zappy.pdf for syntax of each command.

Definition at line 52 of file AiParser.hpp.

Member Function Documentation

◆ parse()

std::optional< Ai::Command > AiParser::parse ( std::string_view  line)
static

Parse one line from an AI client (no trailing newline).

Returns
Parsed command, or nullopt if unknown or malformed.

Definition at line 3 of file AiParser.cpp.

References Resources::fromName(), and res().

Referenced by CommandDispatcher::_dispatchAi().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: