mahjong_score 0.0.5 copy "mahjong_score: ^0.0.5" to clipboard
mahjong_score: ^0.0.5 copied to clipboard

It is a package that calculates the score of Mahjong.

mahjong_score #

It is a package that calculates the score of Mahjong. Scores are calculated based on "hu" and "fan". It should be noted that this package does not distribute points to each player, so you need to implement it yourself.

Usage #

BasePoint class #

‘BasePoint’ is a class that handles the base points of points calculated by ‘hu’ and ‘fan’.

import 'package:mahjong_score/score.dart';

final basePoint = BasePoint(hu: 30, fan: 4);
Argument description
hu 符点数 int
fan 翻点数 int

FixedPoint class #

‘FixedPoint’ deals with base points such as ‘Mangan’ and ‘Yakuman’ that do not calculate ‘hu’ and ‘fan’. You can get an instance from the FixedPointType defined in the Enum.

import 'package:mahjong_score/score.dart';

final fixed = FixedPointType.value;
final mangan = FixedPointType.Mangan.detail;

Score class #

The ‘Score’ class is from the calculated base point We will handle the points to be finally handed over in consideration of the way the game ended.

import 'package:mahjong_score/score.dart';

final score = Score(
  abstractPoint: basePoint,
  isHost: false,
  isPicked: false,
  consecutivelyConut: 0,
);
Argument description
abstractPoint Class that inherits abstractPoint
isHost Whether the winner is a parent
isPicked The winner end with'Tsumo'
consecutivelyCount Number of consecutive Hosts
0
likes
150
pub points
0%
popularity

Publisher

unverified uploader

It is a package that calculates the score of Mahjong.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-2-Clause (license)

Dependencies

flutter

More

Packages that depend on mahjong_score