piecemeal 0.4.2

  • Readme
  • Changelog
  • Installing
  • 77

Piecemeal is a small Dart library of low-level utility types aimed at 2D games. In particular, I harvested it from my roguelike Hauberk.

Using it #

Add it to your package's pubspec:

  piecemeal: any

Import it:

import 'package:piecemeal/piecemeal.dart';

Running tests #

Piecemeal comes with a unit test suite. From the root directory of piecemeal, run:

dart --checked test/run_all.dart 

0.4.2 #

  • Better hashCode on Vec with fewer collisions.

0.4.1 #

  • Add Vec.nearestDirection.
  • Add Vec.intercardinalNeighbors.

0.4.0 #

  • Rng.take() no longer preserves order, but is faster. To preserve order, use Rng.takeOrdered().
  • Add Rng.round().
  • Add Vec.neighbors and Vec.cardinalNeighbors.

0.3.8 #

  • Add Rng.countFromFloat() and Rng.normal().

0.3.6 #

  • Add Array2D.fill().

0.3.5 #

  • Add Rng.shuffle() and Rng.setSeed().

0.3.4 #

  • Add Line and Circle classes.

0.3.3 #

  • Add Rng.percent().

0.3.2 #

  • Add Rect.offset().

0.3.1 #

  • Fix type error.
  • Use real generic method syntax.

0.3.0 #

  • Get rid of implicit casts and dynamic.
  • Make Rng.item() and Rng.take() generic methods.
  • Add Rng.float().

0.2.1 #

  • Make strong mode clean.
  • Fix bug in Rect.clamp().

0.2.0 #

  • Make constants lowerCamelCase.
  • Remove sign() and clamp() since the Dart core libraries have them now.

0.1.1 #

  • Add CARDINAL and INTERCARDINAL direction lists to Direction.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  piecemeal: ^0.4.2

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:piecemeal/piecemeal.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Apr 4, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6

Health suggestions

Fix lib/src/array2d.dart. (-1.49 points)

Analysis of lib/src/array2d.dart reported 3 hints:

line 83 col 31: DO use curly braces for all flow control structures.

line 85 col 31: DO use curly braces for all flow control structures.

line 87 col 31: DO use curly braces for all flow control structures.

Fix lib/src/rng.dart. (-0.50 points)

Analysis of lib/src/rng.dart reported 1 hint:

line 207 col 38: DO use curly braces for all flow control structures.

Maintenance suggestions

Package is getting outdated. (-17.81 points)

The package was last published 61 weeks ago.

The package description is too short. (-16 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and piecemeal.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.62.0 <3.0.0
Dev dependencies
test any