Compare commits

..

No commits in common. "e7f424aadc4675752230b0013e5dd149c40d6d05" and "ce2e7c252ad298d9c9d44828f253daa9c59593a4" have entirely different histories.

4 changed files with 4 additions and 33 deletions

2
Cargo.lock generated
View file

@ -250,7 +250,7 @@ checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
[[package]]
name = "marble-machinations"
version = "0.2.1"
version = "0.2.0"
dependencies = [
"raylib",
"serde",

View file

@ -1,6 +1,6 @@
[package]
name = "marble-machinations"
version = "0.2.1"
version = "0.2.0"
edition = "2021"
[dependencies]

View file

@ -1,26 +0,0 @@
use std::collections::HashMap;
use raylib::ffi::KeyboardKey;
use serde::{Deserialize, Serialize};
#[derive(Debug, Default, Deserialize, Serialize)]
pub struct Config {
hotkeys: Hotkeys,
}
#[derive(Debug, Default, Deserialize, Serialize)]
pub struct Hotkeys {
map: HashMap<String, Hotkey>,
}
#[derive(Debug, Deserialize, Serialize)]
pub struct Hotkey {
modifiers: Vec<u32>,
trigger: Trigger,
}
#[derive(Debug, Deserialize, Serialize)]
pub enum Trigger {
Mouse(u32),
Key(u32),
}

View file

@ -255,17 +255,13 @@ impl Machine {
}
// #### new marbles ####
let mut claim_positions = Vec::new();
// prepare creating the new marbles
for &(pos, _val, _dir) in &new_marbles {
let Some(Tile::Open(OpenTile::Blank, claim)) = self.board.get_mut(pos) else {
unreachable!()
};
*claim = match claim {
Claim::Free => {
claim_positions.push(pos);
Claim::Claimed
}
Claim::Free => Claim::Claimed,
Claim::Claimed | Claim::Blocked => Claim::Blocked,
_ => unreachable!(),
}
@ -281,6 +277,7 @@ impl Machine {
}
// #### movement ####
let mut claim_positions = Vec::new();
// mark claims to figure out what spaces can be moved to
for &pos in &self.marbles[..old_marbles] {
let Some(Tile::Marble { value: _, dir }) = self.board.get(pos) else {