fledge_ecs_generator 0.2.3 copy "fledge_ecs_generator: ^0.2.3" to clipboard
fledge_ecs_generator: ^0.2.3 copied to clipboard

Code generator for the Fledge ECS framework. Generates component registration and system wrappers.

fledge_ecs_generator #

Code generator for the Fledge ECS framework. Generates component registration and system wrappers from annotations.

pub package

Installation #

dev_dependencies:
  fledge_ecs_generator: ^0.2.1
  build_runner: ^2.4.0

dependencies:
  fledge_ecs: ^0.2.1
  fledge_ecs_annotations: ^0.2.1

Quick Start #

import 'package:fledge_ecs_annotations/fledge_ecs_annotations.dart';

@component
class Position {
  double x;
  double y;
  Position(this.x, this.y);
}

@system
void moveEntities(Query<(Position, Velocity)> query, Res<WallTime> time) {
  for (final (pos, vel) in query.iter()) {
    pos.x += vel.x * time.value.delta;
    pos.y += vel.y * time.value.delta;
  }
}

Run the generator:

dart run build_runner build

Then import the generated code:

import 'my_game.g.dart';

void main() {
  final app = App()..addPlugin(GeneratedPlugin());
}

Documentation #

See the Fledge documentation site for guides, API reference, and advanced usage.

License #

Apache 2.0 - See LICENSE for details.

0
likes
160
points
251
downloads

Documentation

API reference

Publisher

verified publisherfledge-framework.dev

Weekly Downloads

Code generator for the Fledge ECS framework. Generates component registration and system wrappers.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#ecs #code-generation #build-runner #game-development

License

Apache-2.0 (license)

Dependencies

analyzer, build, fledge_ecs_annotations, source_gen

More

Packages that depend on fledge_ecs_generator