imperial_assault_dice 0.1.1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new61

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 packages get

Alternatively, your editor might support pub get or flutter packages 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';
  
Version Uploaded Documentation Archive
0.1.1 Oct 8, 2018 Go to the documentation of imperial_assault_dice 0.1.1 Download imperial_assault_dice 0.1.1 archive
0.1.0 Oct 8, 2018 Go to the documentation of imperial_assault_dice 0.1.0 Download imperial_assault_dice 0.1.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
22
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
61
Learn more about scoring.

We analyzed this package on Oct 10, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.4

Platforms

Detected platforms: Flutter, web, other

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

Health suggestions

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.

Format lib/src/defensive_die_face.dart.

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

Fix additional 12 files with analysis or formatting issues.

Additional issues in the following files:

  • 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/dice_calculator.dart (Run dartfmt to format lib/src/dice_calculator.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.)

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