2. Usage
TODO: Fill this in.
3. Examples
Official demos are here.
4. API Documentation
API documentation is here.
5. Changelog
-
Added validation to
atom-world
'squery
implementation. It doesn’t allow unknown (unreadable by currently running system) components to be queries anymore.
-
ITransactableWorld
and transaction concept are removed.;; A systems process used to call transaction! ;; to get an editable world: (comment (fn [w dt] (transaction! w (fn [w] (set-component! w ...)))) ;; Now process receives an editable world and can modify ;; the world directly: (fn [w dt] (set-component! w ...))
-
Components and systems are registered with worlds during initialization. Use
clecs.world/world
to create a new world.-
clecs.backend.atom-world/make-world
is removed. Useclecs.world/world
withclecs.world.backend.atom-world/atom-world-factory
instead:(world atom-world-factory {:components [(component ...) (component ...) (component ...) ...] :initializer (fn [w] ...) :systems [(system ...) (system ...) ...]})
-
ISystemManager
is renamed asIWorld
.Following functions are removed from this protocol:
-
remove-system!
-
set-system!
-
systems
-
-
-
world/set-component
accepts entity-id and component type explicitly.;; Old way: (comment (def c (->SomeComponent eid x y)) (world/set-component w c)) ;; New way: (world/set-component w eid :my.ns/SomeComponent {:x x :y y})
-
world/set-component
validates its input. -
Queries are constructed using component type keywords instead of records:
;; Old way: (comment (defrecord SomeComponent [eid]) (def q (all SomeComponent))) ;; New way: (def q (all :my.ns/SomeComponent))
-
clecs.core/make-world
is removed. -
Following deprecated functions are removed:
-
clecs.component/component?
-
clecs.component/component-label
-
clecs.component/component-type?
-
clecs.component/defcomponent
-
-
Removed support for systems as functions.
-
Deprecated
IComponent
is removed.
-
Components are no longer records. The same API still works but since a java class is not generated anymore you are likely to get an error like:
java.lang.ClassNotFoundException: java_path.to.YourComponent
To solve this problem declare components in a
:require
instead of:import
. (Examples: muhuk/clecs-examples@a965ab1 & muhuk/clecs-examples@22de34f) -
Added suport for systems as maps. Assuming
sys-fn
is an old style system you can write a system as:{:process sys-fn}
-
Replaced function based queries with data driven queries. See
clecs.query
.
6. Previous Versions
8. License
Copyright © 2015 Atamert Ölçgen
This program is distributed under GNU GPL v3 license. See LICENSE
file.