This is the beast Reference Manual, version 1.2.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 04:21:48 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
beast
Basic Entity/Aspect/System Toolkit
Steve Losh <steve@stevelosh.com>
MIT
1.2.0
src
(module).
Modules are listed depth-first from the system components tree.
beast/src
beast
(system).
package.lisp
(file).
main.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
beast/src/main.lisp
package.lisp
(file).
src
(module).
all-entities
(function).
clear-entities
(function).
create-entity
(function).
define-aspect
(macro).
define-entity
(macro).
define-system
(macro).
destroy-entity
(function).
entity
(class).
entity-created
(generic function).
entity-destroyed
(generic function).
entity-id
(reader method).
map-entities
(function).
print-object
(method).
*aspect-index*
(special variable).
*entity-id-counter*
(special variable).
*entity-index*
(special variable).
*system-index*
(special variable).
*systems*
(special variable).
build-system-runner
(function).
entity-satisfies-system-type-specifier-p
(function).
get-entity
(function).
index-entity
(function).
index-entity-aspects
(function).
index-entity-systems
(function).
initialize-aspect-index
(function).
initialize-system-index
(function).
rebuild-system-index
(function).
symb
(function).
unindex-entity
(function).
unindex-entity-aspects
(function).
unindex-entity-systems
(function).
Packages are listed by definition order.
beast
common-lisp
.
all-entities
(function).
clear-entities
(function).
create-entity
(function).
define-aspect
(macro).
define-entity
(macro).
define-system
(macro).
destroy-entity
(function).
entity
(class).
entity-created
(generic function).
entity-destroyed
(generic function).
entity-id
(generic reader).
map-entities
(function).
*aspect-index*
(special variable).
*entity-id-counter*
(special variable).
*entity-index*
(special variable).
*system-index*
(special variable).
*systems*
(special variable).
build-system-runner
(function).
entity-satisfies-system-type-specifier-p
(function).
get-entity
(function).
index-entity
(function).
index-entity-aspects
(function).
index-entity-systems
(function).
initialize-aspect-index
(function).
initialize-system-index
(function).
rebuild-system-index
(function).
symb
(function).
unindex-entity
(function).
unindex-entity-aspects
(function).
unindex-entity-systems
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Define an aspect class.
‘name‘ should be a symbol that will become the name of the class.
‘fields‘ should be zero or more field definitions. Each field definition can
be a symbol (the field name), or a list of the field name and extra CLOS slot
options.
Field names will have the aspect name and a slash prepended to them to create
the slot names. ‘:initarg‘ and ‘:accessor‘ slot options will also be
automatically generated.
Example:
(define-aspect edible
energy
(taste :initform nil))
=>
(defclass edible ()
((edible/energy :initarg :edible/energy
:accessor edible/energy)
(edible/taste :initarg :edible/taste
:accessor edible/taste
:initform nil)))
Define an entity class.
‘name‘ should be a symbol that will become the name of the class.
‘aspects‘ should be a list of the aspects this entity should inherit from.
‘slots‘ can be zero or more extra CLOS slot definitions.
Examples:
(define-entity potion (drinkable))
(define-entity cheese (edible visible)
(flavor :accessor cheese-flavor :initarg :flavor))
Define a system.
‘name-and-options‘ should be a list of the system name (a symbol) and any
system options. A bare symbol can be used if no options are needed.
‘arglist‘ should be a list of system arguments. Each argument should be
a list of the argument name and zero or more aspect/entity classes.
Defining a system ‘foo‘ defines two functions:
* ‘foo‘ runs ‘body‘ on a single entity and should only be used for debugging,
tracing, or disassembling.
* ‘run-foo‘ should be called to run the system on all applicable entities.
Available system options:
* ‘:inline‘: when true, try to inline the system function into the
system-running function to avoid the overhead of a function call for every
entity. Defaults to ‘nil‘.
Examples:
(define-system age ((entity lifetime))
(when (> (incf (lifetime/age entity))
(lifetime/lifespan entity))
(destroy-entity entity)))
Return a list of all entities.
Normally you should run code on entities using systems, but this function can
be handy for debugging purposes.
Destroy all entities.
‘destroy-entity‘ will be called for each entity.
Returns a list of all the destroyed entites.
Create an entity of the given entity class and return it.
‘initargs‘ will be passed along to ‘make-instance‘.
The ‘entity-created‘ generic function will be called just before returning the
entity.
Destroy ‘entity‘ and return it.
The ‘entity-destroyed‘ generic function will be called after the entity has
been destroyed and unindexed.
Map ‘function‘ over all entities that are subtypes of ‘type‘.
Normally you should run code on entities using systems, but this function can
be handy for debugging purposes.
Called after an entity has been created and indexed.
The default method does nothing, but users can implement their own auxillary
methods to run code when entities are created.
Called after an entity has been destroyed and unindexed.
The default method does nothing, but users can implement their own auxillary
methods to run code when entities are destroyed.
A single entity in the game world.
The unique ID of the entity. This may go away in the future.
(incf beast::*entity-id-counter*)
This slot is read-only.
A list of the aspects this entity class inherits. **Don’t touch this.**
:class
Return the entity with the given ‘id‘, or ‘nil‘ if it is unknown.
Insert ‘entity‘ into the entity index.
Insert ‘entity‘ into appropriate aspect indexes.
Insert ‘entity‘ into appropriate system indexes.
Remove ‘entity‘ from the entity-level index.
Remove ‘entity‘ from the aspect indexes.
Remove ‘entity‘ from the system indexes.
Jump to: | A B C D E F G I M P R S U |
---|
Jump to: | A B C D E F G I M P R S U |
---|
Jump to: | %
*
I S |
---|
Jump to: | %
*
I S |
---|
Jump to: | B C E F M P S |
---|
Jump to: | B C E F M P S |
---|