// Path: src/main/java/pl/joegreen/sergeants/framework/Actions.java
// public interface Actions {
// 
//     void move(int indexFrom, int indexTo);
// 
//     /**
//      * Direct move between fields. Works only if both fields are neighbours (either horizontally or vertically, not diagonally) - otherwise does nothing and logs error.
//      */
//     void move(Field fieldFrom, Field fieldTo);
// 
//     void move(int indexFrom, int indexTo, boolean moveHalf);
// 
//     /**
//      * Direct move between fields. Works only if both fields are neighbours (either horizontally or vertically, not diagonally) - otherwise does nothing and logs error.
//      * @param moveHalf if true, only half of the army will be moved (equal to double click in browser)
//      */
//     void move(Field fieldFrom, Field fieldTo, boolean moveHalf);
// 
//     void sendChat(String message);
// 
//     void sendTeamChat(String message);
// 
//     void leaveGame();
// 
//     void ping(int index);
// 
//     void ping(Field field);
// 
//     /**
//      * Remove all moves from the move queue.
//      */
//     void clearMoves();
// 
//     /**
//      * Get lower level API that potentially can make it possible to do something that is not possible by this interface.
//      * Use with caution, as using it can potentially make the framework work unexpectedly.
//      */
//     GeneralsApi getBareApi();
// }
// 
// Path: src/main/java/pl/joegreen/sergeants/simulator/SimulatorConfiguration.java
// public static SimulatorConfiguration configuration() {
//     return new SimulatorConfiguration();
// }


import org.junit.Assert;
import org.junit.Test;
import pl.joegreen.sergeants.framework.Actions;
import pl.joegreen.sergeants.framework.model.*;
import java.util.Optional;
import static org.junit.Assert.assertEquals;
import static pl.joegreen.sergeants.simulator.SimulatorConfiguration.configuration;
    private void checkAttackGameBotStateTurn24(GameState gameState) {
        assertEquals(24, gameState.getTurn());
        VisibleField enemyGeneral = gameState.getTwoDimensionalArrayOfFields()[0][0].asVisibleField();
        VisibleField city = gameState.getTwoDimensionalArrayOfFields()[0][1].asVisibleField();
        VisibleField mountain = gameState.getTwoDimensionalArrayOfFields()[0][2].asVisibleField();
        Assert.assertTrue(enemyGeneral.isGeneral());
        Assert.assertTrue(city.isCity());
        assertEquals(FieldTerrainType.MOUNTAIN, mountain.getTerrainType());
    }

    private void checkFinalGameState(Tile[] tiles) {
        assertEquals(CityTile.class, tiles[0].getClass());
        assertEquals(8, tiles[0].getArmySize());
        assertEquals(Optional.of(1), tiles[0].getOwnerPlayerIndex());

        assertEquals(CityTile.class, tiles[1].getClass());
        assertEquals(2, tiles[1].getArmySize());
        assertEquals(Optional.of(1), tiles[1].getOwnerPlayerIndex());

        assertEquals(EmptyTile.class, tiles[3].getClass());
        assertEquals(12, tiles[3].getArmySize());
        assertEquals(Optional.of(1), tiles[3].getOwnerPlayerIndex());

        assertEquals(GeneralTile.class, tiles[8].getClass());
        assertEquals(3, tiles[8].getArmySize());
        assertEquals(Optional.of(1), tiles[8].getOwnerPlayerIndex());
    }


    private class AttackGeneralBot extends TestBot {
// Path: src/main/java/pl/joegreen/sergeants/framework/Actions.java
// public interface Actions {
// 
//     void move(int indexFrom, int indexTo);
// 
//     /**
//      * Direct move between fields. Works only if both fields are neighbours (either horizontally or vertically, not diagonally) - otherwise does nothing and logs error.
//      */
//     void move(Field fieldFrom, Field fieldTo);
// 
//     void move(int indexFrom, int indexTo, boolean moveHalf);
// 
//     /**
//      * Direct move between fields. Works only if both fields are neighbours (either horizontally or vertically, not diagonally) - otherwise does nothing and logs error.
//      * @param moveHalf if true, only half of the army will be moved (equal to double click in browser)
//      */
//     void move(Field fieldFrom, Field fieldTo, boolean moveHalf);
// 
//     void sendChat(String message);
// 
//     void sendTeamChat(String message);
// 
//     void leaveGame();
// 
//     void ping(int index);
// 
//     void ping(Field field);
// 
//     /**
//      * Remove all moves from the move queue.
//      */
//     void clearMoves();
// 
//     /**
//      * Get lower level API that potentially can make it possible to do something that is not possible by this interface.
//      * Use with caution, as using it can potentially make the framework work unexpectedly.
//      */
//     GeneralsApi getBareApi();
// }
// 
// Path: src/main/java/pl/joegreen/sergeants/simulator/SimulatorConfiguration.java
// public static SimulatorConfiguration configuration() {
//     return new SimulatorConfiguration();
// }


// Path: src/test/java/pl/joegreen/sergeants/simulator/SimulatorFullGameTest.java
import org.junit.Assert;
import org.junit.Test;
import pl.joegreen.sergeants.framework.Actions;
import pl.joegreen.sergeants.framework.model.*;
import java.util.Optional;
import static org.junit.Assert.assertEquals;
import static pl.joegreen.sergeants.simulator.SimulatorConfiguration.configuration;

    private void checkAttackGameBotStateTurn24(GameState gameState) {
        assertEquals(24, gameState.getTurn());
        VisibleField enemyGeneral = gameState.getTwoDimensionalArrayOfFields()[0][0].asVisibleField();
        VisibleField city = gameState.getTwoDimensionalArrayOfFields()[0][1].asVisibleField();
        VisibleField mountain = gameState.getTwoDimensionalArrayOfFields()[0][2].asVisibleField();
        Assert.assertTrue(enemyGeneral.isGeneral());
        Assert.assertTrue(city.isCity());
        assertEquals(FieldTerrainType.MOUNTAIN, mountain.getTerrainType());
    }

    private void checkFinalGameState(Tile[] tiles) {
        assertEquals(CityTile.class, tiles[0].getClass());
        assertEquals(8, tiles[0].getArmySize());
        assertEquals(Optional.of(1), tiles[0].getOwnerPlayerIndex());

        assertEquals(CityTile.class, tiles[1].getClass());
        assertEquals(2, tiles[1].getArmySize());
        assertEquals(Optional.of(1), tiles[1].getOwnerPlayerIndex());

        assertEquals(EmptyTile.class, tiles[3].getClass());
        assertEquals(12, tiles[3].getArmySize());
        assertEquals(Optional.of(1), tiles[3].getOwnerPlayerIndex());

        assertEquals(GeneralTile.class, tiles[8].getClass());
        assertEquals(3, tiles[8].getArmySize());
        assertEquals(Optional.of(1), tiles[8].getOwnerPlayerIndex());
    }


    private class AttackGeneralBot extends TestBot {
        private final Actions actions;