-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtiny_test.cpp
More file actions
64 lines (59 loc) · 3.08 KB
/
tiny_test.cpp
File metadata and controls
64 lines (59 loc) · 3.08 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
#include "TinyAttack.h"
//#include "tinyAttack.cpp"
#include "Pokeman.h"
//#include "pokeman.cpp"
#include "State.h"
//#include "State.cpp"
#include <iostream>
#include <string.h>
using namespace std;
int main(int args, char** argv) {
cout << "*****************INITALIZING*TINY*TEST****************" << endl;
cout << "*****************CREATING*TINY*ATTACK*****************" << endl;
int i = 0;
string damage = "damage";
int power;
TinyAttack* ta = new TinyAttack(damage, -5, 5);
cout << "****************TINY*ATTACK*CREATED*******************" << endl;
power = ta->getPower();
cout << "****************TINY*ATTACK*TYPE: " + ta->getType() + "*********" << endl;
cout << "****************TINY*ATTACK*TYPE: " << power << "************" << endl;
cout << "******************************************************************" << endl;
cout << "*****************CREATING*POKEMAN*****************" << endl;
Pokeman* p = new Pokeman(10, 10, ta, ta);
cout << "****************POKEMAN*CREATED*******************" << endl;
cout << "****************POKEMAN*HEALTH: " << p->getHealth() << "*********************" << endl;
for(i=1; i < 3; i++){
cout << "****************POKEMAN*ATTACK*"<< i << "*TYPE: " << p->getAttack(i)->getType() << "********************************" << endl;
cout << "****************POKEMAN*ATTACK*"<< i << "*POWER: " << p->getAttack(i)->getPower() << "*********************************" << endl;
}
cout << "************************CLONING*TEH*POKEMANS*******************************" << endl;
Pokeman* clone = new Pokeman(*p);
cout << "************************CLONING*COMPLETE*******************************" << endl;
cout << "****************POKEMAN*HEALTH: " << clone->getHealth() << "*********************" << endl;
for(i=1; i < 3; i++){
cout << "****************POKEMAN*ATTACK*"<< i << "*TYPE: " << clone->getAttack(i)->getType() << "********************************" << endl;
cout << "****************POKEMAN*ATTACK*"<< i << "*POWER: " << clone->getAttack(i)->getPower() << "*********************************" << endl;
}
cout << "************************DAMAGING*CLONE**********************************" << endl;
bool cloneAlive = clone->changeHealth(-5);
if (cloneAlive == false) {
cout << "********************TEH*CLONE*DIED**************************" << endl;
}
cout << "************************TEH*CLONE'S*HEALTH: " << clone->getHealth() << "***********************" << endl;
cout << "***********************TEH*ORIGINAL'S*HEALTH: " << p->getHealth() << "***************************" << endl;
cout << "**************************************************************************************************" << endl;
p->usedAction(1);
p->print();
clone->print();
Pokeman* newPoke = new Pokeman(10, 10, ta, ta, ta, ta);
newPoke->print();
// cout << "**************************BEGINNING*STATE*TEST***************ALABAMA,ALASKA,ARIZONA,ARKANSAS,CALIFORNIA,COLORADO,CONNETICUT..." << endl;
// State* s = new State(p, clone, 1);
// while(!s->isOver){
// State* tempState = s->nextState(1);
//Delete State attached to s?
// s = tempState;
// }
return i;
}