2 releases

0.1.1 Jun 15, 2022
0.1.0 Jun 9, 2022

#40 in #board-game

24 downloads per month
Used in gamenite-gui

GPL-3.0-or-later

1.5MB
192 lines

Contains (Zip file, 1MB) samples/dune.board, (Zip file, 515KB) samples/risk.board

gamenite


lib.rs:

A graph library for board games

When writing programs revolving around tabletop board games, often the graph is the preferred data structure for representing the game board, especially in games that are neither linear nor grid-based, i.e. Risk. This crate provides utilities for building and interacting with graph-based board states.

More specifically, we provide [Board], a [HashMap] based graph with configurable labels and options. With it we provide [Node], representing a location on the board, with connections to other Nodes. Finally, we provide an [io] package to facilitate loading and saving these boards, and a related image to a compressed file.

Dependencies

~19MB
~164K SLoC