Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of monster-chess #8

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Cormanz
Copy link

@Cormanz Cormanz commented Mar 16, 2023

This is the initial commit of implementing monster-chess into board-game-rs. All this initial commit does is support Rust in Github codespaces so that I can more easily develop this. There's no progress yet, but I'll be implementing this on the fork and will comment once this is ready for review.

@Cormanz
Copy link
Author

Cormanz commented Mar 16, 2023

board-game-rs's Board implements the following traits: Debug + Display + Clone + Eq + Hash + Send + Sync + UnwindSafe + RefUnwindSafe which are not currently implemented by the monster-chess board and not as easy to implement. I'll have to update monster-chess to implement these traits before further working on the PR (which should hopefully be done soon.)

@KarelPeeters
Copy link
Owner

KarelPeeters commented Mar 16, 2023

I'm also considering just removing some of the bounds from Board;

  • Debug and Display are very useful for debugging, so I'm probably keeping those
  • Clone is used a lot everywhere, so keeping that
  • Eq is used in many of the unit tests, but it probably doesn't need to be a bound on Board.
  • Hash can be moved to functions that use caches
  • Send and Sync can be moved to the functions that actually do concurrency
  • UnwindSafe and RefUnwindSafe should really be removed, I only really use them in unit tests to check that some board functions panic correctly. I should probably use Result a bit more instead, but that can be a bit annoying to use. (eg. for play and available_moves).

@Cormanz
Copy link
Author

Cormanz commented Mar 16, 2023

I'll still make sure to implement Debug + Display + Clone + Eq + Hash + Send + Sync anyways, as it seems like good practice and would perhaps make consumers' lives (like board-game-rs's) easier.

@KarelPeeters
Copy link
Owner

I've already removed UnwindSafe + RefUnwindSafe (and replaced a bunch of panics with Result), it was not as annoying as I thought.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants