imperial_assault_dice 0.1.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 48

A library for simulating rolling dice in FFG's Imperial Assault.

Usage #

A simple usage example:

import 'package:imperial_assault_dice/imperial_assault_dice.dart';

main() {
  var calculator = new DiceCalculator([new RedDie(), new YellowDie()], [new BlackDie()]);

  var result = calculator.Simulate(30);
  print(result);
  
  var redDie = new RedDie();
  print(redDie.roll());
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

1.0.1 #

Make die and die face public as abstract classes

1.0.0 #

  • Initial version

example/imperial_assault_dice_example.dart

import 'package:imperial_assault_dice/imperial_assault_dice.dart';

main() {
  var dice = [new RedDie(), new YellowDie(), new GreenDie()];
  var defensiveDice = [new WhiteDie()];

  var calculator = new DiceCalculator(dice, defensiveDice);

  var result = calculator.Simulate(100000);
  print(result);
}

Use this package as a library

1. Depend on it

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


dependencies:
  imperial_assault_dice: ^0.1.1

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:imperial_assault_dice/imperial_assault_dice.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
92
Overall:
Weighted score of the above. [more]
48
Learn more about scoring.

We analyzed this package on Nov 8, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.0
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:imperial_assault_dice/imperial_assault_dice.dart.

Health issues and suggestions

Document public APIs. (-0.51 points)

59 out of 60 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

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

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

line 76 col 34: Use isNotEmpty instead of length

Format lib/imperial_assault_dice.dart.

Run dartfmt to format lib/imperial_assault_dice.dart.

Format lib/src/defensive_die.dart.

Run dartfmt to format lib/src/defensive_die.dart.

Fix additional 12 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/src/defensive_die_face.dart (Run dartfmt to format lib/src/defensive_die_face.dart.)
  • lib/src/dice/black_die.dart (Run dartfmt to format lib/src/dice/black_die.dart.)
  • lib/src/dice/blue_die.dart (Run dartfmt to format lib/src/dice/blue_die.dart.)
  • lib/src/dice/green_die.dart (Run dartfmt to format lib/src/dice/green_die.dart.)
  • lib/src/dice/red_die.dart (Run dartfmt to format lib/src/dice/red_die.dart.)
  • lib/src/dice/white_die.dart (Run dartfmt to format lib/src/dice/white_die.dart.)
  • lib/src/dice/yellow_die.dart (Run dartfmt to format lib/src/dice/yellow_die.dart.)
  • lib/src/die.dart (Run dartfmt to format lib/src/die.dart.)
  • lib/src/die_face.dart (Run dartfmt to format lib/src/die_face.dart.)
  • lib/src/offensive_die.dart (Run dartfmt to format lib/src/offensive_die.dart.)
  • lib/src/offensive_die_face.dart (Run dartfmt to format lib/src/offensive_die_face.dart.)
  • lib/src/simulation_result.dart (Run dartfmt to format lib/src/simulation_result.dart.)

Maintenance suggestions

Package is getting outdated. (-8.22 points)

The package was last published 56 weeks ago.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
Dev dependencies
matcher ^0.12.3
test ^1.3.0