Partie::Partie(int t, char a, char d) { monDamier = new Damier(t); gagnee = false; if (a=='h') monAnge = new AngeHumain(this, 1); if (a=='a') monAnge = new AngeAleatoire(this, 1); Case * c = monDamier->mesCases[monDamier->taille/2][monDamier->taille/2]; c->setAnge(monAnge); monAnge->setCase(c); if (d=='h') monDiable = new DiableHumain(this); if (d=='a') monDiable = new DiableAleatoire(this); trait = monAnge; }
void Partie::initialiser() { cout << "\tAnge Humain ou Aleatoire ? (h/a)" << endl; char r; cin >> r; if (r=='h') monAnge = new AngeHumain(this, 1); if (r=='a') monAnge = new AngeAleatoire(this, 1); Case * c = monDamier->mesCases[monDamier->taille/2][monDamier->taille/2]; c->setAnge(monAnge); monAnge->setCase(c); cout << "\tDiable Humain ou Aleatoire ? (h/a)" << endl; cin >> r; if (r=='h') monDiable = new DiableHumain(this); if (r=='a') monDiable = new DiableAleatoire(this); trait = monAnge; }