1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
   | #include <iostream>
#include <vector>
#include <cstdlib>
#include <ctime>
#include "personnage.h"
#include "player.h"
#include "enemy.h"
 
using namespace std;
 
int main()
{
    srand(time(0));    //std::string nom = "guepe";
    player tidus("tidus");
    //enemy monstre("guepe", 50, 0, "poison", 10, 5);
    std::vector<enemy> monstre;
 
    int nbmonstre;
    while(nbmonstre == 0)
        nbmonstre  = rand() % 5;
 
    for(int i = 0; i < nbmonstre; i++)
    {
        monstre.push_back(enemy("guepe", 50, 0, "poison", 10, 5));
    }
 
    int i = 0;
    while(i != nbmonstre)
    {
        monstre[i]->afficheinfo();
        monstre[i].afficheinfo();
        monstre(enemy.afficherinfo());
        monstre[i].(enemy.afficherinfo());
        i++;
    }
 
    /*tidus.afficherinfo();
    monstre.afficherinfo();
 
    tidus.attaquer(monstre);
 
    tidus.afficherinfo();
    monstre.afficherinfo();
 
    tidus.attaquer(monstre);
 
    tidus.afficherinfo();
    monstre.afficherinfo();
    if(monstre.est_vivant() == false)
        monstre.~enemy();*/
 
    //monstre.afficherinfo();
 
 
    return 0;
} |