-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4383251
commit 35dc426
Showing
25 changed files
with
201 additions
and
202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//! # Database Data Models Module | ||
//! | ||
//! Provides definitions for types used in database interfaces. | ||
|
||
use bitvec::order::Msb0; | ||
use bitvec::slice::BitSlice; | ||
|
||
/// A generic number used to differentiate between objects. | ||
pub type SequenceKey = u64; | ||
|
||
/// The type of a raw sequence of bits encoding a database value associated | ||
/// with a key, backed by a [`BitSlice`] with [`u8`] big-endian storage. | ||
pub type Value = BitSlice<u8, Msb0>; | ||
|
||
/// The type of a database key per an implementation of [`KVStore`]. | ||
pub type Key = BitSlice<u8, Msb0>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
//! # Game Data Models Module | ||
//! | ||
//! Provides definitions for types used in game interfaces. | ||
|
||
use bitvec::{array::BitArray, order::Msb0}; | ||
use clap::ValueEnum; | ||
|
||
/// The default number of bytes used to encode states. | ||
pub const DEFAULT_STATE_BYTES: usize = 8; | ||
|
||
/// Unique identifier of a particular state in a game. | ||
pub type State<const B: usize = DEFAULT_STATE_BYTES> = BitArray<[u8; B], Msb0>; | ||
|
||
/// String encoding some specific game's variant. | ||
pub type Variant = String; | ||
|
||
/// Unique identifier for a player in a game. | ||
pub type Player = usize; | ||
|
||
/// Unique identifier of a subset of states of a game. | ||
pub type Partition = u64; | ||
|
||
/// Count of the number of states in a game. | ||
pub type StateCount = u64; | ||
|
||
/// Count of the number of players in a game. | ||
pub type PlayerCount = Player; | ||
|
||
// Specifies the game offerings available through all interfaces. | ||
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum)] | ||
pub enum GameModule { | ||
ZeroBy, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.