📚 Add some information about the command manager
This commit is contained in:
parent
dd3ad50dda
commit
00c63b7c0c
1 changed files with 43 additions and 2 deletions
|
|
@ -4,6 +4,8 @@ v0.1.0, 2020-12-30
|
||||||
:sectnums:
|
:sectnums:
|
||||||
:cloud-version: 1.3.0
|
:cloud-version: 1.3.0
|
||||||
:toc: left
|
:toc: left
|
||||||
|
:toclevels: 3
|
||||||
|
:icons: font
|
||||||
:hide-uri-scheme:
|
:hide-uri-scheme:
|
||||||
|
|
||||||
== Introduction to Cloud
|
== Introduction to Cloud
|
||||||
|
|
@ -75,8 +77,43 @@ cloud-pircbotx:: Cloud implementation for the PircBotX framework.
|
||||||
|
|
||||||
== Core
|
== Core
|
||||||
|
|
||||||
|
The core module contains the majority of the API that you will be interacting with when using
|
||||||
|
Cloud.
|
||||||
|
|
||||||
=== Command Manager
|
=== Command Manager
|
||||||
|
|
||||||
|
The first step to any Cloud project is to create a command manager. Each supported platform has
|
||||||
|
its own command manager, but for the most part they look and behave very similarly. It is possible
|
||||||
|
to support multiple platforms in the same project.
|
||||||
|
|
||||||
|
All command managers have a generic type argument for the command sender type. Most platforms have
|
||||||
|
their own "native" command sender type, but Cloud allows you to use whatever sender you want, by
|
||||||
|
supplying a mapping function to the command manager. This sender type will be included in the command context,
|
||||||
|
which you will be interacting with a lot when using Cloud.
|
||||||
|
|
||||||
|
[title="Creating a command manager instance using Bukkit"]
|
||||||
|
====
|
||||||
|
This particular example uses `cloud-bukkit`, though most concepts transfer over to the other command mangers.
|
||||||
|
|
||||||
|
[source,java]
|
||||||
|
----
|
||||||
|
CommandManager<CommandSender> manager = new BukkitCommandManager<>(
|
||||||
|
/* Owning plugin */ this,
|
||||||
|
AsynchronousCommandExecutionCoordinator.newBuilder().build(), <1>
|
||||||
|
Function.identity(), <2>
|
||||||
|
Function.identity(), <3>
|
||||||
|
);
|
||||||
|
----
|
||||||
|
<1> The execution coordinator handles the coordination of command parsing and execution. You can read more about this
|
||||||
|
in section 3.6.
|
||||||
|
<2> Function that maps the platform command sender to your command sender.
|
||||||
|
<3> Function that maps your command sender to the platform command sender.
|
||||||
|
====
|
||||||
|
|
||||||
|
The command manager is used to register commands, create builders, change command settings, etc.
|
||||||
|
More information can be found in the CommandManager
|
||||||
|
https://javadoc.commandframework.cloud/cloud/commandframework/CommandManager.html[JavaDoc].
|
||||||
|
|
||||||
=== Commands
|
=== Commands
|
||||||
|
|
||||||
Commands consist of chains of arguments that are parsed from user input. These arguments
|
Commands consist of chains of arguments that are parsed from user input. These arguments
|
||||||
|
|
@ -101,9 +138,9 @@ This example contains three unique commands.
|
||||||
|
|
||||||
=== Argument Types
|
=== Argument Types
|
||||||
|
|
||||||
==== Standard
|
==== Literals
|
||||||
|
|
||||||
==== literals
|
==== Standard
|
||||||
|
|
||||||
===== string
|
===== string
|
||||||
|
|
||||||
|
|
@ -133,8 +170,12 @@ This example contains three unique commands.
|
||||||
|
|
||||||
=== Permissions
|
=== Permissions
|
||||||
|
|
||||||
|
=== Exception Handling
|
||||||
|
|
||||||
=== Extra
|
=== Extra
|
||||||
|
|
||||||
|
==== Translations
|
||||||
|
|
||||||
==== Confirmations
|
==== Confirmations
|
||||||
|
|
||||||
==== Help Generation
|
==== Help Generation
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue