(component name params)
Create a component definition.
cname : A keyword to be used to refer to this component later.
cdef : A map of component parameter names to their types.
;; A marker component.
(component Renderable nil)
;; Components can have any number of parameters.
(component HitPoints {hp Integer})
(component Point {x Int y Integer})
(component Player {name String
team Integer
alive Boolean})
See also clecs.world/world
.
Create a component definition. #### Parameters: cname : A keyword to be used to refer to this component later. cdef : A map of component parameter names to their types. #### Examples: ;; A marker component. (component Renderable nil) ;; Components can have any number of parameters. (component HitPoints {hp Integer}) (component Point {x Int y Integer}) (component Player {name String team Integer alive Boolean}) See also [[clecs.world/world]].
(validate c cdata)
Validate component data against a component definition.
Throws RuntimeException
if validation fails.
c : Component definition to validate against.
cdata : A map containing component data.
Validate component data against a component definition. Throws `RuntimeException` if validation fails. #### Parameters: c : Component definition to validate against. cdata : A map containing component data.
Validates a parameter.
parameter-type : Parameter type to validate against.
parameter-value : Parameter value to validate.
Validates a parameter. #### Parameters: parameter-type : Parameter type to validate against. parameter-value : Parameter value to validate.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close