Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

CSC112 Spring 2016 Examples

2370 views
1
#include "elPaca.h"
2
#include "hackPaca.h"
3
#include "cheatPaca.h"
4
#include "zenPaca.h"
5
#include "blobPaca.h"
6
#include "ischomer.h"
7
#include "../alpaca.h"
8
#include <sstream>
9
10
static int packNum = 0;
11
12
13
ischomer::FracasPack::FracasPack()
14
{
15
std::ostringstream os;
16
17
//give the packa a unique name
18
os << "Sick Pack, Bro" << packNum++;
19
packName=os.str();
20
21
//pack em in!
22
int i = 600;
23
int cheatCount = 1;
24
int blobCount = 1;
25
int zenCount = 1;
26
27
while(i>1) {
28
os.str(""); //reset
29
30
if(i == 310 or i == 160) {
31
os << "ZenPaca #" << packNum-1 << zenCount;
32
load(new zenPaca(os.str(), this));
33
i -= 150;
34
zenCount++;
35
continue;
36
}
37
38
if(i > 420) {
39
os << "BlobPaca #" << packNum-1 << blobCount;
40
load(new blobPaca(os.str(), this));
41
i -= 60;
42
blobCount++;
43
continue;
44
}
45
46
if(i == 420) {
47
os << "ElPaca #" << packNum-1 << "-1";
48
load(new elPaca(os.str(), this));
49
i -= 110;
50
continue;
51
}
52
53
//spam cheatPacas!!!
54
if (i <= 10) {
55
os << "CheatPaca #" << packNum-1 << "-" << cheatCount;
56
load(new cheatPaca(os.str(), this));
57
i--;
58
cheatCount++;
59
}
60
}
61
}
62
63
std::string
64
ischomer::FracasPack::name()
65
{
66
return packName;
67
}
68
69