forked from Mici7120/code-legends
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathejercito.cpp
More file actions
102 lines (80 loc) · 2.25 KB
/
ejercito.cpp
File metadata and controls
102 lines (80 loc) · 2.25 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#include "ejercito.h"
/*Ejercito::Ejercito(int N_Luchadores, int N_Tiradores, int N_Magos){
Avatar Luchador[N_Luchadores], Tirador[N_Tiradores], Mago[N_Magos];
for(int a =0; a!=N_Luchadores ; a++){
Luchador[a].setTipo("luchador");
Luchadores.push_back(Luchador[a]);
}
for(int b =0; b!=N_Tiradores ; b++){
Tirador[b].setTipo("tirador");
Tiradores.push_back(Tirador[b]);
}
for(int c =0; c!=N_Magos ; c++){
Mago[c].setTipo("mago");
Magos.push_back(Mago[c]);
}
cantidadLuchadores=N_Luchadores;
cantidadTiradores=N_Tiradores;
cantidadMagos=N_Magos;
}
void Ejercito::calcularEjercito(){
cantidadLuchadores=0;
cantidadTiradores=0;
cantidadMagos=0;
vector<Avatar>::iterator L,T,M;
for(L = Luchadores.begin(); L!=Luchadores.end() ; L++){
cantidadLuchadores ++;
}
for(T = Tiradores.begin(); T!=Tiradores.end() ; T++){
cantidadTiradores ++;
}
for(M = Magos.begin(); T!=Magos.end() ; M++){
cantidadMagos ++;
}
} */
Ejercito::Ejercito(){
cantidadLuchadores = 10;
cantidadTiradores = 5;
cantidadMagos = 2;
/*
cantidadLuchadores =numeroLuchadores;
cantidadTiradores=numeroTiradores;
cantidadMagos=numeroMagos;
//Cual = Cual avatar.
for(int cual = 0; cual < numeroLuchadores ; cual++){
ejercito.push_back(new Avatar("luchador"));
}
for(int cual = 0; cual < numeroTiradores ; cual++){
ejercito.push_back(new Avatar("tirador"));
}
for(int cual = 0; cual < numeroMagos ; cual++){
ejercito.push_back(new Avatar("mago"));
}
*/
}
int Ejercito::getCantidadLuchadores(){
return cantidadLuchadores;
}
void Ejercito::setCantidadLuchadores(int numero){
cantidadLuchadores = numero;
}
int Ejercito::getCantidadTiradores(){
return cantidadTiradores;
}
void Ejercito::setCantidadTiradores(int numero){
cantidadLuchadores = numero;
}
int Ejercito::getCantidadMagos(){
return cantidadMagos;
}
void Ejercito::setCantidadMagos(int numero){
cantidadLuchadores = numero;
}
void Ejercito::setCantidadEjercito(int luchadores, int tiradores, int magos){
cantidadLuchadores = luchadores;
cantidadLuchadores = tiradores;
cantidadMagos = magos;
}
vector<Avatar*> Ejercito::getEjercito(){ //cree un nuevo tipo el cual es: vector<*avatar>
return ejercito;
}