Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Kapsyloffer/shobu.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kapsyloffer committed Feb 18, 2024
2 parents 7261e6a + 3de6821 commit 18f1db5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
6 changes: 1 addition & 5 deletions src/rules/game_tile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ pub enum Tile {
}

impl Tile {
pub fn is_empty(t: Tile) -> bool {
return t == Tile::Empty;
}

pub fn get_possible_moves(b: &Board, aggr: bool, cur_pos: (i8, i8)) -> Vec<(i8, i8)> {
let boardstate = b.get_state();
let mut movelist: Vec<(i8, i8)> = Vec::new();
Expand Down Expand Up @@ -159,7 +155,7 @@ impl Tile {

let cur_tile = b.to_owned().get_state()[cur_pos.0 as usize][cur_pos.1 as usize];

if Tile::is_empty(cur_tile) {
if cur_tile == Tile::Empty {
eprintln!("\nwtf are you doing? That's not a rock!\n");
}

Expand Down
7 changes: 0 additions & 7 deletions src/rules/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -943,13 +943,6 @@ fn add_player_disallow_joins(){
assert!(!g.add_player(String::from("b"), Some(Tile::White)));
}

#[test]
fn is_empty_test() {
assert!(Tile::is_empty(Tile::Empty));
assert!(!Tile::is_empty(Tile::White));
assert!(!Tile::is_empty(Tile::Black));
}

#[test]
fn diagonal_push_1(){
let state: [[Tile; 4]; 4] = [
Expand Down

0 comments on commit 18f1db5

Please sign in to comment.