All Projects → umutseven92 → Goban

umutseven92 / Goban

Licence: MIT license
Adaptive Go board for flutter. Fully customisable & easy to interface with your game logic.

Programming Languages

dart
5743 projects

Projects that are alternatives of or similar to Goban

agagd
American Go Association Games Database (AGAGD)
Stars: ✭ 44 (+46.67%)
Mutual labels:  baduk
pyDLGO
基於深度學習的 GTP 圍棋(围棋)引擎,KGS 指引文件以及演算法教學。
Stars: ✭ 33 (+10%)
Mutual labels:  baduk
lizgoban
Leela Zero & KataGo visualizer
Stars: ✭ 131 (+336.67%)
Mutual labels:  baduk
immutable-gametree
An immutable game tree data type.
Stars: ✭ 18 (-40%)
Mutual labels:  baduk
besogo
Embeddable SGF editor/viewer for the game of Go (aka Weiqi, Baduk)
Stars: ✭ 82 (+173.33%)
Mutual labels:  baduk
Sabaki
An elegant Go board and SGF editor for a more civilized age.
Stars: ✭ 1,768 (+5793.33%)
Mutual labels:  baduk
sgf to gif
SGF file --> GIF
Stars: ✭ 32 (+6.67%)
Mutual labels:  baduk
GoAIRatings
Estimate Go AI ratings by real games
Stars: ✭ 118 (+293.33%)
Mutual labels:  baduk
sgf4j
Simple SGF Parser for Java
Stars: ✭ 27 (-10%)
Mutual labels:  baduk

Goban

Pub

Goban

Customizable Go board widget for Flutter.

Usage

Initialize a GobanController like so:

gobanController = GobanController(boardSize: BoardSize.Thirteen);

Then subscribe to the move stream:

gobanController.gobanStream.stream.listen((Position position) {
    // A move at 'position' was played
    // Decide what to do here
});

Whenever an intersection is clicked, the above method will fire.

Goban does not have any game logic; this is by design. Goban make no assumptions on what you want to do, so that it can be used for all purposes. Maybe you want to use it for Tsumego purposes, or maybe you want to use it for online multiplayer. Both of these required different logic, therefore Goban delegates all game logic responsibilities to the client.

For example, a simple local board would be:

player = Player.Black;

gobanController.gobanStream.stream.listen((Position position) {
    // A move at 'position; has been made.
    var clickedPlayer = gobanController.getPlayerFromPosition(pos); // Get the intersection at 'position'
    if (clickedPlayer == Player.Empty) { // If the intersection is empty;
        var move = Move(player, pos); // Create move

        gobanController.addMove(move); // Make the move on the goban.

        setState(() {
            player = player == Player.Black ? Player.White : Player.Black; // Other players' turn
        });
    }
});

Please see here for a more concrete example.

Customization Options

The board and the stones are fully customizable:

gobanController = GobanController(
    boardSize: BoardSize.Nine,
    gobanTheme: GobanTheme(
        stoneThemes: StoneThemes(
            blackStoneTheme: BlackStoneTheme(
                stoneColor: Colors.black45, borderColor: Colors.black),
            whiteStoneTheme: WhiteStoneTheme(
                borderColor: Colors.white, stoneColor: Colors.tealAccent)),
        boardTheme: BoardTheme(
            boardColor: Colors.yellow,
            lineColor: Colors.red,
            lineWidth: 3)));

Aside from the default theme, there are also two preset themes available:

Book Theme

Book Theme

gobanController = GobanController(
    boardSize: boardSize, gobanTheme: GobanTheme.bookTheme());

Jade Theme

Jade Theme

gobanController = GobanController(
    boardSize: boardSize, gobanTheme: GobanTheme.jadeTheme());

Todo

  • Stone shadow when while pressing down
  • Ability to show just one corner (like SmartGo on iOS)
  • Coordinates
  • SGF support
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].