Expand description
A prototype API for quill
, Feather’s plugin API.
§Concepts
- Feather is based on [the ECS architecture], an alternative to classic object-oriented game architecture which is generally more flexible and slightly more performant.
- Feather plugins compile to WebAssembly and are run in a sandboxed environment.
§Getting started
Install cargo-quill
, a command line tool to help build
and test Feather plugins:
cargo install cargo-quill
To start on a new plugin, run cargo quill init myplugin
.
cargo-quill
creates a new directory called myplugin
and
fills it with a starter template.
Let’s take a look at the directory structure:
myplugin
├── Cargo.toml
└── src
└── main.rs
Structs§
- (Would be reexported from
feather-blocks
in the final product) - Position of a block in world space.
- Error returned when a block cannot be accessed because its chunk is not loaded.
- A builder for a command.
- An RAII guard to a component reference.
- An RAII guard to a mutable reference to a component.
- Error returned when an entity no longer exists.
- An opaque, unique ID of an entity. Can be used with
State::entity
to get anEntityRef
which allows access to an entity’s components. - A handle to an entity. Provides access to components.
- Error returned when a resource of some type does not exist.
- The name of an entity.
- A position in world space.
- Struct passed to your plugin’s
setup
function which is called when it’s loaded. - The main server state.
Enums§
- Error returned when attempting to get a component from an entity.
Traits§
- A type that can be associated with an entity as a component.
- A type that can be stored in
State
as a “resource.”
Type Aliases§
- A function that can be used as a command executor.
- Result type returned by most functions.
- A system, the
S
part of the ECS.