[][src]Crate quill_prototype

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

BlockId

(Would be reexported from feather-blocks in the final product)

BlockPosition

Position of a block in world space.

ChunkNotLoaded

Error returned when a block cannot be accessed because its chunk is not loaded.

CommandBuilder

A builder for a command.

ComponentRef

An RAII guard to a component reference.

ComponentRefMut

An RAII guard to a mutable reference to a component.

EntityDead

Error returned when an entity no longer exists.

EntityId

An opaque, unique ID of an entity. Can be used with State::entity to get an EntityRef which allows access to an entity's components.

EntityRef

A handle to an entity. Provides access to components.

MissingResource

Error returned when a resource of some type does not exist.

Name

The name of an entity.

Position

A position in world space.

Setup

Struct passed to your plugin's setup function which is called when it's loaded.

State

The main server state.

Enums

ComponentError

Error returned when attempting to get a component from an entity.

Traits

Component

A type that can be associated with an entity as a component.

Resource

A type that can be stored in State as a "resource."

Type Definitions

CommandExecutor

A function that can be used as a command executor.

SysResult

Result type returned by most functions.

System

A system, the S part of the ECS.