Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/basic_player/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use socha::{prelude::*};
use socha::prelude::*;

struct Player {
game_state: Option<GameState>,
Expand All @@ -7,7 +7,7 @@ struct Player {
impl Client for Player {
fn on_move_request(&mut self) -> Option<Move> {
println!("Received a move request!");
get_possible_moves(&self.game_state.as_mut().unwrap()).first().cloned()
gamerulelogic::get_possible_moves(&self.game_state.as_mut().unwrap()).first().cloned()
}

fn on_game_over(&mut self) {
Expand Down
2 changes: 1 addition & 1 deletion examples/random_player/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ impl Client for RandomPlayerClient {
println!("Current team: {:?}", self.game_state.as_ref().unwrap().get_current_turn_color());

let state = self.game_state.as_ref().unwrap();
let legal_moves = get_possible_moves(state);
let legal_moves = gamerulelogic::get_possible_moves(state);

if legal_moves.is_empty() {
return Some(Move {
Expand Down
6 changes: 3 additions & 3 deletions src/prelude.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
pub use crate::client::*;
pub use crate::game::board::Board;
pub use crate::game::color::Color;
pub use crate::game::constants::*;
pub use crate::game::coordinate::*;
pub use crate::game::gamerulelogic::*;
pub use crate::game::constants;
pub use crate::game::coordinate::{self, Coordinate};
pub use crate::game::gamerulelogic;
pub use crate::game::gamestate::GameState;
pub use crate::game::r#move::Move;
pub use crate::game::rotation::Rotation;
Expand Down
Loading