http: make_move demo
This commit is contained in:
@@ -216,7 +216,7 @@ impl GameState {
|
||||
/// After scoring, either ends the game and calculates bonus
|
||||
/// or fills the factories again and sets the starting player
|
||||
/// Also tracks rounds and days
|
||||
fn do_iter(&mut self, game_move: GameMove) -> Result<(), MoveErr> {
|
||||
pub fn do_iter(&mut self, game_move: GameMove) -> Result<(), MoveErr> {
|
||||
if self.game_end {
|
||||
return Err(MoveErr::Other("Game is over"));
|
||||
}
|
||||
@@ -377,7 +377,7 @@ impl GameState {
|
||||
}
|
||||
}
|
||||
|
||||
enum MoveErr {
|
||||
pub enum MoveErr {
|
||||
Player(&'static str),
|
||||
Color(&'static str),
|
||||
Src(&'static str),
|
||||
@@ -793,7 +793,7 @@ type Row = [bool; 5];
|
||||
type Wall = [Row; 5];
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone, Copy)]
|
||||
struct GameMove {
|
||||
pub struct GameMove {
|
||||
player: usize, // Safeguard to check that the bot knows which player it is
|
||||
policy: Policy, // What policy to run moves under, so bots can do less error-handling
|
||||
color: Color, // What color to select
|
||||
|
Reference in New Issue
Block a user