Skip to content

A builder for dartemis to reduce boilerplate code when creating systems

License

Notifications You must be signed in to change notification settings

denniskaselow/dartemis_builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dartemis_builder

Build Status Coverage Status Pub

A builder for dartemis to create the code necessary to initialize Managers, Mappers and EntitySystems.

Usage

Add dartemis_builder as a dev_dependency:

dart pub add --dev dartemis_builder

Add the part statement to your library and the @Generate annotation on a Manager or EntitySystem and run build_runner.

part 'filename.g.dart';

@Generate(
  EntityProcessingSystem,
  allOf: [
    Position,
    Velocity,
  ],
)
class SimpleMovementSystem extends _$SimpleMovementSystem {
  @override
  void processEntity(int entity, Position position, Velocity velocity) {    
    position
      ..x += velocity.x * world.delta
      ..y += velocity.y * world.delta;
  }
}

A live template for systems and managers in WebStorm can be useful, for example:

@Generate($BASE_SYSTEM$)
class $CLASS_NAME$System extends _$$$CLASS_NAME$System {
}

And for the part-part:

part '$filename$.g.dart';

Features and bugs

Please file feature requests and bugs at the issue tracker.

About

A builder for dartemis to reduce boilerplate code when creating systems

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages