Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

CSC112 Spring 2016 Examples

2370 views
1
#include "firePaca.h"
2
#include "earthPaca.h"
3
#include "fracasPack.h"
4
#include "../alpaca.h"
5
#include <sstream>
6
7
//static int packNum = 0;
8
9
cwillis::FracasPack::FracasPack()
10
{
11
std::ostringstream os;
12
13
//name the pack
14
os << "Caleb's Pack"; //<< packNum++;
15
packName=os.str();
16
17
//pack the 'pacas
18
load(new cwillis::firePaca("Fire", this));
19
for(int i=0; i<5; i++) {
20
os.str(""); //reset
21
os << "EarthPaca # " << i+1;
22
load(new cwillis::earthPaca(os.str(), this));
23
}
24
25
26
}
27
28
29
std::string
30
cwillis::FracasPack::name()
31
{
32
return packName;
33
}
34
35