<!DOCTYPE html>
<html lang="fr">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Zelda : Hero's Duel</title>
    <link rel="stylesheet" href="style.css">
    <link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Kulim+Park:ital,wght@0,200;0,300;0,400;0,600;0,700;1,200;1,300;1,400;1,600;1,700&family=Modern+Antiqua&display=swap" rel="stylesheet">
</head>
<body>

<?php


function chargerClasse($classe)
{
require $classe . '.php';
}

spl_autoload_register('chargerClasse');

$db= new PDO('mysql:host=localhost;dbname=grandval_poo_combat;port=8889;charset=utf8', 'grandval_admin', 'Kt2mVRZMwdx6fEb');
$MonManager = new PersonnageManager($db);



if (isset($_GET['action'])){
    switch ($_GET['action']){
    
        case 'add':
            require 'vue_add.php';
            break;
    
        case 'add-perso':
            $MonManager->addPerso(new Personnage($_POST));
            require 'vue_list.php';
            break;
    
        case 'list':
            require 'vue_list.php';
            break;
        
        case 'play':
            require 'vue_play.php';
            break;

        case 'play2':
            require 'vue_play2.php';
            break;

        case 'combat':
            require 'vue_combat.php';
            break;
    }

}
else{
    require 'vue_accueil.php';
}


?>


<script src='script.js'></script>
</body>
</html>

