146 template <
class U = T>
147 decltype(U::Value)
ValueOr(
decltype(U::Value) fallback)
const
149 return Value ?
Value->Value : std::move(fallback);
155using All = std::tuple<Target, Targets, Duration, SteamId, PlayerOrSteamId, Int, U64, Word, Rest>;
167template <
class Tuple>
173 using Type = std::variant<std::monostate, A...>;
180template <std::size_t... I>
183 return ((
static_cast<std::size_t
>(std::tuple_element_t<I, Args::All>::Kind) == I) && ...);
186static_assert(
ArgKindsMatchOrder(std::make_index_sequence<std::tuple_size_v<Args::All>>{}),
187 "Args::All must list the argument types in ArgKind declaration order.");
198 { T::Kind } -> std::convertible_to<ArgKind>;
212template <NamesArgKind T>
224 static_assert(!
IsOptionalArg<T>,
"Args::Opt cannot wrap another Args::Opt; one marks the argument optional.");
243 for (
bool isOptional : optional)
263 for (std::size_t i = 0; i + 1 < kinds.size(); ++i)
297 if (std::holds_alternative<std::monostate>(bound))
One connected player, owned by PlayerManager for the length of the connection.
Static utilities for converting between SteamID formats (64-bit, SteamID2, SteamID3).
The argument types a command handler's parameter list is written in.
std::tuple< Target, Targets, Duration, SteamId, PlayerOrSteamId, Int, U64, Word, Rest > All
consteval bool RestIsLast()
typename BoundArgVariant< Args::All >::Type BoundArg
constexpr bool IsOptionalArg
ArgKind
Which binder runs for one declared argument.
std::vector< ArgDesc > DescribeArgs()
consteval bool OptionalsTrail()
consteval bool ArgKindsMatchOrder(std::index_sequence< I... >)
typename ArgTrait< T >::Bound Bound
static constexpr bool Optional
static constexpr ArgKind Kind
static constexpr ArgKind Kind
static constexpr bool Optional
What one handler parameter type means to the framework.
static Args::Opt< T > From(const BoundArg &bound)
static T From(const BoundArg &bound)
std::chrono::seconds Value
static constexpr ArgKind Kind
static constexpr ArgKind Kind
decltype(U::Value) ValueOr(decltype(U::Value) fallback) const
static constexpr ArgKind Kind
static constexpr ArgKind Kind
static constexpr ArgKind Kind
Player * operator->() const
static constexpr ArgKind Kind
static constexpr ArgKind Kind
std::vector< Player * > Value
static constexpr ArgKind Kind
static constexpr ArgKind Kind
std::variant< std::monostate, A... > Type