Skip to content

Commit

Permalink
Add Arbitrary implementations to inventory types.
Browse files Browse the repository at this point in the history
  • Loading branch information
kpreid committed Mar 9, 2024
1 parent 51e990a commit 354d39c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions all-is-cubes/src/inv/inventory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use crate::universe::{Handle, HandleVisitor, UniverseTransaction, VisitHandles};
///
#[doc = include_str!("../save/serde-warning.md")]
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive]
pub struct Inventory {
/// TODO: This probably shouldn't be public forever.
Expand Down Expand Up @@ -139,6 +140,7 @@ impl VisitHandles for Inventory {

/// The direct child of [`Inventory`]; a container for any number of identical [`Tool`]s.
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive]
pub enum Slot {
/// Slot contains nothing.
Expand Down Expand Up @@ -281,6 +283,7 @@ impl VisitHandles for Slot {
/// stack size and specific deviations from it.
#[non_exhaustive]
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
pub(crate) enum StackLimit {
One,
Standard,
Expand Down
1 change: 1 addition & 0 deletions all-is-cubes/src/inv/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use crate::universe::{
///
#[doc = include_str!("../save/serde-warning.md")]
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive]
pub enum Tool {
/// “Click”, or “push button”, or generally “activate the function of this”
Expand Down

0 comments on commit 354d39c

Please sign in to comment.