<?php
include 'functions.php';
include 'mparser.php';
session_start();
$gameHandler = $_SESSION['GameHandler'];
$_SESSION["timer"][1] = microtime(true);
UpdateGameplan();
$_SESSION["timer"][2] = microtime(true);
GenerateNextPossibleActions($gameHandler->last_object);
$_SESSION["timer"][3] = microtime(true);
GetMoves();
MainOutputParser();
$gameHandler = $_SESSION['GameHandler'];
if ($gameHandler->issetFlag()) {
    endScript("engine.php");
}
//ActionChoice();
$_SESSION["print"] = TRUE;
MainPagePrint();
$_SESSION["timer"][4] = microtime(true);
dumpTime();
/*echo "Updating game plan took:" . ($time2 - $time1) . " seconds <br/>";
echo "Generating next turn took:" . ($time3 - $time2) . " seconds <br/>";
echo "Outparsing next moves took:" . ($time4 - $time3) . " seconds <br/>";
echo "Processing output took:" . ($time5 - $time4) . " seconds <br/>";
echo "Pageprinting game took:" . ($time6 - $time5) . " seconds <br/>";
echo "Cumulative time:" . ($time6 - $time1) . " seconds <br/>";
echo "Full time:" . ($time6 - $_SESSION['timeflag']) . " seconds <br/>";
if ($_SESSION['way'] === 2) {
    echo "MTG engine processed";
} else {
    echo "MTG server processed";
}*/
?>
