PHP code example of prokki / warlight2-bot-template

1. Go to this page and download the library: Download prokki/warlight2-bot-template library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

prokki / warlight2-bot-template example snippets



use Prokki\TheaigamesBotEngine\Bot;

class AIBot implements Bot, AI
{
    /**
     * Returns the pick move of the region to pick.
     *
     * These moves are going to build the response to the request `pick_starting_region` - see {@see \Prokki\Warlight2BotTemplate\Command\PickStartingRegionCommand}.
     *
     * @param integer[] $region_ids
     *
     * @return PickMove|null
     */
    public function getPickMove($region_ids)
    {
        // put your code here
    }

    /**
     * Returns all place moves.
     *
     * These moves are going to build the response to the request `go place_armies` - see {@see \Prokki\Warlight2BotTemplate\Command\GoPlaceArmiesCommand}.
     *
     * @return PlaceMove[]
     */
    public function getPlaceMoves();
    {
        // put your code here
    }

    /**
     * Returns all attack and transfer moves.
     *
     * These moves are going to build the response to the request `go attack/transfer` - see {@see \Prokki\Warlight2BotTemplate\Command\GoAttackTransferCommand}.
     *
     * @return TransferMove[]|AttackMove[]
     */
    public function getAttackTransferMoves();
    {
        // put your code here
    }
}