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'squeryimplementation. It doesn’t allow unknown (unreadable by currently running system) components to be queries anymore.
-
ITransactableWorldand 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/worldto create a new world.-
clecs.backend.atom-world/make-worldis removed. Useclecs.world/worldwithclecs.world.backend.atom-world/atom-world-factoryinstead:(world atom-world-factory {:components [(component ...) (component ...) (component ...) ...] :initializer (fn [w] ...) :systems [(system ...) (system ...) ...]}) -
ISystemManageris renamed asIWorld.Following functions are removed from this protocol:
-
remove-system! -
set-system! -
systems
-
-
-
world/set-componentaccepts 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-componentvalidates 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-worldis 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
IComponentis 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.YourComponentTo solve this problem declare components in a
:requireinstead of:import. (Examples: muhuk/clecs-examples@a965ab1 & muhuk/clecs-examples@22de34f) -
Added suport for systems as maps. Assuming
sys-fnis 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.