View Source mix ecsx.gen.component (ECSx v0.4.0)

Generates a new Component type for an ECSx application.

$ mix ecsx.gen.component Height integer

The first argument is the name of the component, followed by the data type of the value.

Valid types for the component's value are:

  • atom
  • binary
  • datetime
  • float
  • integer

By default, new component types are generated with unique: true, which allows an entity to have at most one component of this type at any given time. To override this, use the --no-unique flag:

$ mix ecsx.gen.component Friendship binary --no-unique