Giter Site home page Giter Site logo

hartl3y94 / flutter_mahjong_score Goto Github PK

View Code? Open in Web Editor NEW

This project forked from northfieldzz/flutter_mahjong_score

0.0 0.0 0.0 26 KB

flutter packages for mahjong

Home Page: https://pub.dev/packages/mahjong_score

License: BSD 2-Clause "Simplified" License

Dart 100.00%

flutter_mahjong_score's Introduction

mahjong_score

FOSSA Status

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

License

FOSSA Status

flutter_mahjong_score's People

Contributors

fossabot avatar northfieldzz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.