Liking cljdoc? Tell your friends :D

clecs.component


componentcljmacro

(component name params)

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.

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]].
sourceraw docstring

validateclj

(validate c cdata)

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.

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.
sourceraw docstring

validate-paramcljmultimethod

Validates a parameter.

Parameters:

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.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close