Last updated:
0 purchases
mahjong score
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);
copied to clipboard
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;
copied to clipboard
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,
);
copied to clipboard
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
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.